Page 1 of 1

Priorities on events.

Posted: Sat Feb 01, 2014 4:28 pm
by Filion
I understand system events like "software interrupts". I would like to ask if I am able to give a priority to specific events, over others, and if I can "postpone" a specific event from being handled, until after another event is finished.

For example,
My mapper uses a fifo to track down movement or a flee command.
There is a thing called autowimpy, that will make you autoflee a room, if you get damaged below a hp threshold you choose.
Lastly, my scripts is triggering by the uniquely colored room name, taking from fifo, and moving to the direction, or fleeing if it is a 'flee' command. Unless... it is autowimpy, which just handles is at a flee, without touching the fifo.

If i used events, I should give top priority to "fleeing event", and should somehow stop "moving event" from being handled.

Re: Priorities on events.

Posted: Sat Feb 01, 2014 5:09 pm
by Jor'Mox
"Priority" is set by when they are called. If you raise an event, everything that happens in response to it will happen before the next line of code below where you call the event is executed. So if you call several events in sequence, they will happen one at a time, in the order you specified.