1

Hey guys please help me out on this one. How can I get my iMacros on mozilla to go to random URL's For instance first on google.com second on gmail.com third on youtube and so on

I don't want anything like this :-

VERSION BUILD=8601111 RECORDER=FX
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=www.google.com/
URL GOTO=www.youtube.com
Refresh

Instead it should surf something like this:-

VERSION BUILD=8601111 RECORDER=FX
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=www.google.com/  OR  www.youtube.com  OR  www.yahoo.com 
Refresh

and that too randomly

laaposto
  • 11,835
  • 15
  • 54
  • 71

1 Answers1

0

What you are asking is if clauses.

var macro;

macro ="CODE:";
macro +="VERSION BUILD=8601111 RECORDER=FX"+"\n";
macro +="TAB T=1"+"\n";
macro +="TAB CLOSEALLOTHERS"+"\n";
macro +="URL GOTO={{link}}"+"\n";


var link=["www.google.com","www.youtube.com","www.yahoo.com"];

var random=getRandomInt(1,3);

random--;

iimSet("link",link[random])
iimPlay(macro)

You will find random function on the link bellow. Also there are tons of examples of iMacros and JS on stackoverflow.

Generating random whole numbers in JavaScript in a specific range?

Community
  • 1
  • 1
edinvnode
  • 3,497
  • 7
  • 30
  • 53