Skip to content

Commit

Permalink
Merge pull request #15 from projecteon/master
Browse files Browse the repository at this point in the history
Some cleanups
  • Loading branch information
johnfking committed Sep 18, 2022
2 parents 290fdc9 + 37b4256 commit 0f412db
Show file tree
Hide file tree
Showing 17 changed files with 202 additions and 171 deletions.
2 changes: 2 additions & 0 deletions alias.lua
Expand Up @@ -7,9 +7,11 @@
---@alias MQString fun(): string

--[[ Userdata ]]
---@alias MQAltAbility altability | fun(): string|nil
---@alias MQBuff buff | fun(): string|nil
---@alias MQCachedBuff cachedbuff | fun(): string|nil
---@alias MQCharacter character | fun(): string|nil
---@alias MQInvSlot invslot | fun(): string|nil
---@alias MQItem item | fun(): string|nil
---@alias MQMerchant merchant | fun(): string|nil
---@alias MQPet pet | fun(): string|nil
Expand Down
26 changes: 15 additions & 11 deletions datatype/_achievement.lua
@@ -1,20 +1,20 @@
---@meta
---@class achievement
---@field ID MQInt #The achivement's unique ID
---@field Name MQString #The achievement's name
---@field Description MQString #The achievement's description
---@field Points MQInt #The point value for the achievement
---@field ObjectiveCount MQInt #The number of objectives in this achievement
---@field Index MQInt #The index of the achivement. See [Achivement Indices](https://docs.macroquest.org/reference/top-level-objects/tlo-achievement/#note-about-achievement-indices) for more information.
---@field IconID MQInt #ID of the Achievement state. See [Achivement Icon](https://docs.macroquest.org/reference/data-types/datatype-achievement/#achievement-icon) for more information.
---@field State MQString #The achievement state. See [Achievement State](https://docs.macroquest.org/reference/data-types/datatype-achievement/#achievement-state) for more information.
---@field ID MQInt # The achivement's unique ID
---@field Name MQString # The achievement's name
---@field Description MQString # The achievement's description
---@field Points MQInt # The point value for the achievement
---@field ObjectiveCount MQInt # The number of objectives in this achievement
---@field Index MQInt # The index of the achivement. See [Achivement Indices](https://docs.macroquest.org/reference/top-level-objects/tlo-achievement/#note-about-achievement-indices) for more information.
---@field IconID MQInt # ID of the Achievement state. See [Achivement Icon](https://docs.macroquest.org/reference/data-types/datatype-achievement/#achievement-icon) for more information.
---@field State MQString # The achievement state. See [Achievement State](https://docs.macroquest.org/reference/data-types/datatype-achievement/#achievement-state) for more information.
---@field Completed MQBoolean # If the achievement has been completed
---@field Open MQBoolean # If the achievement is open
---@field Locked MQBoolean # If the achievement is locked
---@field Hidden MQBoolean # If the achievement is hidden
---@field CompletedTime fun():time Calendar time when the achievement was completed.
achievement = {}
local achievement = {}

---@diagnostic disable: duplicate-set-field
---Find an objective by it's Description
---@param description string
---@return achievementobj
Expand All @@ -24,10 +24,14 @@ function achievement.Objective(description) end
---@param id integer
---@return achievementobj
function achievement.Objective(id) end
---@diagnostic enable: duplicate-set-field

---Generate an cheivement link. An optional name can be
---provided to display in the achievement, otherwise the
---current character's name will be used.
---@param name? string
---@return string
function achievement.Link(name) end
function achievement.Link(name) end

---@return time # Calendar time when the achievement was completed.
function achievement.CompletedTime() end
10 changes: 7 additions & 3 deletions datatype/_alert.lua
@@ -1,4 +1,8 @@
---@meta
---@class alert mq datatype
---@field List fun(index:integer):alertlist Get the item from the list at the specified index
---@field Size MQInt #Get the number of alerts
---@class alert
---@field public Size MQInt # Get the number of alerts
local alert = nil

---@param index integer
---@return alertlist # Get the item from the list at the specified index
function alert.List(index) end
40 changes: 20 additions & 20 deletions datatype/_altability.lua
@@ -1,21 +1,21 @@
--- @class altability
--- @field public AARankRequired MQFloat #Rank required to train
--- @field public CanTrain MQBoolean #Returns true/false on if the Alternative Ability can be trained
--- @field public Cost MQFloat #Base cost to train
--- @field public Description MQString #Basic description
--- @field public ID MQInt #ID
--- @field public Index MQFloat #Returns the index number of the Alternative Ability
--- @field public MaxRank MQFloat #Max rank available in this ability
--- @field public MinLevel MQFloat #Minimum level to train
--- @field public MyReuseTime MQFloat #Reuse time with any hastened AA abilties
--- @field public Name MQString #Name
--- @field public NextIndex MQFloat #Returns the next index number of the Alternative Ability
--- @field public PointsSpent MQFloat #Returns the amount of points spent on an AA
--- @field public Passive MQBoolean #Returns true/false on if the Alternative Ability is passive
--- @field public RequiresAbility altability Required ability (if any)
--- @field public Rank MQFloat #Returns the Rank of the AA
--- @field public RequiresAbilityPoints MQFloat #Points required in above ability
--- @field public ReuseTime MQFloat #Reuse time in seconds
--- @field public ShortName MQString #Short name
--- @field public Spell MQSpell Spell used by the ability (if any)
--- @field public Type MQFloat #Type (1-6)
--- @field public AARankRequired MQFloat # Rank required to train
--- @field public CanTrain MQBoolean # Returns true/false on if the Alternative Ability can be trained
--- @field public Cost MQFloat # Base cost to train
--- @field public Description MQString # Basic description
--- @field public ID MQInt # ID
--- @field public Index MQFloat # Returns the index number of the Alternative Ability
--- @field public MaxRank MQFloat # Max rank available in this ability
--- @field public MinLevel MQFloat # Minimum level to train
--- @field public MyReuseTime MQFloat # Reuse time with any hastened AA abilties
--- @field public Name MQString # Name
--- @field public NextIndex MQFloat # Returns the next index number of the Alternative Ability
--- @field public PointsSpent MQFloat # Returns the amount of points spent on an AA
--- @field public Passive MQBoolean # Returns true/false on if the Alternative Ability is passive
--- @field public RequiresAbility MQAltAbility # Required ability (if any)
--- @field public Rank MQFloat # Returns the Rank of the AA
--- @field public RequiresAbilityPoints MQFloat # Points required in above ability
--- @field public ReuseTime MQFloat # Reuse time in seconds
--- @field public ShortName MQString # Short name
--- @field public Spell MQSpell # Spell used by the ability (if any)
--- @field public Type MQFloat # Type (1-6)
2 changes: 1 addition & 1 deletion datatype/_bool.lua
@@ -1,2 +1,2 @@
--- @class bool
--- @field public ToString "TRUE" for non-zero, or "FALSE" for zero
--- @field public ToString MQString # "TRUE" for non-zero, or "FALSE" for zero
19 changes: 11 additions & 8 deletions datatype/_buff.lua
@@ -1,10 +1,13 @@
--- @class buff : spell
--- @field public Counters MQFloat #The number of counters added by the buff
--- @field public Dar MQFloat #The remaining damage absorption of the buff (if any). This is not entirely accurate, it will only show you to the Dar of your spell when it was initially cast, or what it was when you last zoned (whichever is more recent).
--- @field public Counters MQFloat # The number of counters added by the buff
--- @field public Dar MQFloat # The remaining damage absorption of the buff (if any). This is not entirely accurate, it will only show you to the Dar of your spell when it was initially cast, or what it was when you last zoned (whichever is more recent).
--- @field public Duration ticks The time remaining before the buff fades (not total duration)
--- @field public ID MQInt #The ID of the buff or shortbuff slot
--- @field public Level MQFloat #The level of the person that cast the buff on you (not the level of the spell)
--- @field public Mod MQFloat The modifier to a bard song
--- @field public Remove fun() Removes the named/partial name buff
--- @field public Spell MQSpell The spell
--- @field public ToString MQString #Same as Name
--- @field public ID MQInt # The ID of the buff or shortbuff slot
--- @field public Level MQFloat # The level of the person that cast the buff on you (not the level of the spell)
--- @field public Mod MQFloat # The modifier to a bard song
--- @field public Spell MQSpell # The spell
--- @field public ToString MQString # Same as Name
local buff = nil

---Removes the named/partial name buff
function buff.Remove() end
22 changes: 11 additions & 11 deletions datatype/_class.lua
@@ -1,12 +1,12 @@
---@class class
---@field public CanCast MQBoolean #Can cast seplls, including Bard
---@field public ClericType MQBoolean #Cleric/Paladin?
---@field public DruidType MQBoolean #Druid/Ranger?
---@field public HealerType MQBoolean #Cleric/Druid/Shaman?
---@field public ID MQInt #The class's ID #
---@field public MercType MQBoolean #Mercenary?
---@field public Name MQString #The long name, as in "Ranger"
---@field public NecromancerType MQBoolean #Necromancer/Shadow Knight?
---@field public PureCaster MQBoolean #Any one of: Cleric, Druid, Shaman, Necromancer, Wizard, Mage, Enchanter
---@field public ShamanType MQBoolean #Shaman/Beastlord?
---@field public ShortName MQString #The short name as in "RNG"
---@field public CanCast MQBoolean # Can cast seplls, including Bard
---@field public ClericType MQBoolean # Cleric/Paladin?
---@field public DruidType MQBoolean # Druid/Ranger?
---@field public HealerType MQBoolean # Cleric/Druid/Shaman?
---@field public ID MQInt # The class's ID #
---@field public MercType MQBoolean # Mercenary?
---@field public Name MQString # The long name, as in "Ranger"
---@field public NecromancerType MQBoolean # Necromancer/Shadow Knight?
---@field public PureCaster MQBoolean # Any one of: Cleric, Druid, Shaman, Necromancer, Wizard, Mage, Enchanter
---@field public ShamanType MQBoolean # Shaman/Beastlord?
---@field public ShortName MQString # The short name as in "RNG"
14 changes: 8 additions & 6 deletions datatype/_corpse.lua
@@ -1,14 +1,16 @@
---@class corpse : spawn Data related to the current lootable corpse. See [Corpse](https://docs.macroquest.org/reference/top-level-objects/tlo-corpse/)
---@field public Items MQFloat #Number of items on the corpse
---@field public Open MQBoolean #Corpse open?
corpse = {}
---@class corpse : spawn # Data related to the current lootable corpse. See [Corpse](https://docs.macroquest.org/reference/top-level-objects/tlo-corpse/)
---@field public Items MQFloat # Number of items on the corpse
---@field public Open MQBoolean # Corpse open?
local corpse = {}

---@diagnostic disable: duplicate-set-field
--- Finds an item by partial name in this corpse (use =<name> for exact match)
---@param name string
---@return MQItem
function corpse.Item(name) end

--- Nth item on the corpse
---@param index any
---@param index integer
---@return MQItem
function corpse.Item(index) end
function corpse.Item(index) end
---@diagnostic enable: duplicate-set-field
20 changes: 10 additions & 10 deletions datatype/_framelimiter.lua
@@ -1,11 +1,11 @@
---@class framelimiter
---@field public BackgroundFPS MQFloat #Value of the target background fps setting.
---@field public ClearScreen MQBoolean #Value of the clear screen when not rendering setting.
---@field public CPU MQFloat #Current CPU usage as %
---@field public Enabled MQBoolean #TRUE if the frame limiter feature is currently active.
---@field public ForegroundFPS MQFloat #Value of the target foreground fps setting.
---@field public MinSimulationFPS MQFloat #Value of the minimum simualtion rate setting.
---@field public RenderFPS MQFloat #Current graphics scene frame rate (visible fps).
---@field public SaveByChar MQBoolean #TRUE if settings for the frame limiter are being saved by character.
---@field public SimulationFPS MQFloat #Current simulation frame rate (game updates per second).
---@field public Status MQString #Either "Foreground" or "Background".
---@field public BackgroundFPS MQFloat # Value of the target background fps setting.
---@field public ClearScreen MQBoolean # Value of the clear screen when not rendering setting.
---@field public CPU MQFloat # Current CPU usage as %
---@field public Enabled MQBoolean # TRUE if the frame limiter feature is currently active.
---@field public ForegroundFPS MQFloat # Value of the target foreground fps setting.
---@field public MinSimulationFPS MQFloat # Value of the minimum simualtion rate setting.
---@field public RenderFPS MQFloat # Current graphics scene frame rate (visible fps).
---@field public SaveByChar MQBoolean # TRUE if settings for the frame limiter are being saved by character.
---@field public SimulationFPS MQFloat # Current simulation frame rate (game updates per second).
---@field public Status MQString # Either "Foreground" or "Background".
14 changes: 12 additions & 2 deletions datatype/_friends.lua
@@ -1,3 +1,13 @@
--- @class friends
--- @field public Friend boolean Returns TRUE if name is on your friend list
--- @field public ToString number Number of friends on your friends list
--- @field public ToString MQString # Number of friends on your friends list
local friends = nil

---@diagnostic disable: duplicate-set-field
---@param name string
---@return boolean
function friends.Friend(name) end

---@param index integer
---@return string # Returns the name of friend list member at [index]
function friends.Friend(index) end
---@diagnostic enable: duplicate-set-field
10 changes: 5 additions & 5 deletions datatype/_heading.lua
@@ -1,6 +1,6 @@
--- @class heading
--- @field public Clock MQFloat #The nearest clock direction, e.g. 1-12
--- @field public Degrees MQFloat #Heading in degrees
--- @field public DegreesCCW MQFloat #Heading in degrees counter-clockwise. This is the way the rest of MQ and EQ uses it.
--- @field public Name MQString #The long compass direction, e.g. "south by southeast"
--- @field public ShortName MQString #The short compass direction, e.g. "SSE"
--- @field public Clock MQFloat # The nearest clock direction, e.g. 1-12
--- @field public Degrees MQFloat # Heading in degrees
--- @field public DegreesCCW MQFloat # Heading in degrees counter-clockwise. This is the way the rest of MQ and EQ uses it.
--- @field public Name MQString # The long compass direction, e.g. "south by southeast"
--- @field public ShortName MQString # The short compass direction, e.g. "SSE"
12 changes: 6 additions & 6 deletions datatype/_invslot.lua
@@ -1,7 +1,7 @@
--- @class invslot
--- @field public ID MQInt #ID of this item slot (usable directly by /itemnotify)
--- @field public Item MQItem Item data for the item in this slot
--- @field public Name MQString #For inventory slots not inside packs, the slot name, otherwise NULL
--- @field public Pack invslot Container that must be opened to access the slot with /itemnotify
--- @field public Slot MQInt #Slot number inside the pack which holds the item, otherwise NULL
--- @field public ToString MQString #Same as ID
--- @field public ID MQInt # ID of this item slot (usable directly by /itemnotify)
--- @field public Item MQItem # Item data for the item in this slot
--- @field public Name MQString # For inventory slots not inside packs, the slot name, otherwise NULL
--- @field public Pack MQInvSlot # Container that must be opened to access the slot with /itemnotify
--- @field public Slot MQInt # Slot number inside the pack which holds the item, otherwise NULL
--- @field public ToString MQString # Same as ID
18 changes: 9 additions & 9 deletions datatype/_skill.lua
@@ -1,10 +1,10 @@
--- @class skill
--- @field public Activated MQBoolean #Returns TRUE if the skill has been activated
--- @field public AltTimer MQBoolean #Returns TRUE if the skill uses the kick/bash/slam/backstab/frenzy timer
--- @field public ID number Skill number
--- @field public MinLevel MQInt #Minimum level for your class
--- @field public Name MQString #Name of the skill
--- @field public ReuseTime MQFloat #Reuse timer (what number format? ticks, seconds, deciseconds?)
--- @field public SkillCap MQInt #Skill cap based on your current level and class.
--- @field public StartingSkill MQInt #Base skill level for your class
--- @field public ToString MQString #Same as Name
--- @field public Activated MQBoolean # Returns TRUE if the skill has been activated
--- @field public AltTimer MQBoolean # Returns TRUE if the skill uses the kick/bash/slam/backstab/frenzy timer
--- @field public ID MQInt # Skill number
--- @field public MinLevel MQInt # Minimum level for your class
--- @field public Name MQString # Name of the skill
--- @field public ReuseTime MQFloat # Reuse timer (what number format? ticks, seconds, deciseconds?)
--- @field public SkillCap MQInt # Skill cap based on your current level and class.
--- @field public StartingSkill MQInt # Base skill level for your class
--- @field public ToString MQString # Same as Name
2 changes: 1 addition & 1 deletion datatype/_spawn.lua
Expand Up @@ -103,7 +103,7 @@
--- @field public MercID fun(): number
--- @field public Mount MQSpawn Mount
--- @field public Moving MQBoolean #Moving?
--- @field public MQLoc MQFloat #Location using MQ format
--- @field public MQLoc MQString # Location using MQ format
--- @field public Name MQString #Name
--- @field public Named MQBoolean #Is this a "named" spawn (ie. does it's name not start with an "a" or an "an")
--- @field public NearestSpawn spawn Find the nearest spawn matching this Spawn Search, to this spawn (most efficient on yourself)
Expand Down

0 comments on commit 0f412db

Please sign in to comment.