iMacros:在 x 次循环后暂停 (Javascript)
iMacros: Pauze after x amount of loops (Javascript)
What I've read so far is that pausing in between loops is only
possible in javascript. I have a hard time getting my code to work in
Javascript.
我希望我的代码执行什么:
转到一个网站并单击一个按钮。
通过我的数据源文本文件循环访问站点的不同子域。
我想 运行 90 次循环(通过 90 个子域)暂停 1 小时,继续循环 90 次并再次暂停 1 小时等。(我的数据源文本文件包含 1000 多个子域) .
这是我的代码:
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 2); randomNumber;") /*after a button is pushed wait for a random number of seconds*/
SET !TIMEOUT_PAGE 120
SET !ERRORIGNORE YES
SET !DATASOURCE_DELIMITER ;
SET !DATASOURCE data_list.txt
SET !DATASOURCE_COLUMNS 1
URL GOTO=http://www.website.com/{{!COL1}}
TAG POS=1 TYPE=BUTTON ATTR=TXT:Button
WAIT SECONDS={{!var1}}
这很好用,我可以放置 x 个循环,代码 运行 就可以了。 但我不能/不知道如何在 javascript 中的 90 个循环后暂停。
这是我将代码转换为 javascript:
的程度
var macro;
var rand = "Math.floor(Math.random()*10 + 2)"; /*after a button is pushed wait for a random number of seconds*/
macro = "CODE:";
macro += "SET !TIMEOUT_PAGE 120" + "\n";
macro += "SET !TIMEOUT_TAG 0" + "\n";
macro += "SET !ERRORIGNORE YES" + "\n";
macro += "SET !DATASOURCE ACCOUNTS_NO.txt" + "\n";
macro += "SET !DATASOURCE_COLUMNS 1" + "\n";
macro += "SET !DATASOURCE_LINE {{!LOOP}}" + "\n";
macro += "URL GOTO=https://www.website.com/{{!COL1}}" + "\n";
macro += "TAG POS=1 TYPE=BUTTON ATTR=TXT:Button" + "\n";
macro += "WAIT SECONDS = {{rand}}" + "\n"; /***this does not seem to work in javascript*/**
iimPlay(macro)
javascript中的随机数不起作用。还有循环90次暂停1小时继续的代码还需要补充
Can anybody please help out?
我希望这个解决方案能有所帮助:
SET !LOOP 1
SET period 90
SET bigVAR1 3600
' /*after a button is pushed wait for a random number of seconds*/ '
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 2); randomNumber;")
SET !TIMEOUT_PAGE 120
SET !ERRORIGNORE YES
SET !DATASOURCE_DELIMITER ;
SET !DATASOURCE data_list.txt
SET !DATASOURCE_COLUMNS 1
URL GOTO=http://www.website.com/{{!COL1}}
TAG POS=1 TYPE=BUTTON ATTR=TXT:Button
SET !VAR1 EVAL("({{!LOOP}}%{{period}}) ? {{!VAR1}} : {{bigVAR1}};")
WAIT SECONDS={{!var1}}
(如您所见,无需将宏转换为 JavaScript。)
What I've read so far is that pausing in between loops is only possible in javascript. I have a hard time getting my code to work in Javascript.
我希望我的代码执行什么: 转到一个网站并单击一个按钮。 通过我的数据源文本文件循环访问站点的不同子域。 我想 运行 90 次循环(通过 90 个子域)暂停 1 小时,继续循环 90 次并再次暂停 1 小时等。(我的数据源文本文件包含 1000 多个子域) .
这是我的代码:
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 2); randomNumber;") /*after a button is pushed wait for a random number of seconds*/
SET !TIMEOUT_PAGE 120
SET !ERRORIGNORE YES
SET !DATASOURCE_DELIMITER ;
SET !DATASOURCE data_list.txt
SET !DATASOURCE_COLUMNS 1
URL GOTO=http://www.website.com/{{!COL1}}
TAG POS=1 TYPE=BUTTON ATTR=TXT:Button
WAIT SECONDS={{!var1}}
这很好用,我可以放置 x 个循环,代码 运行 就可以了。 但我不能/不知道如何在 javascript 中的 90 个循环后暂停。
这是我将代码转换为 javascript:
的程度var macro;
var rand = "Math.floor(Math.random()*10 + 2)"; /*after a button is pushed wait for a random number of seconds*/
macro = "CODE:";
macro += "SET !TIMEOUT_PAGE 120" + "\n";
macro += "SET !TIMEOUT_TAG 0" + "\n";
macro += "SET !ERRORIGNORE YES" + "\n";
macro += "SET !DATASOURCE ACCOUNTS_NO.txt" + "\n";
macro += "SET !DATASOURCE_COLUMNS 1" + "\n";
macro += "SET !DATASOURCE_LINE {{!LOOP}}" + "\n";
macro += "URL GOTO=https://www.website.com/{{!COL1}}" + "\n";
macro += "TAG POS=1 TYPE=BUTTON ATTR=TXT:Button" + "\n";
macro += "WAIT SECONDS = {{rand}}" + "\n"; /***this does not seem to work in javascript*/**
iimPlay(macro)
javascript中的随机数不起作用。还有循环90次暂停1小时继续的代码还需要补充
Can anybody please help out?
我希望这个解决方案能有所帮助:
SET !LOOP 1
SET period 90
SET bigVAR1 3600
' /*after a button is pushed wait for a random number of seconds*/ '
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 2); randomNumber;")
SET !TIMEOUT_PAGE 120
SET !ERRORIGNORE YES
SET !DATASOURCE_DELIMITER ;
SET !DATASOURCE data_list.txt
SET !DATASOURCE_COLUMNS 1
URL GOTO=http://www.website.com/{{!COL1}}
TAG POS=1 TYPE=BUTTON ATTR=TXT:Button
SET !VAR1 EVAL("({{!LOOP}}%{{period}}) ? {{!VAR1}} : {{bigVAR1}};")
WAIT SECONDS={{!var1}}
(如您所见,无需将宏转换为 JavaScript。)