2012-12-10 138 views
1

我試圖在30分鐘到1小時之間隨機等待。Imacros:隨機等待時間?

我正在使用的代碼應該這樣做,但在代碼的最後一行之後腳本停止。

這裏的腳本

TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:true-random-integer-generator-min CONTENT=900 
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:true-random-integer-generator-max CONTENT=3600 
WAIT SECONDS=1 
TAG POS=1 TYPE=SPAN ATTR=ID:true-random-integer-generator-result&&TXT:* EXTRACT=TXT 
SET !VAR1 {{!EXTRACT}} 
WAIT SECONDS={{!VAR1}} 
SET !EXTRACT NULL 

回答

3
'set the delay lower limit, this can be changed 
SET !VAR1 1800 
'set the remaining time interval that need randomized 
SET !VAR2 1800 
'calculate the random number 
SET !VAR3 EVAL("var randomNumber=Math.floor(Math.random()*\"{{!VAR2}}\" +\"{{!VAR1}}\"); randomNumber;") 
WAIT SECONDS={{!VAR3}}