loop imacro with js, pause for 20seconds, then start again

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
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
davep
Posts: 1
Joined: Fri Dec 13, 2013 8:31 pm

loop imacro with js, pause for 20seconds, then start again

Post by davep » Fri Dec 13, 2013 8:36 pm

Hi, I have the following js code but cant figure out how to pause it for 20 seconds then start it back up at the last position it left off at. Any help would be great!!

var macro;
macro = "CODE:";
macro += "TAG POS={{i}} TYPE=BUTTON ATTR=CLASS:btn<SP>btn-small<SP>likebutton" + "\n";
macro += "WAIT SECONDS=2" + "\n";
for(i=1;i<=5;i++){
if(i==5){
macro += "WAIT SECONDS=15" + "\n";
var i=6;
//iimSet("i",i);
iimPlay(macro);
}
iimSet("i",i);
iimPlay(macro);

}
Post Reply