在 iMacros 中等待 20 秒

Waiting 20 seconds in iMacros

你有 imacros 脚本,我想添加 wait seconds 60 When i 达到 20.

现在这是我的代码:

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.");

我也试过这个:

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.");

但这两个代码都不适合我。有谁能够帮助我?谢谢!

在您的第一个代码中,按以下方式更改循环:

for (i = 1; i < 300; i++){
    if (i == 20)
        iimPlayCode("WAIT SECONDS=60");
    iimSet("i", i);
    iimPlay(macro);
}