|
blondi Beginner
Joined: 06 Apr 2003 Posts: 15
|
Posted: 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 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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} |
|
|
|
blondi Beginner
Joined: 06 Apr 2003 Posts: 15
|
Posted: 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? |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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} |
|
|
|
|
|