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


Joined: 27 Apr 2005
Posts: 18

PostPosted: Mon Mar 20, 2006 3:46 pm   

Duration
 
Hi guys,

Still working on this Duration thing and the COND. Can't for the life of me figure out how to use either.

I can understand the IF/THEN statements. And I understand the basic trigger commands.

However when I put them together I get lost.

For example-

When I say hello to someone, they have 5 seconds to say hello back to me. If I get no response in 5 seconds, I want to be able to say go to hell.

So how do I trig off a no response?

#TR {You say "hello".} #COND {hello} {#Wait;say go to hell}

ugh...
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Mar 20, 2006 10:31 pm   
 
I don't recall if #STATE is a usable command inside of automatic states, but assuming it is you could perhaps do something like the following:

#trigger {You say "hello".} {DidRespond = 0}
#condition {} {#if (DidRespond = 0) {say go to hell}} {wait|param=5000} <--if syntax is wrong, it's supposed to be a wait-state with a duration of 5 seconds.

#trigger {They say "something".} {DidRespond = 1;anything else you might want to do}
_________________
EDIT: I didn't like my old signature
Reply with quote
dane
Beginner


Joined: 27 Apr 2005
Posts: 18

PostPosted: Tue Mar 21, 2006 1:48 pm   
 
I guess what I'm having a hard time understanding is the #condition statement is a separate trigger or function?
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Tue Mar 21, 2006 8:14 pm   
 
#COND adds a new state onto the previously-defined trigger. It does not define a new trigger.

I think the following (competely untested, off-the-top) code will do what you want:

#TR {You say "hello".} {DidRespond = 0;#ALARM GTH +5 {#if (DidRespond = 0) {say Go to hell} } }
#COND {They say "something".} {DidRespond = 1}

This (a) sets up an ALARM that fires after 5 secs, and says "go to hell" if no responses, and (b) has a second state that checks to see if anyone says something. Change the pattern in the #COND to fit the appropriate response, and you should be good to go.
_________________
Come visit Mozart Mud...and tell an imm that Aerith sent you!
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