Summary
gData is a global table containing functions used to simplify the process of acquiring data for conditional swaps. The following functions are designed for use by end users and documented. You should not modify the gData table in any way, nor should you try to call any functions not documented here.
Declaration: gData.GetCurrentCall()
Return Type: string
Return Value: OnLoad, OnUnload, HandleCommand, HandleDefault, HandleAbility, HandleItem, HandlePrecast, HandleMidcast, HandlePreshot, HandleMidshot, HandleWeaponskill, N/A
Declaration: gData.GetAlliance()
Return Type: table
Return Table Members:
ActionTarget (boolean): true if you are currently executing an action targeting an alliance member, false otherwise
Count (number): number of members in your alliance
InAlly (boolean): true if you are currently in an alliance with members in other parties, false otherwise
Target (boolean): true if you are currently targeting an alliance member, false otherwise
Declaration: gData.GetAction()
Return Type: table (nil if not currently performing an action)
Return Table Members:
ActionType (string): Spell Weaponskill Ability Ranged Item
CastTime (number): the duration, in milliseconds, of a spell or item's base casttime (nil if Type is not Spell or Item)
Element (string): Fire, Ice, Wind, Earth, Thunder, Water, Light, Dark, Non-Elemental, Unknown (nil if Type is not Spell)
Id (number): the internal ID of the action
MpCost (number): the amount of MP the spell costs (nil if Type is not Spell)
MpAftercast (number): the amount of MP you will have remaining if the cast completes at full mp cost (nil if Type is not Spell)
MppAftercast (number): the percentage of remaining MP you will have remaining if the cast completes at full mp cost (nil if Type is not Spell)
Name (string): the action's name
Recast (number): the recast time of the spell or item, in milliseconds (nil if Type is not Item or Spell)
Resend (boolean): true if this is a resend of the last action, false if not
Resource (table): a table from ashita API of type IItem, ISpell, IAbility (nil if Type is Ranged)
Skill (string): Divine Magic, Healing Magic, Enhancing Magic, Enfeebling Magic, Elemental Magic, Dark Magic, Summoning, Ninjutsu, Singing, Blue Magic, Geomancy, Unknown (nil if Type is not Spell)
Type (string): (Spell) White Magic, Black Magic, Summoning, Ninjutsu, Bard Song, Blue Magic, Unknown
Type (string): (Ability) Rune Enchantment, Ready, Blood Pact: Rage, Blood Pact: Ward, Corsair Roll, Quick Draw, Unknown
Declaration: gData.GetActionTarget()
Return Type: table (nil if not currently performing an action)
Return Table Members:
Distance (string): distance in yalms to the target
HPP (number): the target's current HP percentage
Id (number): the target's unique-to-game ID
Index (number): the target's index within the current zone
Name (string): the target's name
Status (string): Idle, Engaged, Dead, Zoning, Resting, Unknown
Type (string): PC, NPC, Alliance, Party, Monster, Unknown
Declaration: gData.GetBuffCount(matchBuff)
Arguments:
matchBuff (string): the name of the buff you are checking for
matchBuff (number): the ID of the buff you are checking for
Return Type: integer
Return Value: how many instances of the input buff you have active
Declaration: gData.GetEntity(index)
Arguments:
index (number): an entity's index within the current zone
Return Type: table (nil if no entity exists at the specified index)
Return Table Members:
Distance (string): distance in yalms to the target
HPP (number): the target's current HP percentage
Id (number): the target's unique-to-game ID
Index (number): the target's index within the current zone
Name (string): the target's name
Status (string): Idle, Engaged, Dead, Zoning, Resting, Unknown
Type (string): PC, NPC, Alliance, Party, Monster, Unknown
Declaration: gData.GetEnvironment()
Return Type: table
Return Table Members:
Area (string): the zone you are currently in
Day (string): Firesday, Earthsday, Watersday, Windsday, Iceday, Lightningday, Lightsday, Darksday, Unknown
DayElement (string): Fire, Earth, Water, Wind, Ice, Thunder, Light, Dark, Unknown
MoonPhase (string): Full Moon, Waning Gibbous, Last Quarter, Waning Crescent, New Moon, Waxing Crescent, First Quarter, Waxing Gibbous, Unknown
MoonPercent (number): value from 0-100 representing moon phase
RawWeather (string): Clear, Sunshine, Clouds, Fog, Fire, Fire x2, Water, Water x2, Earth, Earth x2, Wind, Wind x2, Ice, Ice x2, Thunder, Thunder x2, Light, Light x2, Dark, Dark x2, Unknown
RawWeatherElement (string): None, Fire, Earth, Water, Wind, Ice, Thunder, Light, Dark, Unknown
Time (number): the current time in hours/minutes as a decimal for lt and gt comparisons (12:30 would return 12.30)
Timestamp (table): members are day, hour, minute(all numbers, representing vanadiel time)
Weather and WeatherElement incorporate active storm spells. RawWeather and RawWeatherElement do not.
Weather (string): Clear, Sunshine, Clouds, Fog, Fire, Fire x2, Water, Water x2, Earth, Earth x2, Wind, Wind x2, Ice, Ice x2, Thunder, Thunder x2, Light, Light x2, Dark, Dark x2, Unknown
WeatherElement (string): None, Fire, Earth, Water, Wind, Ice, Thunder, Light, Dark, Unknown
Declaration: gData.GetEquipment()
Return Type: table
Return Value: Table containing information on equipment piece, or nil if no piece is equipped.
Return Table Members:
Main (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Sub (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Range (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Ammo (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Head (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Body (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Hands (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Legs (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Feet (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Neck (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Waist (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Ear1 (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Ear2 (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Ring1 (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Ring2 (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Back (table): members are Container(number), Item(Ashita::FFXI::item_t table), Name(string), Resource(IItem table)
Declaration: gData.GetEquipScreen()
Return Type: table
Return Table Members:
Attack (number): your current attack
DarkResistance (number): your current darkresistance
Defense (number): your current defense
EarthResistance (number): your current earth resistance
FireResistance (number): your current fire resistance
IceResistance (number): your current ice resistance
LightningResistance (number): your current lightning resistance
LightResistance (number): your current light resistance
WaterResistance (number): your current water resistance
WindResistance (number): your current wind resistance
Declaration: gData.GetPet()
Return Type: table (nil if you currently do not have a pet, or your pet is dead)
Return Table Members:
Distance (string): distance in yalms to the target
HPP (number): the target's current HP percentage
Id (number): the target's unique-to-game ID
Index (number): the target's index within the current zone
Name (string): the target's name
Status (string): Idle, Engaged, Dead, Zoning, Resting, Unknown
TP (number): your pet's current tp
Declaration: gData.GetPetAction()
Return Type: table (nil if your pet is dead or not currently performing an action)
Return Table Members:
ActionType (string): Spell Ability MobSkill
CastTime (number): the duration, in milliseconds, of a spell's base casttime (nil if Type is not Spell)
Element (string): Fire, Ice, Wind, Earth, Thunder, Water, Light, Dark, Non-Elemental, Unknown (nil if Type is not Spell)
Id (number): the internal ID of the action
MpCost (number): the amount of MP the spell costs (nil if Type is not Spell)
Name (string): the action's name
Recast (number): the recast time of the spell, in milliseconds (nil if Type is not Spell)
Resource (table): a table from ashita API of type ISpell, IAbility (nil if Type is MobSkill)
Skill (string): Divine Magic, Healing Magic, Enhancing Magic, Enfeebling Magic, Elemental Magic, Dark Magic, Summoning, Ninjutsu, Singing, Blue Magic, Geomancy, Unknown (nil if Type is not Spell)
Type (string): (Spell) White Magic, Black Magic, Summoning, Ninjutsu, Bard Song, Blue Magic, Unknown
Type (string): (Ability) Rune Enchantment, Ready, Blood Pact: Rage, Blood Pact: Ward, Corsair Roll, Quick Draw, Unknown
Declaration: gData.GetPlayer()
Return Type: table
Return Table Members:
HP (number): your current hp
MaxHP (number): your current max hp
HPP (number): your current hp percent
IsMoving (boolean): true if you've moved since last position update, false otherwise
MainJob (string): 3 letter abbreviation for your main job
MainJobLevel (number): the actual level of your main job
MainJobSync (number): the level of your main job with any sync or cap effects applied
MP (number): your current mp
MaxMP (number): your current max mp
MPP (number): your current mp percent
Name (string): your character name
Status (string): Idle, Engaged, Dead, Zoning, Resting, Unknown
SubJob (string): 3 letter abbreviation for your sub job
SubJobLevel (number): the actual level of your sub job
SubJobSync (number): the level of your sub job with any sync or cap effects applied
TP (number): your current TP
Declaration: gData.GetParty()
Return Type: table
Return Table Members:
ActionTarget (boolean): true if you are currently executing an action targeting a party member, false otherwise
Count (number): number of members in your party
InParty (boolean): true if you are currently in a party with other members
Target (boolean): true if you are currently targeting a party member, false otherwise
Declaration: gData.GetTarget()
Return Type: table (nil if you are not currently targeting anything)
Return Table Members:
Distance (string): distance in yalms to the target
HPP (number): the target's current HP percentage
Id (number): the target's unique-to-game ID
Index (number): the target's index within the current zone
Name (string): the target's name
Status (string): Idle, Engaged, Dead, Zoning, Resting, Unknown
Type (string): PC, NPC, Alliance, Party, Monster, Unknown