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
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Thu Dec 26, 2002 7:33 am   

Trouble with timers
 
This triggers worked fine in 6.16. What it did was check the seconds on the clock and would add 1 to a variable called seconds.



#trigger {-:(59|58|57|56|55|54|53|52|51|50|49|48|47|46|45|44|43|42|41|40|39|38|37|36|35|34|33|32|31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00)} {#ADD seconds 1}

#trigger {@seconds > 1} {#var seconds 0;do this stuff now}


Can anyone tell me why this is now not working in zmud 6.40 because all classes and triggers are getting turned on leading up to this this trigger, but for some reason its not even adding 1 to the seconds variable and the TYPE IS set to alarm.

Really need this one badly its a foundation of my whole system.........

Thanks,
Shyl
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Thu Dec 26, 2002 8:22 am   
 
It looks like the second trigger is intended to be an expression trigger instead of a run-of-the-mill trigger.

With this in mind, it appears that your trigger is supposed to increment @seconds every second and when it's greater than 1 (and thus 2 since it is an integer) set it back to 0 and execute your code. So your code is executed every two seconds. If you don't need @seconds set to 1 on the off seconds, this should work:

#ALARM *2 {Do whatever stuff you need to}


Otherwise, do this:
#VAR Seconds 0
#ALARM *1 {#IF (@Seconds = 1) {#VAR Seconds 0;Do whatever stuff you need to} {#VAR Seconds 1}}


 - Charbal
Reply with quote
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Thu Dec 26, 2002 8:50 am   
 
This will not work as I need it to do something every two seconds until I get a condition in which I then shut it off, the way you have shown me will create an alarm trigger that will fire once and then no more, however, if my condition is not met, then I need it to continue to fire every 2 seconds
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Dec 26, 2002 11:51 am   
 
The alarms will not fire only once. The * in front of the time tells the alarm to fire when the time is perfectly divided by whatever comes after the *. So, in the first one, the alarm fires whenever the time can be perfectly divided by 2 (every two seconds), and in the second one, whenever it can be perfectly divided by 1 (every second). The second alarm uses the same system you already had to determine when two seconds had passes, while the first alarm will already fire every two seconds without having to keep track of a variable. The alarms will work, just try them.

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Dec 26, 2002 4:19 pm   
 
I always enjoy seeing people ask for help, then reject solutions without even trying them.

LightBulb
Senior Member
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