简体   繁体   中英

Loop specific line(s) in iMacros

I have this iMacros script. All i need is a way, i supose Javascript, to replay the last 3 lines for 10 times.

URL GOTO=http://mywebsite.here.com/

SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*20 + 5); randomNumber;")
WAIT SECONDS={{!VAR1}}
TAG POS=1 TYPE=A ATTR=TXT:Get<SP>a<SP>random<SP>post!

I need it to go to my url once, and wait for random seconds and click the button 10 times. Thanks in advance.

In your case I suggest trying the following macro:

SET url EVAL("({{!LOOP}} == 1) ? 'http://mywebsite.here.com/' : 'STAY ON THIS PAGE';")
SET !ERRORIGNORE YES
URL GOTO={{url}}
SET !ERRORIGNORE NO

SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*20 + 5); randomNumber;")
WAIT SECONDS={{!VAR1}}
TAG POS=1 TYPE=A ATTR=TXT:Get<SP>a<SP>random<SP>post!

Play it in loop mode with the 'Max:' value set to 10.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM