Problem with Temp Trigger Recursion

Post Reply
Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Problem with Temp Trigger Recursion

Post by Jor'Mox »

I am trying to make a script using temp triggers that will go through every piece of equipment and cast a spell on it. To do so, I'm creating a temp trigger that will fire when it sees the message from the MUD indicating that the spell succeeded. I then clear my temp triggers, and make new ones that will target the next item on the list.

The problem is that as soon as I see the first success message, the trigger fires, and the new triggers fire, all the way down so that all the commands that were supposed to be sent in a spaced out manner are instead sent at the same time, as if every casting succeeded. I also have triggers that should recast on the first item if the casting fails, so the script running through the list all in an instant is bad, as it avoids my efforts to deal with failure.

I'm guessing that the new triggers instantly fire on the same line that triggered the first one. Any ideas on how to get around this?

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Problem with Temp Trigger Recursion

Post by Heiko »


Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Problem with Temp Trigger Recursion

Post by Jor'Mox »

It was not lost on me that this is a "slow" methodology, however the server side delay imposed during the process is so great that the time spent running the script could easily take more than a second without being noticed, so the inefficiency is negligible.

That said, I ended up breaking it into a two step process, with the original triggers now just setting variables to be used when I next saw a prompt. Problem fixed.

Post Reply