Page 1 of 1

Running rule first time after 2 sec after boot

Posted: 04 Jul 2019, 07:15
by mackowiakp
How can I run rule listed below, for the first time 2 sec after boot and after that normally, without delay? Can I use %uptime% variable?

Code: Select all

On Clock#Time=All,**:** Do
 7dst,%syshour%,%sysmin%
EndOn

Re: Running rule first time after 2 sec after boot

Posted: 04 Jul 2019, 08:07
by grovkillen

Code: Select all

On System#Boot Do
 TimerSet,1,2
EndOn

On Rules#Timer=1 Do
 7dst,%syshour%,%sysmin%
EndOn

On Clock#Time=All,**:** Do
 7dst,%syshour%,%sysmin%
EndOn
Or a bit more "program like":

Code: Select all

On System#Boot Do
 TimerSet,1,2
EndOn

On Rules#Timer=1 Do
 Event,UpdateDisplay
EndOn

On Clock#Time=All,**:** Do
 Event,UpdateDisplay
EndOn

On UpdateDisplay Do
 7dst,%syshour%,%sysmin%
EndOn

Re: Running rule first time after 2 sec after boot

Posted: 04 Jul 2019, 08:25
by mackowiakp
I try something like as You propouse. But the problem is that part of rule:

Code: Select all

On Clock#Time=All,**:** Do
 Event,UpdateDisplay
EndOn
can run in any time, including two seconds waiting period. My goal is to never run this part of script after two seconds period after the boot.

Re: Running rule first time after 2 sec after boot

Posted: 04 Jul 2019, 16:43
by grovkillen
I don't understand what you mean. Can you elaborate?

Re: Running rule first time after 2 sec after boot

Posted: 04 Jul 2019, 16:56
by mackowiakp
This part of the rule can be run at any time.

Code: Select all

On Clock#Time=All,**:** Do
 Event,UpdateDisplay
EndOn
Also during these 2 sec delay after boot. And my goal is to run, but never during those 2 sec to boot. I do not know if this is clearly described.

Re: Running rule first time after 2 sec after boot

Posted: 04 Jul 2019, 18:29
by grovkillen
Ok, then you should do something like this.

Code: Select all

On System#Boot Do
 TimerSet,1,2
EndOn

On Rules#Timer=1 Do
 Let,1,1
 Event,UpdateDisplay
EndOn

On Clock#Time=All,**:** Do
 If [VAR#1]=1
  Event,UpdateDisplay
 Endif
EndOn

On UpdateDisplay Do
 7dst,%syshour%,%sysmin%
EndOn

Re: Running rule first time after 2 sec after boot

Posted: 04 Jul 2019, 18:59
by mackowiakp
THX, SOLVED !!!