Вопрос

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;
 iimPlay(macro);
}
iimSet("i",i);
 iimPlay(macro);

}
Это было полезно?

Решение

var macro;
macro = "CODE:";
macro += "TAG POS={{i}} TYPE=BUTTON ATTR=CLASS:btn<SP>btn-small<SP>likebutton"    + "\n";
macro += "WAIT SECONDS=2" + "\n";


var i=1;

while(true)
{

//pause each fifth loop
if(i%5==0)
{

iimPlay("CODE: WAIT SECONDS=20")

}
iimSet("i",i);
iimPlay(macro);

//increase counter
i++; 
}

This is the code that will loop infinite loop. Each fifth loop it will pause and wait for 20 seconds. Then it will move on from the next loop counter.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top