Skip to content
Stjepan Bakrac edited this page Apr 5, 2026 · 14 revisions

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.

Examples

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.


Event list

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.

NameArgumentsReturnDescription
actionSee detailsNone⚠️ Deprecated! Use incoming chunk with ID 0x028.
General Action Event
action messageSee detailsNone⚠️ Deprecated! Use incoming chunk with ID 0x029.
General Action Message Event
loadNoneNoneTriggers on addon load.
unloadNoneNoneTriggers on addon unload.
loginstringnameNoneTriggers on login.
logoutstringnameNoneTriggers on logout.
gain focusNoneNoneTriggers on receiving focus.
lose focusNoneNoneTriggers on losing focus.
gain buffnumberbuff_idNoneTriggers on receiving a buff or debuff.
lose buffnumberbuff_idNoneTriggers on losing a buff or debuff.
gain experiencenumberamount
numberchain_number
boollimit
NoneTriggers on gaining any experience. limit is true, if the EXP gained were limit points.
lose experiencenumberamountNoneTriggers on losing any experience.
level upnumberlevelNoneTriggers on gaining a level.
level downnumberlevelNoneTriggers on losing a level.
job changenumbermain_job_id
numbermain_job_level
numbersub_job_id
numbersub_job_level
NoneTriggers on job change. This will trigger on both main and sub job change.
target changenumberindexNoneTriggers on target change.
weather changenumberweather_idNoneTriggers on weather change.
status changenumbernew_status_id
numberold_status_id
NoneTriggers on player status change. This only triggers for the following statuses:
Idle, Engaged, Resting, Dead, Zoning
hp changenumbernew_hp
numberold_hp
NoneTriggers on HP change.
mp changenumbernew_mp
numberold_mp
NoneTriggers on MP change.
tp changenumbernew_tp
numberold_tp
NoneTriggers on TP change.
hpp changenumbernew_hpp
numberold_hpp
NoneTriggers on HP% change.
mpp changenumbernew_mpp
numberold_mpp
NoneTriggers on MP% change.
hpmax changenumbernew_hp_max
numberold_hp_max
NoneTriggers on maximum HP change.
mpmax changenumbernew_mp_max
numberold_mp_max
NoneTriggers on maximum MP change.
chat messagestringmessage
stringsender
numbermode
boolgm
NoneTriggers on any chat message. This only includes FFXI chat messages and will therefor not work with Windower-based chat events, like FFOChat.
emotenumberemote_id
numbersender_id
numbertarget_id
boolmotion
NoneTriggers on any player doing an emote. motion is true if it's only motioned without text.
party invitestringsender
numbersender_id
NoneTriggers on receiving a party or alliance invite.
examinedstringname
numbersender_index
NoneTriggers on being examined. name is the name of the person to examine you.
time changenumbernew
numberold
NoneTriggers 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 changenumbernew_day
numberold_day
NoneTriggers on day change.
moon changestringnew_moon
stringold_moon
NoneTriggers on moon type change. This means Full Moon, Waning Gibbous, etc.
linkshell changestringnew_ls
stringold_ls
NoneTriggers on changing linkshells.
zone changenumbernew_id
numberold_id
NoneFires whenever the player is zoning. This includes logging in and logging out.
add itemnumberbag
numberindex
numberid
numbercount
NoneTriggers whenever an item enters a bag (through trade, dropping from the treasure pool, NPC reward, moving it from another bag, etc.).
remove itemnumberbag
numberindex
numberid
numbercount
NoneTriggers whenever an item leaves a bag (through trade, dropping it, usage, etc.).
incoming textstringoriginal
stringmodified
numberoriginal_mode
numbermodified_mode
boolblocked
string
number
bool
incoming chunknumberid
stringoriginal
stringmodified
boolinjected
boolblocked
string
bool
outgoing textstringoriginal
stringmodified
boolblocked
string
bool
outgoing chunknumberid
stringoriginal
stringmodified
boolinjected
boolblocked
string
bool
mousenumbertype
numberx
numbery
numberdelta
numberblocked
boolTriggers 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 1
Left click up 2
Left double click 3
Right click down 4
Right click up 5
Right double click 6
Middle click down 7
Middle click up 8
Middle double click 9
Wheel scroll 10
A 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.
keyboardnumberdik
boolpressed
numberflags
boolblocked
boolTriggers 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 messagestringmessageNoneTriggers on an incoming IPC message.
addon commandstring* ...NoneTriggers 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 commandstring* ...NoneTriggers on Windower commands that weren't processed by any other plugin. (The entire line is passed to the function, including the command.)
pipe messagestring* messageNoneTriggers upon receiving a message from the named pipe reader \\.\pipe\luaReader.
prerenderNoneNoneTriggers before every rendering tick.
postrenderNoneNoneTriggers after every rendering tick.

Clone this wiki locally