Page 1 of 1

General timer question

Posted: 22 Jan 2021, 08:31
by GravityRZ
i am using a timer to reset a value to zero

if XXX is not called then the timer will not start again

My question
since the timer will not start again is there any reason why i should use the timerSet,1,0 in the Rules?
eg can i delete it?



Code: Select all

On Rules#Timer=1 do 	
		TaskValueSet 3,2,0 
		timerSet,1,0
EndOn


On XXX do			
	if [AAA#BBB] = 1 	
	//do some stuff
		Let,1,([CCC#DDD]/1000)+1		//set timer to current time+1 
		timerSet,1,[INT#1]
	endif
EndOn

Re: General timer question

Posted: 22 Jan 2021, 09:04
by Ath
No need to call TimerSet,1,0 in the handler for that timer, indeed, it is fired only once. TimerSet,1,0 is normally used to cancel the running timer or cancel a repeating timer, set with LoopTimerSet(_ms).

Re: General timer question

Posted: 22 Jan 2021, 16:30
by GravityRZ
ok thanks.
i thought so since the timer did already ended

clearing up the rules :D