Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make {{!LOOP}} increase by 10 in iMacros

Tags:

imacros

I have problems with making !LOOP jump +10 each time instead of +1.

Here is my code:

VERSION BUILD=8810214 RECORDER=FX
TAB T=1

SET !ERRORIGNORE YES
SET !VAR1 100
SET !LOOP {{!VAR1}}

URL GOTO=http://www.example.com/lui/?page={{!LOOP}}

WAIT SECONDS=1

ADD !VAR1 10

Running this still makes iMacros jump +1 each loop.

Above sample goes to page=100,page=101,page=102,page=103 instead of page=100,page=110,page=120

Best regards,

Lui Kang

like image 407
Liu Kang Avatar asked Dec 15 '22 00:12

Liu Kang


1 Answers

The variable {{!LOOP}} represents the current loop number when a script is running in loop mode.

You can still get 100,110,120... via a javascript expression: init+step*loop.

Try the EVAL command:

SET !LOOP 0
SET INIT 100
SET STEP 10
SET VALUE EVAL("{{INIT}}+{{STEP}}*{{!LOOP}}")
URL GOTO=http://www.example.com/lui/?page={{VALUE}}
like image 112
kev Avatar answered Dec 28 '22 09:12

kev