set random wait time between 50-60 seconds
Forum rules
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
set random wait time between 50-60 seconds
on imacros scripting edition how do you set a wait time to be random between to times , like between 50 and 60 seconds , so it will be like
54
58
50
56
59
51
?? how i do this ?
54
58
50
56
59
51
?? how i do this ?
- Tech Support
- Posts: 4948
- Joined: Tue Sep 20, 2005 7:25 pm
- Contact:
Re: set random wait time between 50-60 seconds
Please see this example: http://wiki.imacros.net/Random-Numbers.vbs
In your case the script simply needs to create a random number and pass it to the browser:
set iim1= CreateObject ("imacros")
iret = iim1.iimInit
'Initialize the Rnd function
Randomize
'Create random number between 0...10 and add it to 50
rn = 50+cint (rnd()*11)
iret = iim1.iimSet("mynumber", cstr(rn))
'Run the macro
iret = iim1.iimPlay("macro")
---
and in the macro you use
WAIT SECONDS={{mynumber}}
In your case the script simply needs to create a random number and pass it to the browser:
set iim1= CreateObject ("imacros")
iret = iim1.iimInit
'Initialize the Rnd function
Randomize
'Create random number between 0...10 and add it to 50
rn = 50+cint (rnd()*11)
iret = iim1.iimSet("mynumber", cstr(rn))
'Run the macro
iret = iim1.iimPlay("macro")
---
and in the macro you use
WAIT SECONDS={{mynumber}}
Re: set random wait time between 50-60 seconds
excuse me, but can you explain me a thing?
I use imacros for firefox
I insert this line in my macro file mymacrofile.ims
but what is the name of the file who contain the random "code"?
where do I insert this "code"?
I use imacros for firefox
this is clear:Tech Support wrote: and in the macro you use
WAIT SECONDS={{mynumber}}
I insert this line in my macro file mymacrofile.ims
but what is the name of the file who contain the random "code"?
where do I insert this "code"?
Tech Support wrote:Please see this example: http://wiki.imacros.net/Random-Numbers.vbs
In your case the script simply needs to create a random number and pass it to the browser:
set iim1= CreateObject ("imacros")
iret = iim1.iimInit
'Initialize the Rnd function
Randomize
'Create random number between 0...10 and add it to 50
rn = 50+cint (rnd()*11)
iret = iim1.iimSet("mynumber", cstr(rn))
'Run the macro
iret = iim1.iimPlay("macro")
Re: set random wait time between 50-60 seconds
I'm still waiting for a clear answer to the above post Tried figuring out by reading parts to wiki but it seems like a riddleservet wrote:excuse me, but can you explain me a thing?
I use imacros for firefox
this is clear:Tech Support wrote: and in the macro you use
WAIT SECONDS={{mynumber}}
I insert this line in my macro file mymacrofile.ims
but what is the name of the file who contain the random "code"?
where do I insert this "code"?
Tech Support wrote:Please see this example: http://wiki.imacros.net/Random-Numbers.vbs
In your case the script simply needs to create a random number and pass it to the browser:
set iim1= CreateObject ("imacros")
iret = iim1.iimInit
'Initialize the Rnd function
Randomize
'Create random number between 0...10 and add it to 50
rn = 50+cint (rnd()*11)
iret = iim1.iimSet("mynumber", cstr(rn))
'Run the macro
iret = iim1.iimPlay("macro")
- Tech Support
- Posts: 4948
- Joined: Tue Sep 20, 2005 7:25 pm
- Contact:
Re: set random wait time between 50-60 seconds
The create random number script code is here: http://wiki.imacros.net/Random-Numbers.vbs
It is for use with the iMacros Scripting Interface. However, you can also create such a script in Javascript inside Firefox: http://wiki.imacros.net/iMacros_for_Fir ... _Interface - if you do this, it would be great if you can post your solution here!
It is for use with the iMacros Scripting Interface. However, you can also create such a script in Javascript inside Firefox: http://wiki.imacros.net/iMacros_for_Fir ... _Interface - if you do this, it would be great if you can post your solution here!
Re: set random wait time between 50-60 seconds
but what do I save the random "code" as?(a *.vbs or *.js??) & Where do I insert this file? I'm on iMacros scripting edition for IE7Tech Support wrote:The create random number script code is here: http://wiki.imacros.net/Random-Numbers.vbs
It is for use with the iMacros Scripting Interface. However, you can also create such a script in Javascript inside Firefox: http://wiki.imacros.net/iMacros_for_Fir ... _Interface - if you do this, it would be great if you can post your solution here!
EDIT: How exactly do you make the random code script and macro work together, in baby steps so I can understand
Re: set random wait time between 50-60 seconds
Hello,
I also have this problem and did not understand how to solve.
Do I have to save the tech support's script as another file that starts the macro?
I need a random number between 0 and 1, so I tried
- didn't work - and
- also didn't work.
Can anybody explain if the script is used outside the macro in a different file or in an inside part?
Or maybe a complete different solution?
Pleeease give me details.
Kisses to our script gurus
Marzani
I also have this problem and did not understand how to solve.
Do I have to save the tech support's script as another file that starts the macro?
I need a random number between 0 and 1, so I tried
Code: Select all
<script language="JavaScript">setTimeout(Math.random(););</script>
Code: Select all
wait seconds=Math.random();
Can anybody explain if the script is used outside the macro in a different file or in an inside part?
Or maybe a complete different solution?
Pleeease give me details.
Kisses to our script gurus
Marzani
- Tech Support
- Posts: 4948
- Joined: Tue Sep 20, 2005 7:25 pm
- Contact:
Re: set random wait time between 50-60 seconds
Please use the new iMacros V7.5 Beta - here we have the new EVAL command that makes creating random values of all kinds super easy:
Code: Select all
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 50); randomNumber;")
URL GOTO=http://www.iopus.com
' waits 50 to 60 seconds
WAIT SECONDS={{!VAR1}}
Re: set random wait time between 50-60 seconds
Hello, and what about random Direct Screen clicks on v7.5 ?
I would like to DS click on links from 10 to 10 pixels until pixel 100 so pixel 10,20,...100
In other words, can DS command be used with a variable in this way :
SET !RANDVAR EVAL("var randomNumber=Math.floor(Math.random()*100); randomNumber;")
DS CMD=CLICK X=RANDVAR Y=100 CONTENT=
Is this possible ?
Also, I would like on the next Imacros those commands :
test command :
IF... THEN
repeat/go to line command :
GOTO LINE
math commands :
/ * + -
Is this possible too ?
I would like to DS click on links from 10 to 10 pixels until pixel 100 so pixel 10,20,...100
In other words, can DS command be used with a variable in this way :
SET !RANDVAR EVAL("var randomNumber=Math.floor(Math.random()*100); randomNumber;")
DS CMD=CLICK X=RANDVAR Y=100 CONTENT=
Is this possible ?
Also, I would like on the next Imacros those commands :
test command :
IF... THEN
repeat/go to line command :
GOTO LINE
math commands :
/ * + -
Is this possible too ?
- Tech Support
- Posts: 4948
- Joined: Tue Sep 20, 2005 7:25 pm
- Contact:
Re: set random wait time between 50-60 seconds
Everything you can do inside the Javascript "eval" function is possible:
YesSET !RANDVAR EVAL("var randomNumber=Math.floor(Math.random()*100); randomNumber;")
DS CMD=CLICK X=RANDVAR Y=100 CONTENT=
Is this possible ?
Not via EVAL, but via scripting interface: http://wiki.imacros.net/FAQ#Q:_Are_ther ... anguage.3FIF... THEN
repeat/go to line command :
GOTO LINE
Yesmath commands :
/ * + -
Is this possible too ?
Re: set random wait time between 50-60 seconds
Great, but as I'm not good at javascript I would just like to see "random" as a native command in Imacros script, but this javascript code will solve my problem.
I suggest something like :
SET !RANDOM=100 (just like TIMEOUT)
Then someone can use RANDOM word everywhere and it will choose a number between 0-100
Anyway thanks
I suggest something like :
SET !RANDOM=100 (just like TIMEOUT)
Then someone can use RANDOM word everywhere and it will choose a number between 0-100
Anyway thanks
-
- Posts: 3
- Joined: Sat Jan 19, 2013 10:27 am
Re: set random wait time between 50-60 seconds
Works without colon! But still...what about this "show my ip" command