Priorities on events.

Post Reply
Filion
Posts: 93
Joined: Sat Mar 26, 2011 4:21 pm

Priorities on events.

Post 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.

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

Re: Priorities on events.

Post 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.

Post Reply