Code: Select all
WAIT SECONDS=30
How do I set it to random number or read from a file.
I tried
Code: Select all
WAIT SECONDS={{!COL1}}
I appreciate any comment.
Code: Select all
WAIT SECONDS=30
Code: Select all
WAIT SECONDS={{!COL1}}
Code: Select all
for(var t,i=1;i<10;i++){
t=Math.round(10*Math.random());
iimDisplay('Wait #'+i+': '+t+' secs');
iimPlay('CODE:WAIT SECONDS='+t);
};
Code: Select all
WAIT SECONDS={{T}}
Code: Select all
iimSet('-var_T',''+t);
iimPlay('wait',t+30);
Code: Select all
t=Math.round(10*Math.random());
Code: Select all
t=15+Math.round(45*Math.random());
I can confirm this issue. But since Javascript can do its own looping, there is no need to start a Javascript with the loop button.PS: If you are using the iMacros for FX build-in Loop-Play facility, plz note, that it does not seem to work well (if at all) with javascript macros in the current latest version {VERSION BUILD=6000731 RECORDER=FX}.
Code: Select all
SET !DATASOURCE_LINE {{!LOOP}}
Code: Select all
SET !DATASOURCE_LINE {{!MYLOOP}}
Code: Select all
for(var t,i=1;i<10;i++){
iimSet ("MYLOOP", i)
iimPlay('YourMacro');
};
Is there a loop.js file or something that I can add that code to?Tech Support wrote:
and in the Javascript you define MYLOOP.Code: Select all
for(var t,i=1;i<10;i++){ iimSet ("MYLOOP", i) iimPlay('YourMacro'); };
Code: Select all
for(var t,i=1;i<10;i++){
iimSet ("MYLOOP", i)
iimPlay('YourMacro');
};
Code: Select all
var MyMacroCode
var t
var jsNewLine="\n"
t=Math.round(10*Math.random());
MyMacroCode = "CODE:"
MyMacroCode = MyMacroCode+"URL GOTO=http://www.iopus.com" + jsNewLine
MyMacroCode = MyMacroCode+"WAIT SECONDS=" + t + jsNewLine
MyMacroCode = MyMacroCode+"URL GOTO=http://forum.imacros.net"
iimDisplay("Random wait t="+t)
iimPlay(MyMacroCode)
iimDisplay("Script completed.")
Code: Select all
function frdln(n){
var fr,s='';
try{
fr=new java.io.BufferedReader(new java.io.FileReader(n));
s=fr.readLine();
if(s==null){s=''}else{s=''+s};
fr.close();
fr=null;
}catch(e){
alert(''+e);
};
return s;
};