Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
blondi
Beginner


Joined: 06 Apr 2003
Posts: 15

PostPosted: Mon May 19, 2003 7:50 pm   

resetable and stoppable countdowntimer
 
I hope you can help me cause i've no idee how to do that

i receive from the mud a string let's say 'start' after a random time i receive a string 'stop', but not always.
'start' sets a flag in my statusline, and 'stop' resets it.

what i want is that the flag after a certain period of time (lets say 15seconds) is automatically resetted, when no 'stop' is received.
a simple #alarm will do that, but:
in that 15 seconds can be a new 'start' so the countdown timer must be resettet to the 15 seconds. And when i receive the 'stop' string the countdown musst be stopped.
And i need more than one timer like this

Thanx
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon May 19, 2003 10:28 pm   
 
You can use #ALARMs for this. Adjusting the time for an alarm can be done by use of the %alarm function or by simply recreating the alarm. A simple example:

#TR {start1} {#ALARM "Timer1" {+15} {#VAR status1 0};#VAR status1 1}
#TR {stop1} {#UNTRIGGER Timer1;#VAR status1 0}
Reply with quote
blondi
Beginner


Joined: 06 Apr 2003
Posts: 15

PostPosted: Tue May 20, 2003 12:12 am   
 
Thank you

i didn't know that recreating an #alarm with the same trigger resets them, zhere's nothing in the 6.40 helpfile

another stupid question but i can't find somethin in the helpfile, too

ho do i made a trigger about a certain variable value?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue May 20, 2003 2:26 am   
 
I believe you want an expression trigger. Looking at the help for the current public version it indicates that "exp" is the option for creating such a trigger.

Example:
#TR "id" {pattern} {#NOOP commands} "class" {exp}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net