Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 455
This page describes the process of registering an event to execute, as well as provide a full list of all available events.
An event is in this case simply an in-game event. This can range from logging in, to an incoming tell, to losing or gaining HP during battle. There are various events all of which can be reacted to.
All events are registered with windower.register_event(name, fn), where name is the event to register and fn is the function to execute.
functionprint_values(new, old)
print(new, old)
endwindower.register_event('status change', print_values)This can usually be simplified by just dropping the function into the definition:
windower.register_event('status change', function(new, old)
print(new, old)
end)Sometimes (such as in this case) this can be further shortened to the following:
windower.register_event('status change', print)This will have the same effect since print takes an arbitrary number of arguments, so it will simply print out all arguments the event provides.
The following is a list of all available events, as well as the arguments they provide. Some of them will take return values to modify their content.
| Name | Arguments | Return | Description |
|---|---|---|---|
action | See details | None | incoming chunk with ID 0x028.General Action Event |
action message | See details | None | incoming chunk with ID 0x029.General Action Message Event |
load | None | None | Triggers on addon load. |
unload | None | None | Triggers on addon unload. |
login | stringname | None | Triggers on login. |
logout | stringname | None | Triggers on logout. |
gain focus | None | None | Triggers on receiving focus. |
lose focus | None | None | Triggers on losing focus. |
gain buff | numberbuff_id | None | Triggers on receiving a buff or debuff. |
lose buff | numberbuff_id | None | Triggers on losing a buff or debuff. |
gain experience | numberamountnumber chain_numberbool limit | None | Triggers on gaining any experience. limit is true, if the EXP gained were limit points. |
lose experience | numberamount | None | Triggers on losing any experience. |
level up | numberlevel | None | Triggers on gaining a level. |
level down | numberlevel | None | Triggers on losing a level. |
job change | numbermain_job_idnumber main_job_levelnumber sub_job_idnumber sub_job_level | None | Triggers on job change. This will trigger on both main and sub job change. |
target change | numberindex | None | Triggers on target change. |
weather change | numberweather_id | None | Triggers on weather change. |
status change | numbernew_status_idnumber old_status_id | None | Triggers on player status change. This only triggers for the following statuses: Idle, Engaged, Resting, Dead, Zoning |
hp change | numbernew_hpnumber old_hp | None | Triggers on HP change. |
mp change | numbernew_mpnumber old_mp | None | Triggers on MP change. |
tp change | numbernew_tpnumber old_tp | None | Triggers on TP change. |
hpp change | numbernew_hppnumber old_hpp | None | Triggers on HP% change. |
mpp change | numbernew_mppnumber old_mpp | None | Triggers on MP% change. |
hpmax change | numbernew_hp_maxnumber old_hp_max | None | Triggers on maximum HP change. |
mpmax change | numbernew_mp_maxnumber old_mp_max | None | Triggers on maximum MP change. |
chat message | stringmessagestring sendernumber modebool gm | None | Triggers on any chat message. This only includes FFXI chat messages and will therefor not work with Windower-based chat events, like FFOChat. |
emote | numberemote_idnumber sender_idnumber target_idbool motion | None | Triggers on any player doing an emote. motion is true if it's only motioned without text. |
party invite | stringsendernumber sender_id | None | Triggers on receiving a party or alliance invite. |
examined | stringnamenumber sender_index | None | Triggers on being examined. name is the name of the person to examine you. |
time change | numbernewnumber old | None | Triggers on time change. This only triggers when the displayed in-game time actually changes. Both arguments are the number of minutes since the beginning of the in-game day. |
day change | numbernew_daynumber old_day | None | Triggers on day change. |
moon change | stringnew_moonstring old_moon | None | Triggers on moon type change. This means Full Moon, Waning Gibbous, etc. |
linkshell change | stringnew_lsstring old_ls | None | Triggers on changing linkshells. |
zone change | numbernew_idnumber old_id | None | Fires whenever the player is zoning. This includes logging in and logging out. |
add item | numberbagnumber indexnumber idnumber count | None | Triggers whenever an item enters a bag (through trade, dropping from the treasure pool, NPC reward, moving it from another bag, etc.). |
remove item | numberbagnumber indexnumber idnumber count | None | Triggers whenever an item leaves a bag (through trade, dropping it, usage, etc.). |
incoming text | stringoriginalstring modifiednumber original_modenumber modified_modebool blocked | stringnumber | bool |
incoming chunk | numberidstring originalstring modifiedbool injectedbool blocked | string | bool |
outgoing text | stringoriginalstring modifiedbool blocked | string | bool |
outgoing chunk | numberidstring originalstring modifiedbool injectedbool blocked | string | bool |
mouse | numbertypenumber xnumber ynumber deltanumber blocked | bool | Triggers on any mouse action, including movement. Optionally returns a bool indicating whether or not the mouse action has been caught. If true, it will not be passed on to the next stage, so the mouse action would never reach the game.The most common values for the type parameter are the following:Left click down 1A full list can be found here. The value displayed there needs be bit masked to the low 8 bits, so 0x0201 would be just 1. |
keyboard | numberdikbool pressednumber flagsbool blocked | bool | Triggers on any keyboard action, including release of a button. Optionally returns a bool indicating whether or not the keyboard action has been caught. If true, it will not be passed on to the next stage, so the keyboard action would never reach the game. |
ipc message | stringmessage | None | Triggers on an incoming IPC message. |
addon command | string* ... | None | Triggers on passing an addon command, which is any command of the form lua c <name>, where name is the addon name. (Everything after the command is passed to the function, not the command itself.) |
unhandled command | string* ... | None | Triggers on Windower commands that weren't processed by any other plugin. (The entire line is passed to the function, including the command.) |
pipe message | string* message | None | Triggers upon receiving a message from the named pipe reader \\.\pipe\luaReader. |
prerender | None | None | Triggers before every rendering tick. |
postrender | None | None | Triggers after every rendering tick. |