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
dazed-n-confused
Novice


Joined: 14 Jan 2004
Posts: 31

PostPosted: Tue Jan 20, 2004 11:03 am   

multiple commands for one trigger
 
First of all yes I have read the support library files on triggers. However, with my feeble understanding of programming its not sinking in very well.[xx(] All that I want to do is have a series of commands that are performed sequentially.
Assume the patter is: < whirling wildly >, if this pattern occurs every 5 seconds or so I need about 5 different commands to be sent to the mud. eg: fist command: run fast, second command: play dead, ect.
Once again any help will be appreciated, and long live Zugg.Smile
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Tue Jan 20, 2004 11:17 am   
 
When using the settings editor, just put each command on a single line or separate commands using ;. Same goes for creating triggers from the command line.
Reply with quote
dazed-n-confused
Novice


Joined: 14 Jan 2004
Posts: 31

PostPosted: Tue Jan 20, 2004 11:42 am   
 
I was not entirely clear with my post, I need the first command to fire the first time the trigger is activated and just the first command. Same for the second. The next time the pattern shows up the second command goes off, and so on. Sorry for the confusion.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Tue Jan 20, 2004 11:54 am   
 
You'll be wanting to use conditional triggers then:

#trigger {whirling wildly} {First command}
#con {whirling wildly} {Second Command} {Within|Param=1}

Or, you could do this:

#trigger {Whirling Wildly} {#add WhirlCount {1};%item(@CommandList,@WhirlCount);#IF (@whirlcount=%numitems(@CommandList)) {WhirlCount=0}}

And have your commands in a list variable, @Commandlist. Every time it is run, it will execute the next command and when it executes the last command, it will start back at the beginning.
Reply with quote
dazed-n-confused
Novice


Joined: 14 Jan 2004
Posts: 31

PostPosted: Tue Jan 20, 2004 8:30 pm   
 
Im using the secound option on this last post and it seem to be working except for one snag. The whirlcount varable just keep incrementing up one each time the trigger fires. Any thoughts on how to get the whirlcount to a predefined number and then start over at 0? By the way thanks to you guys that reply to these posts this helps out a lot.Wink
Reply with quote
dazed-n-confused
Novice


Joined: 14 Jan 2004
Posts: 31

PostPosted: Tue Jan 20, 2004 10:42 pm   
 
Doh...I didn't have something right. It's woking great. Thanks.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Tue Jan 20, 2004 10:42 pm   
 
Hm, #IF (@whirlcount=%numitems(@CommandList)) {WhirlCount=0} in my last post should be resetting whirlcount to 0 when it has executed the last command in @Commandlist. Check if you have accidentally ommitted it from your trigger.
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