0

I have 20 iMacros (for browser) and they are specific to different URLs. I run these macros one after another, and then repeat or loop all of them 10 times.

But within that loop, i need those 20 macros to run in a random fashion and not as in list.

What I tried:

I loop one Macro named COLLECTION.iim 10 times using .js file

var i;
for (i = 1; i <= 10; i++)
{
iimSet("loop", i);
iimPlay("COLLECTION.iim");
}

COLLECTION.iim contains the following randomise code for 20 imacros

CMDLINE !DATASOURCE C:\LIST.txt
SET !VAR1 EVAL("var randomNumber = Math.floor(Math.random() * 20) + 1; randomNumber;")
SET !DATASOURCE_LINE {{!VAR1}}
URL GOTO=imacros://run/?m={{!COL1}}

LIST.txt contains those 20 macro names written one per each line like

1.iim
2.iim 
.
.
20.iim

But this is not working. If there is any other better or easier way, let me know too.

slhck
  • 235,242

1 Answers1

-1

He's trying to do the same thing I am.

Combine Loop: https://stackoverflow.com/questions/17959454/how-to-loop-only-a-series-of-steps-in-imacros

with Random: https://stackoverflow.com/questions/31773368/imacros-random-choose

Your issue might be similar (or same as): https://stackoverflow.com/questions/19519024/imacros-randomly-stops-in-a-loop