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
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Sat Oct 18, 2003 4:40 am   

Roundtime in DR
 
In DR I have a script that handles Roundtime, I found it in the finished scripts section, anyway. I want to make a script that will do something, wait for roundtime to be 0, then continue on. But everyway I have tried doesn't not work. The roundtime variable is @Roundtime

This is the roundtime script

#TRIGGER {Q} {} "" {gsl}
#COND {q} {roundtime = %eval(%gsl(Q)-%gsl(q));gaugemax=@roundtime} {gsl}
#TRIGGER (@roundtime>0) {}
#COND {} {#ADD roundtime -1} {wait|param=1000}


Anywho, just for a test I want a script that will focus rune wait for the roundtime to be 0, then do it again, over and over and over, etc.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Oct 18, 2003 1:59 pm   
 
#TR test {@roundtime <= 0} {focus rune} {} {exp}
#COND {} {#NOOP} {wait|param=1000}
Reply with quote
Andromeda
Beginner


Joined: 29 Aug 2003
Posts: 25
Location: USA

PostPosted: Sat Oct 18, 2003 3:27 pm   
 
For reasons I don't entirely understand I find it better to trigger off of the text "Roundtime:" than off the GSL code.

The following trigger capture round time for use by other scripts.

#TRIGGER "roomRtTrg" {^Roundtime: (%d) {seconds|Sec.}} {
#var rt %1
#alarm +5 {
#var rt 0
}
}

I have the following trigger to handle possible round time when moving through a room:

#TRIGGER "roomTrigNew" {p} {
#var rt @rt
#if (@rt <= 0) {#ok} {
#pause
#ok
#alarm +[@rt] {
#step
#var rt 0
}
}
} "" {gsl}

If there is no rt then #ok is sent to acknowledge room arrival which causes the next room movement.

If there is rt then travel is paused, room arrival acknowledged and finally the reactivation of the travel script after the calculated round time.
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Sun Oct 19, 2003 1:27 am   
 
Lightbulb, might you explain what the Cond command does? I read the help file on it and still don't understand why I would want to use it. You can use that as an example if you don't mind. THanks
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Sun Oct 19, 2003 1:28 am   
 
Scratch that. I think I got it
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Oct 19, 2003 4:31 am   
 
I threw it in so there would be a one-second delay before the trigger could fire a second time and that way there shouldn't be any chance of it going off twice before you got a new roundtime.
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