A small Question. (maybe major).

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
SorenC
Posts: 36
Joined: Wed Oct 28, 2009 4:33 pm

A small Question. (maybe major).

Post by SorenC » Thu Nov 19, 2009 7:56 am

Hey people. :)

Once again i come to you in need of assistance.

This time, its to make my current makro even more efficient.

Here is the current makro:

Code: Select all

VERSION BUILD=6240709 RECORDER=FX
TAB T=1
CLEAR
SET !ERRORIGNORE YES
CMDLINE !DATASOURCE users.csv
SET !DATASOURCE_COLUMNS 2
SET !LOOP {{csvRow}}					
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO=http://www.facebook.com/
TAG POS=1 TYPE=A ATTR=TXT:English<SP>(US)
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://login.facebook.com/login.php?login_attempt=1 ATTR=ID:email CONTENT={{!COL1}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:https://login.facebook.com/login.php?login_attempt=1 ATTR=ID:pass CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login_form ATTR=VALUE:Login
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login_form ATTR=VALUE:Anmelden
URL GOTO=http://genau.dk/aaretstatovering/voteny.php?unik_idnr=118
SAVEAS TYPE=PNG FOLDER=* FILE=Vote19_{{!NOW:yyyymmdd_hhnnss}}
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:Logout
WAIT SECONDS={{randomWait}}
Which is being started by this javascript:

Code: Select all

const totalIterations = 258; // How many times to loop
const startRow = 2; // Which row of the CSV file to start on

for (var i=0 ; i<=totalIterations; i++)
{
    var csvRow = i + startRow; 
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() );
    iimSet("csvRow", csvRow.toString() );
    iimPlay("FacebookVote.iim");
}
But, what i would like to know, is this. Is it possible to have the makro take every 2nd or 3rd line in the users.cvs file and then make it go to another url instead of the currrent one?. So that every 2nd or 3rd run the macro makes, it switches the url with another one.?.
Hannes, Tech Support

Re: A small Question. (maybe major).

Post by Hannes, Tech Support » Thu Nov 19, 2009 8:26 am

A short note on your current solution:

The macro uses the !LOOP variable, but is not played in loop mode. The !LOOP value is just used in DATASOURCE_LINE. So you can directly use {{csvRow}} to fill DATASOURCE_LINE:

Macro:

Code: Select all

VERSION BUILD=6240709 RECORDER=FX
TAB T=1
CLEAR
SET !ERRORIGNORE YES
SET !DATASOURCE users.csv
SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_LINE {{csvRow}}
URL GOTO=http://www.facebook.com/
TAG POS=1 TYPE=A ATTR=TXT:English<SP>(US)
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://login.facebook.com/login.php?login_attempt=1 ATTR=ID:email CONTENT={{!COL1}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:https://login.facebook.com/login.php?login_attempt=1 ATTR=ID:pass CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login_form ATTR=VALUE:Login
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login_form ATTR=VALUE:Anmelden
URL GOTO=http://genau.dk/aaretstatovering/voteny.php?unik_idnr=118
SAVEAS TYPE=PNG FOLDER=* FILE=Vote19_{{!NOW:yyyymmdd_hhnnss}}
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:Logout
WAIT SECONDS={{randomWait}}
to run the macro on every second line of input, you could increase the loop variable by two (i=i+2) each loop

Code: Select all

const totalIterations = 258; // How many times to loop
const startRow = 2; // Which row of the CSV file to start on
' note that we use "i=i+2" instead of "i++" to skip every second line of input
for (var i=0 ; i<=totalIterations; i=i+2)
{
    var csvRow = i + startRow;
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() );
    iimSet("csvRow", csvRow.toString() );
    iimPlay("FacebookVote.iim");
}
SorenC
Posts: 36
Joined: Wed Oct 28, 2009 4:33 pm

Re: A small Question. (maybe major).

Post by SorenC » Thu Nov 19, 2009 8:42 am

Hannes, iOpus wrote:A short note on your current solution:

The macro uses the !LOOP variable, but is not played in loop mode. The !LOOP value is just used in DATASOURCE_LINE. So you can directly use {{csvRow}} to fill DATASOURCE_LINE:

Macro:

Code: Select all

VERSION BUILD=6240709 RECORDER=FX
TAB T=1
CLEAR
SET !ERRORIGNORE YES
SET !DATASOURCE users.csv
SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_LINE {{csvRow}}
URL GOTO=http://www.facebook.com/
TAG POS=1 TYPE=A ATTR=TXT:English<SP>(US)
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://login.facebook.com/login.php?login_attempt=1 ATTR=ID:email CONTENT={{!COL1}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:https://login.facebook.com/login.php?login_attempt=1 ATTR=ID:pass CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login_form ATTR=VALUE:Login
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login_form ATTR=VALUE:Anmelden
URL GOTO=http://genau.dk/aaretstatovering/voteny.php?unik_idnr=118
SAVEAS TYPE=PNG FOLDER=* FILE=Vote19_{{!NOW:yyyymmdd_hhnnss}}
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:Logout
WAIT SECONDS={{randomWait}}
to run the macro on every second line of input, you could increase the loop variable by two (i=i+2) each loop

Code: Select all

const totalIterations = 258; // How many times to loop
const startRow = 2; // Which row of the CSV file to start on
' note that we use "i=i+2" instead of "i++" to skip every second line of input
for (var i=0 ; i<=totalIterations; i=i+2)
{
    var csvRow = i + startRow;
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() );
    iimSet("csvRow", csvRow.toString() );
    iimPlay("FacebookVote.iim");
}
Looks fine.

But how do i get the macro to run another link in the 2nd or 3rd run?. So that Imacros changes the link:

Code: Select all

URL GOTO=http://genau.dk/aaretstatovering/voteny.php?unik_idnr=118
To another one for that 2nd or 3rd run only. :)
ABooth
Posts: 223
Joined: Mon Aug 10, 2009 4:25 pm

Re: A small Question. (maybe major).

Post by ABooth » Thu Nov 19, 2009 5:50 pm

SorenC wrote:
Hannes, iOpus wrote:A short note on your current solution:

The macro uses the !LOOP variable, but is not played in loop mode. The !LOOP value is just used in DATASOURCE_LINE. So you can directly use {{csvRow}} to fill DATASOURCE_LINE:

Macro:

Code: Select all

VERSION BUILD=6240709 RECORDER=FX
TAB T=1
CLEAR
SET !ERRORIGNORE YES
SET !DATASOURCE users.csv
SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_LINE {{csvRow}}
URL GOTO=http://www.facebook.com/
TAG POS=1 TYPE=A ATTR=TXT:English<SP>(US)
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://login.facebook.com/login.php?login_attempt=1 ATTR=ID:email CONTENT={{!COL1}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:https://login.facebook.com/login.php?login_attempt=1 ATTR=ID:pass CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login_form ATTR=VALUE:Login
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login_form ATTR=VALUE:Anmelden
URL GOTO=http://genau.dk/aaretstatovering/voteny.php?unik_idnr=118
SAVEAS TYPE=PNG FOLDER=* FILE=Vote19_{{!NOW:yyyymmdd_hhnnss}}
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:Logout
WAIT SECONDS={{randomWait}}
to run the macro on every second line of input, you could increase the loop variable by two (i=i+2) each loop

Code: Select all

const totalIterations = 258; // How many times to loop
const startRow = 2; // Which row of the CSV file to start on
' note that we use "i=i+2" instead of "i++" to skip every second line of input
for (var i=0 ; i<=totalIterations; i=i+2)
{
    var csvRow = i + startRow;
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() );
    iimSet("csvRow", csvRow.toString() );
    iimPlay("FacebookVote.iim");
}
Looks fine.

But how do i get the macro to run another link in the 2nd or 3rd run?. So that Imacros changes the link:

Code: Select all

URL GOTO=http://genau.dk/aaretstatovering/voteny.php?unik_idnr=118
To another one for that 2nd or 3rd run only. :)
You could use an array instead of a loop counter, assuming every iteration goes to a different URL

Here's an example:-

Code: Select all

const startRow = 2; // Which row of the CSV file to start on
const rowIncrement = 2; // every 2nd row

var urlCollection = new Array
(
	 'http://www.google.com'
	,'http://yahoo.com'
	,'http://www.facebook.com'
	,'http://www.myspace.com'
);

var rowOffset = 0;

for each(url in urlCollection) //Loop through each URL 
{
    var csvRow = rowOffset + startRow; 
	
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() ); //The random wait time in seconds
    iimSet("csvRow", csvRow.toString() ); //The CSV row to use for data
    iimSet("destinationUrl", url ); // The URL to go to.
	
    iimPlay("FacebookVote.iim");
	
	rowOffset += rowIncrement; // Increment the row
}
Then your macro line would be

Code: Select all

URL GOTO={{destinationUrl}}
iMacros for Firefox supports JavaScript Macros (Scripting)
JavaScript supports Java via LiveConnect

Therefore: You can write powerful macros with iMacros for Firefox. Have a look at this one

Post feature requests here. Maybe one day, they'll pin it?
SorenC
Posts: 36
Joined: Wed Oct 28, 2009 4:33 pm

Re: A small Question. (maybe major).

Post by SorenC » Thu Nov 19, 2009 10:42 pm

ABooth wrote:
SorenC wrote:
Hannes, iOpus wrote:A short note on your current solution:

The macro uses the !LOOP variable, but is not played in loop mode. The !LOOP value is just used in DATASOURCE_LINE. So you can directly use {{csvRow}} to fill DATASOURCE_LINE:

Macro:

Code: Select all

VERSION BUILD=6240709 RECORDER=FX
TAB T=1
CLEAR
SET !ERRORIGNORE YES
SET !DATASOURCE users.csv
SET !DATASOURCE_COLUMNS 2
SET !DATASOURCE_LINE {{csvRow}}
URL GOTO=http://www.facebook.com/
TAG POS=1 TYPE=A ATTR=TXT:English<SP>(US)
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://login.facebook.com/login.php?login_attempt=1 ATTR=ID:email CONTENT={{!COL1}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:https://login.facebook.com/login.php?login_attempt=1 ATTR=ID:pass CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login_form ATTR=VALUE:Login
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login_form ATTR=VALUE:Anmelden
URL GOTO=http://genau.dk/aaretstatovering/voteny.php?unik_idnr=118
SAVEAS TYPE=PNG FOLDER=* FILE=Vote19_{{!NOW:yyyymmdd_hhnnss}}
FRAME F=0
TAG POS=1 TYPE=A ATTR=TXT:Logout
WAIT SECONDS={{randomWait}}
to run the macro on every second line of input, you could increase the loop variable by two (i=i+2) each loop

Code: Select all

const totalIterations = 258; // How many times to loop
const startRow = 2; // Which row of the CSV file to start on
' note that we use "i=i+2" instead of "i++" to skip every second line of input
for (var i=0 ; i<=totalIterations; i=i+2)
{
    var csvRow = i + startRow;
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() );
    iimSet("csvRow", csvRow.toString() );
    iimPlay("FacebookVote.iim");
}
Looks fine.

But how do i get the macro to run another link in the 2nd or 3rd run?. So that Imacros changes the link:

Code: Select all

URL GOTO=http://genau.dk/aaretstatovering/voteny.php?unik_idnr=118
To another one for that 2nd or 3rd run only. :)
You could use an array instead of a loop counter, assuming every iteration goes to a different URL

Here's an example:-

Code: Select all

const startRow = 2; // Which row of the CSV file to start on
const rowIncrement = 2; // every 2nd row

var urlCollection = new Array
(
	 'http://www.google.com'
	,'http://yahoo.com'
	,'http://www.facebook.com'
	,'http://www.myspace.com'
);

var rowOffset = 0;

for each(url in urlCollection) //Loop through each URL 
{
    var csvRow = rowOffset + startRow; 
	
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() ); //The random wait time in seconds
    iimSet("csvRow", csvRow.toString() ); //The CSV row to use for data
    iimSet("destinationUrl", url ); // The URL to go to.
	
    iimPlay("FacebookVote.iim");
	
	rowOffset += rowIncrement; // Increment the row
}
Then your macro line would be

Code: Select all

URL GOTO={{destinationUrl}}
Would that work with 2 links?. Like this:

1st row goes to www.google.com
2nd row goes to www.hotmail.com
3rd row goes to www.google.com

etc etc ?.
ABooth
Posts: 223
Joined: Mon Aug 10, 2009 4:25 pm

Re: A small Question. (maybe major).

Post by ABooth » Fri Nov 20, 2009 5:24 pm

SorenC wrote:Would that work with 2 links?. Like this:

1st row goes to http://www.google.com
2nd row goes to http://www.hotmail.com
3rd row goes to http://www.google.com

etc etc ?.
Only by setting the array that way

Code: Select all

var urlCollection = new Array
(
	 'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
);

If it is only ever going to be 1 of 2 URLs, it would be much better to loop a different way, with an array like

Code: Select all

var urlCollection = new Array
(
	 'http://www.google.com'
	,'http://www.hotmail.com'
);
And a toggle to select either urlCollection[0] or urlCollection[1]

Such as: -

Code: Select all

const totalIterations = 258; // How many times to loop
const startRow = 2; // Which row of the CSV file to start on
var toggle; // URL toggle

var urlCollection = new Array
(
    'http://www.google.com'
   ,'http://www.hotmail.com'
);

for (var i=0; i<totalIterations; i+=2)
{
    var csvRow = i + startRow;
	
    toggle = ( 1 == toggle )? 0: 1;
	
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() );
    iimSet("csvRow", csvRow.toString() );
    iimSet("destinationUrl", urlCollection[toggle] ); // The URL to go to.
	
    iimPlay("FacebookVote.iim");
}
iMacros for Firefox supports JavaScript Macros (Scripting)
JavaScript supports Java via LiveConnect

Therefore: You can write powerful macros with iMacros for Firefox. Have a look at this one

Post feature requests here. Maybe one day, they'll pin it?
SorenC
Posts: 36
Joined: Wed Oct 28, 2009 4:33 pm

Re: A small Question. (maybe major).

Post by SorenC » Fri Nov 20, 2009 7:44 pm

ABooth wrote:
SorenC wrote:Would that work with 2 links?. Like this:

1st row goes to http://www.google.com
2nd row goes to http://www.hotmail.com
3rd row goes to http://www.google.com

etc etc ?.
Only by setting the array that way

Code: Select all

var urlCollection = new Array
(
	 'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
	,'http://www.hotmail.com'
	,'http://www.google.com'
);

If it is only ever going to be 1 of 2 URLs, it would be much better to loop a different way, with an array like

Code: Select all

var urlCollection = new Array
(
	 'http://www.google.com'
	,'http://www.hotmail.com'
);
And a toggle to select either urlCollection[0] or urlCollection[1]

Such as: -

Code: Select all

const totalIterations = 258; // How many times to loop
const startRow = 2; // Which row of the CSV file to start on
var toggle; // URL toggle

var urlCollection = new Array
(
    'http://www.google.com'
   ,'http://www.hotmail.com'
);

for (var i=0; i<totalIterations; i+=2)
{
    var csvRow = i + startRow;
	
    toggle = ( 1 == toggle )? 0: 1;
	
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() );
    iimSet("csvRow", csvRow.toString() );
    iimSet("destinationUrl", urlCollection[toggle] ); // The URL to go to.
	
    iimPlay("FacebookVote.iim");
}
And what would i have to put into my macro, as for the url is has to go to?. what would be the {{ ? }} ?
ABooth
Posts: 223
Joined: Mon Aug 10, 2009 4:25 pm

Re: A small Question. (maybe major).

Post by ABooth » Mon Nov 23, 2009 1:46 pm

SorenC wrote:And what would i have to put into my macro, as for the url is has to go to?. what would be the {{ ? }} ?

Code: Select all

URL GOTO={{destinationUrl}}
iMacros for Firefox supports JavaScript Macros (Scripting)
JavaScript supports Java via LiveConnect

Therefore: You can write powerful macros with iMacros for Firefox. Have a look at this one

Post feature requests here. Maybe one day, they'll pin it?
SorenC
Posts: 36
Joined: Wed Oct 28, 2009 4:33 pm

Re: A small Question. (maybe major).

Post by SorenC » Mon Nov 23, 2009 2:35 pm

ABooth wrote:
SorenC wrote:And what would i have to put into my macro, as for the url is has to go to?. what would be the {{ ? }} ?

Code: Select all

URL GOTO={{destinationUrl}}
So this would make it so that it would take:

1st run: www.google.com
2nd run: www.hotmail.com.

etc?
ABooth
Posts: 223
Joined: Mon Aug 10, 2009 4:25 pm

Re: A small Question. (maybe major).

Post by ABooth » Mon Nov 23, 2009 2:38 pm

SorenC wrote:
ABooth wrote:
SorenC wrote:And what would i have to put into my macro, as for the url is has to go to?. what would be the {{ ? }} ?

Code: Select all

URL GOTO={{destinationUrl}}
So this would make it so that it would take:

1st run: http://www.google.com
2nd run: http://www.hotmail.com.

etc?
1 : http://www.hotmail.com.
2 : http://www.google.com
3 : http://www.hotmail.com.
4 : http://www.google.com
5 : http://www.hotmail.com.
6 : http://www.google.com
7 : http://www.hotmail.com.
8 : http://www.google.com
9 : http://www.hotmail.com.
10 : http://www.google.com

...

129 : http://www.hotmail.com.
iMacros for Firefox supports JavaScript Macros (Scripting)
JavaScript supports Java via LiveConnect

Therefore: You can write powerful macros with iMacros for Firefox. Have a look at this one

Post feature requests here. Maybe one day, they'll pin it?
SorenC
Posts: 36
Joined: Wed Oct 28, 2009 4:33 pm

Re: A small Question. (maybe major).

Post by SorenC » Mon Nov 23, 2009 2:57 pm

So if i wanted it to go every 3rd run. it would look like this:

Code: Select all

const totalIterations = 258; // How many times to loop
const startRow = 2; // Which row of the CSV file to start on
var toggle; // URL toggle

var urlCollection = new Array
(
    'http://www.google.com'
   ,'http://www.google.com'
   ,'http://www.hotmail.com'
);

for (var i=0; i<totalIterations; i+=2)
{
    var csvRow = i + startRow;
   
    toggle = ( 1 == toggle )? 0: 1;
   
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() );
    iimSet("csvRow", csvRow.toString() );
    iimSet("destinationUrl", urlCollection[toggle] ); // The URL to go to.
   
    iimPlay("FacebookVote.iim");
}
or have i misunderstood something?.
ABooth
Posts: 223
Joined: Mon Aug 10, 2009 4:25 pm

Re: A small Question. (maybe major).

Post by ABooth » Mon Nov 23, 2009 3:24 pm

SorenC wrote:
SorenC wrote:
So this would make it so that it would take:

1st run: http://www.google.com
2nd run: http://www.hotmail.com.

etc?
So if i wanted it to go every 3rd run. it would look like this:

Code: Select all

const totalIterations = 258; // How many times to loop
const startRow = 2; // Which row of the CSV file to start on
var toggle; // URL toggle

var urlCollection = new Array
(
    'http://www.google.com'
   ,'http://www.google.com'
   ,'http://www.hotmail.com'
);

for (var i=0; i<totalIterations; i+=2)
{
    var csvRow = i + startRow;
   
    toggle = ( 1 == toggle )? 0: 1;
   
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() );
    iimSet("csvRow", csvRow.toString() );
    iimSet("destinationUrl", urlCollection[toggle] ); // The URL to go to.
   
    iimPlay("FacebookVote.iim");
}
or have i misunderstood something?.
No. The "toggle" determines what to select.

If you wanted:

http://www.google.com
http://www.google.com
http://www.hotmail.com
http://www.google.com
http://www.google.com
http://www.hotmail.com

You would need

Code: Select all

const totalIterations = 258; // How many times to loop
const startRow = 2; // Which row of the CSV file to start on
var iteration = 0; // Loop iteration
const alternateUrlRedirect = 3; // Every nth iteration, go to different URL

var urlCollection = new Array
(
    'http://www.google.com'
   ,'http://www.hotmail.com'
);

for (var i=0; i<totalIterations; i+=2)
{
    var csvRow = i + startRow;
    var index;

    if (iteration++ < alternateUrlRedirect -1 ) // If the current iteration is not the alternateUrlRedirect 
    {
        index = 0; // Select URL urlCollection[ 0 ] 
    }
    else
    {
        index = 1; // Select URL urlCollection[ 1 ] 
        iteration = 0; // Reset the iterator because we've hit the alternateUrlRedirect iteration.
    }
 
    iimSet("randomWait", Math.floor((Math.random()*180)+240).toString() );
    iimSet("csvRow", csvRow.toString() );
    iimSet("destinationUrl", urlCollection[index] ); // The URL to go to.
   
    iimPlay("FacebookVote.iim");
}

You would check to see if you're on the 3rd, 6th 9th etc iteration and if so, select the alternate URL (http://www.hotmail.com), otherwise, select the 1st (http://www.google.com)
iMacros for Firefox supports JavaScript Macros (Scripting)
JavaScript supports Java via LiveConnect

Therefore: You can write powerful macros with iMacros for Firefox. Have a look at this one

Post feature requests here. Maybe one day, they'll pin it?
Post Reply