|
herme Beginner
Joined: 02 Mar 2009 Posts: 14
|
Posted: 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 |
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: 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.
|
|
|
|
herme Beginner
Joined: 02 Mar 2009 Posts: 14
|
Posted: 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.
|
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: 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> |
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: 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. |
|
|
|
herme Beginner
Joined: 02 Mar 2009 Posts: 14
|
Posted: 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.
|
|
|
|
|
|