Summary

Your profile is a table that you will define and return in a Lua file. As you have access to the full Lua environment, you will be able to include other files and do a wealth of things from within it. This document is not an exhaustive list of what you can do, but rather a list of the table members that LuAshitacast expects to be present within your profile and how LuAshitacast will interact with them. Your profile should be placed in ashita/config/addons/luashitacast/CharName_CharId/Job.lua. You can use the command /lac newlua to create a blank profile for your current character, id, and job automatically.

Sets

Sets are a core concept within LuAshitacast. They are used to easily define gear in large quantities, and the majority of your swaps should be done using sets. Each set is a table, and can have members for the 16 equipment slots as listed here, and an optional NoWrite boolean. All lua variables, including table entries, are case sensitive. This means that you can technically have multiple sets with the same name(Idle, IDLE, idle would all be different sets). However, when using commands such as '/lac addset', '/lac set', or string based gFunc calls, LuAshitacast will internally search for a non-case sensitive match. As a result, it is recommended that you do not use sets with the same name and different case. When using table based gFunc calls, you will need to use the correct case as well, due to the way Lua itself works. The NoWrite flag should be set to true for any set that utilizes variables or functions to populate any of it's fields, to ensure that addset does not write them to your file. These sets also should not be located inside your primary local sets table, as they will not be written by addset. I recommend creating a secondary sets table and iterating it on load to add them to profile.Sets. If you feel the benefits of using a different design method outweigh the benefits of having AddSet available, make sure your profile sets the AllowAddSet setting to false on load for the safety of your users. The other valid table members are:
Each table member represents one piece of equipment and can be either a string, in which case the equipment's name will be matched against it, or a table, which allows additional parameters. If you use a table, it can have the following members:


Member Name: Name
Member Type: string
Effects: Must be specified. The item to be equipped has to have a name matching the value of this member.


Member Name: AugPath
Member Type: string
Effects: If specified, the item must have this augment path to be equipped. Value should be 'A' 'B' 'C' or 'D'.


Member Name: AugRank
Member Type: number
Effects: If specified, the item must be exactly this rank to be equipped.


Member Name: AugTrial
Member Type: number
Effects: If specified, the item must be on this trial to be equipped.


Member Name: Augment
Member Type: string
Effects: If specified, at least one of the item's augments must match the string to be equipped.


Member Name: Augment
Member Type: table
Effects: If specified, each table entry must be a string, and at least one of the item's augments must match each table entry for the item to be equipped.


Member Name: Quantity
Member Type: number
Effects: This is used to tell Packer to retrieve more than one of an item. It is not needed for cases such as 2 of the same ring, as that will be handled internally. Best used for medications inside the Packer section, or ammo inside sets. No bearing on equipment swaps.


Member Name: Quantity
Member Type: string
Effects: If Quantity exists as a string, it must be the term 'all'. This will tell Packer to retrieve all matching items to wardrobes or inventory.


Member Name: Bag
Member Type: string
Effects: If specified, the item must be in this container to be equipped. Please note that while the tag supports all containers, only heavily modified Topaz servers can equip from anything besides inventory or wardrobes. Possible values:

Profile Members

These are the members of your profile table that LuAshitacast will utilize. Naming is case sensitive and you should not use any of these table members for anything besides the described purpose. Any of these members can be skipped if you have no use for them.
Member Name: Sets
Member Type: table
Effects: This table should contain all of your sets. While you can directly equip set objects that are not contained within this table, only sets within this table will be written with '/lac addset', equipped with '/lac set', or respond to string based EquipSet calls.


Member Name: Packer
Member Type: table
Effects: This table should contain a list of items for use with /lac gear and /lac validate. Keys can be anything, values can be strings or tables, such as in sets. An additional parameter,


Member Name: OnLoad()
Member Type: function
Effects: This function is called when your profile is first loaded. It should handle any ashita event registration, dependency loading, variable initialization, settings modification, dynamic set allocation, keybinds, etc.


Member Name: OnUnload()
Member Type: function
Effects: This function is called when your profile is unloaded. It should undo any ashita event registration, keybinds, global variables, or anything else you've done that may persist outside the scope of your profile.


Member Name: HandleCommand(args)
Member Type: function
Effects: This function is called when the user types '/lac fwd' based commands. Any arguments input after the first 2 are passed in. This should be used for interfacing with the profile's user


Member Name: HandleDefault()
Member Type: function
Effects: This function is called continuously while you are not performing any actions. Unlike Ashitacast, this does not include pet spells or skills. As a result, you should use the default section to handle those by checking the gData.GetPetAction() object. You should also use this section to handle idle, engaged, resting, or other sets that you are likely to need while not performing actions.


Member Name: HandleAbility()
Member Type: function
Effects: This function is called when you use an ability and should be used to equip gear that will make the ability more effective or a defensive set.


Member Name: HandleItem()
Member Type: function
Effects: This function is called when you use an item and should be used to equip gear that will make the item more effective or a defensive set.


Member Name: HandlePrecast()
Member Type: function
Effects: This function is called when you cast a spell, and equips are processed before the spell packet. It should be used to equip fast cast and quick magic gear.


Member Name: HandleMidcast()
Member Type: function
Effects: This function is called when you cast a spell, and equips are processed after the spell packet. It should be used to equip anything that changes the result or recast time of a spell.


Member Name: HandlePreshot()
Member Type: function
Effects: This function is called when you use ranged attack, and equips are processed before the ranged attack packet. It should be used to equip snapshot and rapid shot gear.


Member Name: HandleMidshot()
Member Type: function
Effects: This function is called when you use ranged attack, and equips are processed after the ranged attack packet. It should be used to equip anything that changes the result of the ranged attack.


Member Name: HandleWeaponskill()
Member Type: function
Effects: This function is called when you use a weaponskill and should be used to equip gear that you want to wear while weaponskilling.