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


Joined: 06 Apr 2007
Posts: 59

PostPosted: Wed May 28, 2008 12:32 pm   

Waitfor something to occur?
 
I am trying to work with this output.

>eat my root
You take a bite of your haphip root.
Your head feels better.
Roundtime: 15 sec.
You have about 45 bites left.

Eating the root is a scripted auto-healing command. After the command it will issue #T+ wounds|rttrigger and this section activates. When this section is done, it goes back to the previous script for another couple of commands before exiting. Another trigger elsewhere stores round time as an integer. Following is the class script.

Code:
#CLASS {wounds|rttrigger}
#TRIGGER {Your %1 feels better.} {#WAIT}
#COND {Roundtime: %1 sec.} {#WAIT @roundtime * 1000}
#T- rttrigger
#CLASS 0


Now, this WORKS, however if the game lags a bit for whatever reason, often the first #WAIT expires before the round time kicks in and since round time will = 0 it just flies past and attempts to go to the next step, which doesn't happen because the character will be in round time.

Is there another way I can do this to keep better control of the sequence of events? Maybe an example of how #ALARM would be more appropriate? Or should I use an #IF statement around the next section of commands to look for a value in @roundtime and issue a #WAIT if it is > 0 (I sense the same potential for failure as the above script here).

Thanks in advance.
Reply with quote
Qaiia
Wanderer


Joined: 06 Apr 2007
Posts: 59

PostPosted: Thu May 29, 2008 5:57 pm   
 
I found this http://forums.zuggsoft.com/forums/viewtopic.php?p=38430 and am reworking the script's functionality. If I resolve my own issue I'll report back.
_________________
Citrus: The Juicy Alternative
Reply with quote
Qaiia
Wanderer


Joined: 06 Apr 2007
Posts: 59

PostPosted: Fri May 30, 2008 1:39 pm   
 
So now the herb-eating code calls #T+ wounds|rttrigger which enables the following bit of code. Works like a charm.

Code:
#CLASS {wounds|rttrigger} {disable}
#TRIGGER {You take a {bite of|drink from} your %1.} {lasteatenherb = %1}
#COND {q} {
  #MATH int_waitfor {@roundtime+1}
  #ALARM +@int_waitfor {
    put my @lasteatenherb in my @gearcontainer
    #ALARM +1 {close my @gearcontainer}
    }
  #T- rttrigger
  } {gsl}
#CLASS 0
_________________
Citrus: The Juicy Alternative
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