I need a random pause

Getting started -basics for starting with WinTask

I need a random pause

Postby Vik on Tue Oct 21, 2014 9:19 am

Hi,
My script fills a form and presses Submit, but I need a random pause between 2 form fillings. My code right now is:
WriteHTML("INPUT TEXT[NAME='sale']", sale$(i))
Pause 30 secs
I want to change the 30 secs to a random value from 1 to 30, how can I do that?
Vik
 
Posts: 3
Joined: Fri Jun 07, 2013 12:43 pm

Re: I need a random pause

Postby TechSupport on Wed Oct 22, 2014 8:45 am

Hello,

You can use the Random WinTask function:
a=Random(30)
If a=0 then
a=10
EndIf
pause a secs

As Pause 0 generates an infinite loop, I've added the If block to force a to 10 (or any value you want) in case the returned random value is 0.

Regards.
WinTask Tech Support
TechSupport
 
Posts: 805
Joined: Thu Nov 16, 2006 9:58 am


Return to Getting started

Who is online

Users browsing this forum: No registered users and 5 guests

cron