StonedMOFO Beginner
Joined: 22 Sep 2004 Posts: 28
|
Posted: Tue Jul 26, 2005 1:32 pm
My Solution -> How to prevent multiple identical alarm! |
I do not know if anybody need this, but I know I did. I posted just 20 min ago on the other thread asking if this was possible, but after looking into it, I found it it was quite easy. I figure I post it to share it with everyone.
Here is the problem encountered: I have a bot where it would go down routine and kill all the designated npc, and during the killing it would turn on this "perform routine" what it does is send out "perform fire" and have trigger for the message that "perform fire" has been perform (text message that says something like "Your sword filled with flame") it will execute this -> #alarm +0.6 {perform fire} <- the problem I have is sometime this would start to overlap, so I would be doing two "perform fire" almost at the same time!
the way I solve this is assign an ID to the alarm, so I run ->
Code: |
#if (%alarm(firewash) < 0) {#alarm "firewash" +0.6 {perform fire}} {} |
essentially, when the trigger fire, it check if Alarm ID: FIREWASH already exist (if it doesn't exist, %alarm(firewash) will return -1, if it does exist then the remaining time in milisecond will be return). |
|