Random Delay

Post comments and suggestions for RoboTask here
Post Reply
vbigdeli
Posts: 34
Joined: Mon Sep 15, 2008 2:53 am

Random Delay

Post by vbigdeli »

Hi all.

I need Random delay..the current delay action does not accepts variables,so there is no way to put the system/RoboTask on random delay.

The current way is to add a Send Keystrokes and add a delay and then replace the default ms(100) with a random number.

Thanks.
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Random Delay

Post by Oleg »

You can make the random delay with using simple algoritm.
See the example below. This task makes random delay from 0.1s to 10s

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|2099193306
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task1253"
Hide=INTEGER|0
ID=INTEGER|1895035746
LogOnAsUser=INTEGER|1
Name=STRING|"Random delay"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|2
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER

[Actions\Action1]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER

[Actions\Action1\Params]
message=STRING|"start delay"
type=STRING|"3"

[Actions\Action2]
ActionID=STRING|"A_LOOP_SIMPLE"
Enabled=INTEGER|-1
Name=STRING|"Simple Loop"
Params=FOLDER

[Actions\Action2\Params]
begin=STRING|"1"
end=STRING|"{RandomValue(100)}"

[Actions\Action3]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 100 ms"
Params=FOLDER

[Actions\Action3\Params]
delay=STRING|"100"
dimension=STRING|"0"

[Actions\Action4]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action5]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER

[Actions\Action5\Params]
message=STRING|"Stop dalay"
type=STRING|"3"

Oleg Yershov
Post Reply