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
Kaputchnik
Beginner


Joined: 06 Jan 2002
Posts: 28
Location: Sweden

PostPosted: Thu Apr 11, 2002 11:55 pm   

Timer
 
Is it possible to count up instead, say I have a command that puts me in a special state for 4 min. With start and stop messages that I can trigger on. Is it possible just to make some alarm to trigger and then stop at the stop pattern. I've looked through the helpfiles but couldn't find anything. I now have created some triggers that count it using the %time function. A bit messy though. Is there some kind of alarm that counts the other way around?

Cheers,
Kaputchnik
Reply with quote
Buba
Newbie


Joined: 01 May 2002
Posts: 0

PostPosted: Fri Apr 12, 2002 3:23 am   
 
You could try looking in the help files for the #ALARM command, this might be better than the timer in your situation.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Apr 12, 2002 3:51 am   
 
I'm not at all clear on what you are trying to do, which makes answering difficult. If you want a 4 minute, one-time alarm that's easy.

#AL +4:00 {#SAY done}

Of course, if you get start and stop messages for the special state it would be more accurate to trigger on those.

LightBulb
Vague questions get vague answers
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Apr 12, 2002 3:52 am   
 
Give the
#ALARM
an id so you can
#UNTRIGGER id

To stop it if need be.

Ton Diening
Reply with quote
Kaputchnik
Beginner


Joined: 06 Jan 2002
Posts: 28
Location: Sweden

PostPosted: Fri Apr 12, 2002 12:03 pm   
 
Not quite what I had in mind. The time of the state I get differs and I like to calculate the duration.

For example:
You start berserking.
start counting...
about 4 min pass
You stop berserking.
and the alarm/trigger should count the time that went by.

Something like a stopwatch start it when I start my berserk and end it when I stop my berserk. And then display the duration.

Cheers,
Kaputchnik
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Apr 12, 2002 12:32 pm   
 
The best way is with the pre-defined variable %secs. You can do:
#TRIGGER {You start berserking.} {#VAR start %secs}
#TRIGGER {You stop berserking.}
{#SAY You berserked for %eval((%secs - @start)/1000) seconds.}

Kjata
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