About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
herme
Beginner


Joined: 02 Mar 2009
Posts: 14

PostPosted: Mon Dec 28, 2009 12:27 pm   

[3.12] delay on the #ok command?
 
I've made a script that follows a path and tries to massacre a target in each room it enters, and if it cannot find any targets it continues on the path with the #ok command. The problem I have is that sometimes it sends two massacre commands in a row with no #ok in between, making it jump two rooms instead of one. Anyone have any ideas why? Here's the trigger I use to advance to the next room.

Code:

<trigger priority="5190" id="564">
  <pattern>You can't seem to find your target to massacre</pattern>
  <value>#ok
#wa 500
massacre @targets</value>
</trigger>


Last edited by herme on Mon Dec 28, 2009 1:22 pm; edited 1 time in total
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Mon Dec 28, 2009 12:57 pm   
 
I think from what you've said that the problem is in a different section of your script. Specifically, in the part that sends a massacre command when you enter the room.
Reply with quote
herme
Beginner


Joined: 02 Mar 2009
Posts: 14

PostPosted: Mon Dec 28, 2009 1:22 pm   
 
That's the only part that sends the massacre command. I realize now it wasn't clear but the 'm @targets' part is the massacre command. I'll edit my original post as well.
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Mon Dec 28, 2009 9:20 pm   
 
I'm not entirely sure about threading issues, I've never really had a reason to get into threading. I think this would be more likely to function correctly if you used an alarm type trigger, for example:
Code:
<trigger priority="5190" id="564">
  <pattern>You can't seem to find your target to massacre</pattern>
  <value>#ok
#alarm +0.5 {massacre @targets}</value>
</trigger>
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Dec 31, 2009 4:06 pm   
 
Definitely a threading issue. The #wait command causes this trigger to run in a separate thread, and you can have multiple instances of this trigger and other things running all at the same time.

I'm actually not comfortable with your method of using #ok for this. I would prefer to use #PAUSE and #STEP. But I suppose as long as you aren't using the mapper it's fine.
Reply with quote
herme
Beginner


Joined: 02 Mar 2009
Posts: 14

PostPosted: Sun Jan 03, 2010 7:06 pm   
 
I'm using #ok only because I've had tons of problems with #step. #ok was the only thing that I could use with some reliability. It was a while ago since I was experimenting around with them though, so I can't remember what problems I had exactly. Thanks for the tips guys, I'll start using #alarm from now on.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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