General timer question

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
GravityRZ
Normal user
Posts: 206
Joined: 23 Dec 2019, 21:24

General timer question

#1 Post by GravityRZ » 22 Jan 2021, 08:31

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

User avatar
Ath
Normal user
Posts: 3513
Joined: 10 Jun 2018, 12:06
Location: NL

Re: General timer question

#2 Post by Ath » 22 Jan 2021, 09:04

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).
/Ton (PayPal.me)

GravityRZ
Normal user
Posts: 206
Joined: 23 Dec 2019, 21:24

Re: General timer question

#3 Post by GravityRZ » 22 Jan 2021, 16:30

ok thanks.
i thought so since the timer did already ended

clearing up the rules :D

Post Reply

Who is online

Users browsing this forum: No registered users and 98 guests