Posts: 7
Threads: 3
Joined: Aug 2013
Thank you for providing support through your forum.
I would like to insert a random (interval between 10 seconds and 10 minutes) wait between steps/actions in the macro. Could someone show me how?
Posts: 12,086
Threads: 142
Joined: Dec 2002
Macro
Macro2126
int i
for i 0 10
,wait RandomInt(1 10) ;;wait 1-10 s
,out i
Posts: 7
Threads: 3
Joined: Aug 2013
Hi Gintaras, thank you for the reply.
I'm not quite sure I understand how to reformat that if I were to use different random intervals.
For example, if I were to change the values so that it fits between 38 seconds and 4 minutes, do I have to modify "for i 0 10" on line 2 as well?
Assuming that your code is for intervals between 10 seconds and 10 minutes (your comment "wait 1-10 s" is confusing me, because when I see "s", I supposed it means "seconds".
Is there also a way to output the random delay into a text file, just so I can make sure that the intervals fit within the range?
Posts: 12,086
Threads: 142
Joined: Dec 2002
Create function like this, change the values.
Function
WaitRandom_02s_to_3s
;/
double wt=0.2+(RandomNumber*(3-0.2))
out wt
wait wt
Replace out to LogFile if need.
Run this macro to test it.
Macro
Macro2133
WaitRandom_02s_to_3s
out "step"
WaitRandom_02s_to_3s
out "step"
WaitRandom_02s_to_3s
out "step"
WaitRandom_02s_to_3s
out "step"
WaitRandom_02s_to_3s
out "step"
WaitRandom_02s_to_3s
out "step"
WaitRandom_02s_to_3s
out "step"
WaitRandom_02s_to_3s
out "step"
WaitRandom_02s_to_3s
out "step"
Posts: 7
Threads: 3
Joined: Aug 2013
Awesome, making a function and linking it actually makes the whole macro a lot cleaner! Thanks!