### Get command examples Source: https://github.com/windower/lua/blob/dev/addons/BattleStations/README.md Displays the currently set station on the given radio(s). Optional radio parameter: solo or party. ```windower //bs get //bs g ``` ```windower //bs g solo //bs g party ``` -------------------------------- ### Invite event command example Source: https://github.com/windower/lua/blob/dev/addons/autoex/README.md Example command using invite event interpolation placeholder {SENDER}. ```lua ["command"]="echo {SENDER} sent a party invite!; wait 1; input /join" ``` -------------------------------- ### Day event command example Source: https://github.com/windower/lua/blob/dev/addons/autoex/README.md Example command using day event interpolation placeholder {NEW}. ```lua ["command"]="input /p What a glorious new {NEW}!" ``` -------------------------------- ### Example Commands for EquipViewer Source: https://github.com/windower/lua/blob/dev/addons/equipviewer/README.md Example commands for the EquipViewer addon. Each command adjusts a specific setting: position, size, scale, alpha, transparency, background color, toggles for ammo count, encumbrance, hide on zone, hide on cutscene, justify, and help. ```windower //ev pos 700 400 //ev size 64 //ev scale 1.5 //ev alpha 255 //ev transparency 200 //ev background 0 0 0 72 //ev ammocount //ev encumbrance //ev hideonzone //ev hideoncutscene //ev justify //ev help ``` -------------------------------- ### About command examples Source: https://github.com/windower/lua/blob/dev/addons/BattleStations/README.md Displays information about the Battle Stations addon. Equivalent ways of calling the command. ```windower /battlestations about //stations about //bs about ``` ```windower //battlestations a //stations a //bs a ``` -------------------------------- ### Help command examples Source: https://github.com/windower/lua/blob/dev/addons/BattleStations/README.md Displays available Battle Stations commands. Equivalent ways of calling the command. ```windower //battlestations help //stations help //bs help ``` ```windower //battlestations h //stations h //bs h ``` -------------------------------- ### //send usage examples Source: https://github.com/windower/lua/blob/dev/addons/send/readme.md Examples of using //send with different targets: @all for all instances, @whm for White Mages, and a specific receiver name. The command can be any valid FFXI or Windower command. ```plaintext //send @all /ma "Blizzard" //send @whm /ma "Haste" //send Mymule reload timers ``` -------------------------------- ### Set command examples Source: https://github.com/windower/lua/blob/dev/addons/BattleStations/README.md Sets the radio(s) to the given station. Optional radio parameter: solo or party. ```windower //bs set 100.1 //bs s 100.1 ``` ```windower //bs s 100.1 solo //bs s 100.1 party ``` -------------------------------- ### Normal command examples Source: https://github.com/windower/lua/blob/dev/addons/BattleStations/README.md Sets the given radio(s) to the original game music. Optional radio parameter: solo or party. ```windower //bs normal //bs n ``` ```windower //bs n solo //bs n party ``` -------------------------------- ### Time event command example Source: https://github.com/windower/lua/blob/dev/addons/autoex/README.md Example command using time event interpolation placeholders {OLD_HOUR}, {OLD_MINUTES}, {NEW_HOUR}, {NEW_MINUTES}. ```lua ["command"]="echo Time changed from {OLD_HOUR}:{OLD_MINUTES} to (NEW_HOUR}:{NEW_MINUTES}." ``` -------------------------------- ### Itemizer usage examples Source: https://github.com/windower/lua/blob/dev/addons/itemizer/readme.md Example chat commands for the Itemizer addon. They demonstrate putting items into specific bags, getting items from specific bags, getting a specific count, and using wildcards (e.g., //get *crystal). ```text //put Mandau sack //put Whirlpool mask satchel //get Hct. Subligar +1 storage //get Raider's armlets +2 safe //get "HoPe toRQue" locker //get earth crystal 5 //get *crystal ``` -------------------------------- ### List command examples Source: https://github.com/windower/lua/blob/dev/addons/BattleStations/README.md Displays available radios and/or stations. Optional filters: radios, stations, and category number. ```windower //bs list //bs l ``` ```windower //bs list radios //bs l radios //bs l r ``` ```windower //bs list stations //bs l stations //bs l s ``` ```windower //bs l s 100 ``` -------------------------------- ### Status event command example Source: https://github.com/windower/lua/blob/dev/addons/autoex/README.md Example command using status event interpolation placeholders {OLD} and {NEW}. ```lua ["command"]="echo Went from {OLD} to {NEW}" ``` -------------------------------- ### Chat event command example Source: https://github.com/windower/lua/blob/dev/addons/autoex/README.md Example command using chat event interpolation placeholders {SENDER}, {MODE}, {MATCH}. ```lua ["command"]="echo {SENDER} sent a /{MODE}! Match Found: {MATCH}" ``` -------------------------------- ### update interval examples Source: https://github.com/windower/lua/blob/dev/addons/update/readme.md Examples of setting the update interval to 5 minutes, 2 hours, and 30 seconds respectively. ```plaintext update interval 5min update interval 2h update interval 30 ``` -------------------------------- ### Reload command examples Source: https://github.com/windower/lua/blob/dev/addons/BattleStations/README.md Reloads the Battle Stations addon. Equivalent ways of calling the command. ```windower //battlestations reload //stations reload //bs reload ``` ```windower //battlestations r //stations r //bs r ``` -------------------------------- ### Default command examples Source: https://github.com/windower/lua/blob/dev/addons/BattleStations/README.md Sets the given radio(s) to the default station (Current Zone Music). Optional radio parameter: solo or party. ```windower //bs default //bs d ``` ```windower //bs d solo //bs d party ``` -------------------------------- ### jobchangefull event command example Source: https://github.com/windower/lua/blob/dev/addons/autoex/README.md Example command using jobchangefull event interpolation placeholders {MAIN_SHORT}, {MAIN_LV}, {SUB_FULL}, {SUB_LV}. ```lua ["command"]="echo Current Job: {MAIN_SHORT}{MAIN_LV}/{SUB_FULL}{SUB_LV}." ``` -------------------------------- ### AutoEX event table example Source: https://github.com/windower/lua/blob/dev/addons/autoex/README.md Example event table for the AutoEX addon. Each entry defines an event trigger with a name pattern, a command to execute, and options for silent execution and one-time firing. The {SENDER} placeholder is used in commands to reference the sender of a tell. ```lua return { [1]={ ["silent"]="false", ["name"]="chat_tell_*_invite", ["once"]="false", ["command"]="input /pcmd add {SENDER}" }, [2]={ ["silent"]="true", ["name"]="chat_tell_*_ally", ["once"]="false", ["command"]="input /acmd add {SENDER}" }, [3]={ ["silent"]="false", ["name"]="invite_*", ["once"]="false", ["command"]="input /join" }, } ``` -------------------------------- ### Use table.map, table.filter, and table.reduce Source: https://github.com/windower/lua/wiki/Writing-Addons Usage examples for the map, filter, and reduce functions defined in the `functions` module. The first example splits a string, maps `ucfirst` over the parts, and concatenates with `sconcat`; the second filters a table using `math.even` and `math.odd`; the third reduces the filtered tables with `math.sum` and `math.mult`. The comments show the expected outputs. ```lua str = 'your mog locker lease is valid until 2014/4/6 8:18:08, kupo.' t = str:split(' ') log(t:map(ucfirst):sconcat()) -- Outputs: 'Your Mog Locker Lease Is Valid Until 2014/4/6 8:18:08, Kupo.' t = T{1,2,3,4,5,6,7,8} even = t:filter(math.even) -- Where math.even(x) == return x%2 == 0 odd = t:filter(math.odd) -- Where math.odd(x) == return x%2 == 1 -- Outputs: even == {2,4,6,8}; odd == {1,3,5,7} even_sum = even:reduce(math.sum) -- Where math.sum(x,y) == x+y odd_mult = odd:reduce(math.mult) -- Where math.mult(x,y) == x*y -- Outputs: even_sum == 20; odd_mult == 105 ``` -------------------------------- ### Include file example: WAR-include.lua Source: https://github.com/windower/lua/blob/dev/addons/Yush/ReadMe.md Defines a WAR table with key bindings for Ctrl+1 and Ctrl+2. This file can be included in other Lua files to share macro definitions. ```lua WAR = { ['Ctrl+1'] = 'input /ja "Berserk" ', ['Ctrl+2'] = 'input /ja "Warcry" ', } ``` -------------------------------- ### Example: set delay and positions for multiple characters Source: https://github.com/windower/lua/blob/dev/addons/position_manager/README.md Sets delay to 1 for all characters, then sets positions for main and alt characters. Warning: using 'all' deletes all other character-specific settings. ```text //pm set delay 1 all ``` ```text //pm set 0 40 Yourman ``` ```text //pm set 800 40 Youralt ``` -------------------------------- ### Augment cape 20 times Source: https://github.com/windower/lua/blob/dev/addons/capetrader/README.md Starts the augmentation process for the specified number of times. In this example, 20 augmentations are performed. ```windower //ct go 20 ``` -------------------------------- ### Example: set position for a specific character Source: https://github.com/windower/lua/blob/dev/addons/position_manager/README.md Sets the default position for the character named 'Yourname' to X: 1920, Y: 0, useful for multi-screen setups. ```text //pm set 1920 0 Yourname ``` -------------------------------- ### Examined event command example Source: https://github.com/windower/lua/blob/dev/addons/autoex/README.md Example command using examined event interpolation placeholder {NAME}. ```lua ["command"]="input /slap {NAME}" ``` -------------------------------- ### Losebuff event command example Source: https://github.com/windower/lua/blob/dev/addons/autoex/README.md Example command using losebuff event interpolation placeholders {NAME} and {ID}. ```lua ["command"]="echo Lost buff: {NAME}[{ID}]" ``` -------------------------------- ### Open FFXI info sites with //web commands Source: https://github.com/windower/lua/blob/dev/addons/linker/readme.md Opens FFXI information sites. Use //web with the site abbreviation and an optional query. If the query is omitted, the home page opens. ```text //web db [query] # FFXIDB //web ah [query] # FFXIAH //web bg [query] # BlueGartr Wiki //web ge [query] # GamerEscape Wiki //web wikia [query] # FFXIclopedia ``` -------------------------------- ### Gainbuff event command example Source: https://github.com/windower/lua/blob/dev/addons/autoex/README.md Example command using gainbuff event interpolation placeholders {NAME} and {ID}. ```lua ["command"]="echo Gained buff: {NAME}[{ID}]" ``` -------------------------------- ### Open FFXI community sites with //web commands Source: https://github.com/windower/lua/blob/dev/addons/linker/readme.md Opens FFXI community sites. Use //web with the site abbreviation. If the query is omitted, the home page opens. ```text //web of # Official forums //web bgf # BlueGartr forums //web ahf # FFXIAH forums //web gw # Guildwork.com ``` -------------------------------- ### ADD command examples Source: https://github.com/windower/lua/blob/dev/addons/shoutHelper/readme.md These commands add a player to the first free slot. If a job is given, the player is placed in the first free slot for that job; otherwise, the first free job slot is used. ```text //sh add mnk Grievesk ``` ```text //sh add Jandel ``` -------------------------------- ### Show help Source: https://github.com/windower/lua/blob/dev/addons/plasmon/README.md Displays the help text for the Plasmon addon. ```text plasmon help ``` -------------------------------- ### SET command examples Source: https://github.com/windower/lua/blob/dev/addons/shoutHelper/readme.md These commands insert jobs into a party list. The party can be specified as 'pt1', 'party2', or '3', and jobs can be short names like 'mnk' or categories like 'healer', 'support', 'dd'. ```text //sh set pt1 mnk ``` ```text //sh set party2 mnk healer dd ``` ```text //sh set 3 healer support brd dd dd dd ``` -------------------------------- ### Get command syntax Source: https://github.com/windower/lua/blob/dev/addons/organizer/ReadMe.md Syntax for the get command. Thaws a frozen state and makes one attempt to move towards that state. ```plaintext get [bag] [filename] ``` -------------------------------- ### Unary plus operator example Source: https://github.com/windower/lua/wiki/Windower-Lua-API Windower's Lua parser allows a unary plus, which is a syntax error in stock Lua. This example prints 3. ```lua print(+3) ``` -------------------------------- ### Load or create settings with config.load Source: https://github.com/windower/lua/wiki/Writing-Addons Loads the 'config' module and creates a settings structure with default values for mode, color, and size. If settings.xml does not exist in the data/ directory, it is created with these defaults; otherwise existing values are loaded and missing settings are amended. ```lua require('tables') config = require('config') local defaults = T{} defaults.mode = 'a' defaults.color = 'red' defaults.size = 2.25 settings = config.load(defaults) ``` -------------------------------- ### Open miscellaneous sites with //web commands Source: https://github.com/windower/lua/blob/dev/addons/linker/readme.md Opens miscellaneous sites. Use //web with the site abbreviation and an optional query. If the query is omitted, the home page opens. ```text //web g [query] # Google //web wa [query] # Wolfram|Alpha ``` -------------------------------- ### Example macro for SubTarget Source: https://github.com/windower/lua/blob/dev/addons/SubTarget/README.txt Example macro for the SubTarget addon. The first line targets the player selected by , and the second line sends the command to the mule (Arcon) to cast haste on that target. ```text /target ``` ```text /con sta go Arcon haste ``` -------------------------------- ### Command Syntax: text [args] Source: https://github.com/windower/lua/blob/dev/addons/Text/ReadMe.md Shows the general form for all Text addon commands. Replace `` with the text object's name, `` with the operation (e.g., `create`, `delete`, `pos`, `color`), and `[args]` with any required arguments. ```plaintext text [args1 [arg2 [...]]] ``` -------------------------------- ### windower.prim.create(prim_name) Source: https://github.com/windower/lua/wiki/functions/Image Primitive Functions Creates a new image primitive. ```APIDOC ## windower.prim.create(prim_name) ### Description Creates a new image primitive with the given name. ### Parameters - **prim_name** (string) - Required - Name of the primitive to create. Try to choose something unique. ``` -------------------------------- ### Search example: findall thaumas Source: https://github.com/windower/lua/blob/dev/addons/findAll/README.md Searches for "thaumas" on all characters. ```text findall thaumas ``` -------------------------------- ### windower.ffxi.wide_scan_track_index(index) Source: https://github.com/windower/lua/wiki/FFXI-Functions Starts tracking a mob from the most recent wide scan by its index. ```APIDOC ## windower.ffxi.wide_scan_track_index(index) ### Description Starts tracking a mob from the most recent wide scan. Returns `true` if the mob was a valid tracking target and tracking was started. ### Parameters - **index** (integer) - Required - Index in the mob array of the mob to track. ### Returns - **boolean** - `true` if the mob was a valid tracking target and tracking was started; otherwise `false`. ``` -------------------------------- ### config.load(path, defaults) Source: https://github.com/windower/lua/wiki/libraries/Config Library Loads and parses an XML settings file. The path defaults to Windower/addons//data/settings.xml and defaults to an empty table. Values from the tag and the current character's element are applied over the defaults, with type coercion based on the defaults table. ```lua settings = config.load(path, defaults) ``` -------------------------------- ### Display help for commands Source: https://github.com/windower/lua/blob/dev/addons/EmpyPopTracker/README.md Displays help information for the addon commands. ```windower //ept help ``` -------------------------------- ### Create and Configure Text Object 'foo' Source: https://github.com/windower/lua/blob/dev/addons/Text/ReadMe.md Creates a text object named 'foo' with the content 'Awkward', positions it at (500, 500), sets its color to bright yellow (255, 255, 0), size to 50, and enables italic style. Each command modifies the object sequentially. ```plaintext text foo create Awkward text foo pos 500 500 text foo color 255 255 0 text foo size 50 text foo italic true ``` -------------------------------- ### Partial application with functions.apply and functions.endapply Source: https://github.com/windower/lua/wiki/Writing-Addons Shows partial application of functions using functions.apply and functions.endapply to map over tables. The first example adds 10 to each number, the second appends '!' to each word and concatenates them. ```lua t = {1,2,3,4,5} t:map(functions.apply(math.sum, 10)) -- Where math.sum adds two numbers -- Outputs: {11, 12, 13, 14, 15} t = ('this is sparta'):split(' ') t:map(functions.endapply(concat, '!')):sconcat() -- Where concat concatenates two strings -- Outputs: "this! is! sparta!" ``` -------------------------------- ### Delete Text Object 'foo' Source: https://github.com/windower/lua/blob/dev/addons/Text/ReadMe.md Deletes the text object named 'foo' that was created in the previous example. ```plaintext text foo delete ``` -------------------------------- ### File I/O with the files library Source: https://github.com/windower/lua/wiki/Writing-Addons Loads the 'files' library into a local variable and demonstrates creating, writing, appending, checking existence, reading lines, and writing lines for a file. Requires the 'tables' library to use the equals method on the returned line tables. ```lua local files = require('files') local f = files.new('test.txt') f:write('Something') f:append('... or other') f:exists() lines = f:readlines() lines2 = files.readlines('test.txt') require('tables') if lines:equals(lines2) then lines2:append('last line') f:writelines(lines2) end ``` -------------------------------- ### Open BG Wiki for NM Source: https://github.com/windower/lua/blob/dev/addons/EmpyPopTracker/README.md Opens the BG Wiki page for the currently tracked NM. ```windower //ept bg ``` -------------------------------- ### Mount Muzzle get command Source: https://github.com/windower/lua/blob/dev/addons/MountMuzzle/README.md Display the current muzzle that is set. Equivalent ways of calling the command. ```windower //mountmuzzle get ``` ```windower //muzzle get ``` ```windower //mm get ``` ```windower //mm g ``` -------------------------------- ### config.load(path, defaults) Source: https://github.com/windower/lua/wiki/libraries/Config Library Loads and parses settings from an XML file, merging defaults and character-specific overrides. ```APIDOC ## config.load(path, defaults) ### Description Loads and parses settings from an XML file, merging defaults and character-specific overrides. ### Method Function ### Signature `settings = config.load(path, defaults)` ### Parameters - **path** (string) - Optional - Path to the XML file to read from. Defaults to `Windower/addons//data/settings.xml`. - **defaults** (table) - Optional - A table in the same format as the resulting settings containing default values. Defaults to `{}`. ### Returns - **settings** (table) - The resulting settings object. ### Behavior Loads the XML from the specified path (or default path) and parses it. Uses the provided defaults table (or empty table) as a base, then overwrites entries with values from the `` tag. Finally, checks the current character's name and applies character-specific overrides if present. If a default table is provided, values are coerced to match the default type (e.g., numeric strings become numbers). ``` -------------------------------- ### Anonymous function for filtering with startswith Source: https://github.com/windower/lua/wiki/Writing-Addons Uses an anonymous function to filter table elements that start with 'm'. ```lua t = T{'meh', 'foo', 'bar', 'muh', 'baz', 'meow'} t:filter(function(x) return x:startswith('m') end) -- Outputs: T{'meh', 'muh', 'meow'} ``` -------------------------------- ### Example: set current character position Source: https://github.com/windower/lua/blob/dev/addons/position_manager/README.md Sets the current character's position to X: 0, Y: 0. ```text //pm set 0 0 ``` -------------------------------- ### Load PetSchool addon Source: https://github.com/windower/lua/blob/dev/addons/PetSchool/ReadMe.txt Command to load the PetSchool addon in-game. Can be added to init.txt or loaded automatically via the Windower v4 launcher. ```text //lua l PetSchool ```