Waiting 20 seconds in iMacros

2019-08-24 03:48发布

U have imacros script and I want to add wait seconds 60 When i reach to 20.

This is my code now:

var macro;

macro = "CODE:";

macro += "URL GOTO=http://example.com/msg?uid={{i}}\n";
macro +="TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:msg ATTR=ID:subject CONTENT=hello\n";
macro +="TAG POS=1 TYPE=TEXTAREA FORM=NAME:msg ATTR=ID:message CONTENT=hi\n";
macro +="TAG POS=1 TYPE=INPUT:IMAGE FORM=NAME:msg ATTR=ID:btn_save";

for (var i=1;i<300;i++){
    iimSet("i",i)
    iimPlay(macro)
}

iimDisplay("Script completed.");

And I also tried this one:

var macro;

macro = "CODE:";

macro += "URL GOTO=http://example.com/msg?uid={{i}}\n";
macro +="TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:msg ATTR=ID:subject CONTENT=hello\n";
macro +="TAG POS=1 TYPE=TEXTAREA FORM=NAME:msg ATTR=ID:message CONTENT=hi\n";
macro +="TAG POS=1 TYPE=INPUT:IMAGE FORM=NAME:msg ATTR=ID:btn_save";
iimDisplay("Send Macro via iimPlay");
retcode = iimPlay(macro);

var i=2

while(true){

    if(i%20==0){    
        iimPlay("CODE: WAIT SECONDS=60")
    }

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

for (var i=1;i<999;i++){
    iimSet("i",i)
    iimPlay(macro)
}

iimDisplay("Script completed.");

But both code are not working for me. Can anybody help me? Thank you !

标签: imacros
1条回答
倾城 Initia
2楼-- · 2019-08-24 04:08

In your first code change the loop in the following way:

for (i = 1; i < 300; i++){
    if (i == 20)
        iimPlayCode("WAIT SECONDS=60");
    iimSet("i", i);
    iimPlay(macro);
}
查看更多
登录 后发表回答