Returns information about an action slot
See also Action functions.
Signature:
type, id, subType, spellID = GetActionInfo(slot)
Arguments:
slot- An action slot (number)
Returns:
type- Type of action in the slot (string)companion- Summons a mount or non-combat petequipmentset- Equips a set of itemsflyout- Brings up a menu of related spellsitem- Uses an itemmacro- Runs a macrospell- Casts a spell
id- An identifier for the action; varies by type: (number or string)companion- The companion's index in the mount or minipet listequipmentset- Name of the equipment setitem- The item's itemIDmacro- The macro's index in the macro list (macroID)spell- The spell's index in the player's spellboook ( spellbookID)
subType- Subtype of the action (ornilif not applicable) (string)CRITTER- Forcompanionactions: indicatesidis as an index in the non-combat pets listMOUNT- Forcompanionactions: indicatesidis an index in the mounts listspell- Forspellactions: indicatesidis an index in the player's spellbook (as opposed to the pet's)
spellID- Forspellandcompanionactions, the global ID of the spell (or the summoning "spell" for a companion) (string, spellID)
Examples:
-- Prints all types and subtypes found in the player's actions
local types = {}
for i=1,120 do
local type,id,subtype = GetActionInfo(i)
if type then
types[type] = types[type] or {}
if subtype then
types[type][subtype] = 1
end
end
end
for type, subtypes in pairs(types) do
print("Type:", type, "subtypes:")
local numSubtypes = 0
for subtype in pairs(subtypes) do
print(" ", subtype)
numSubtypes = numSubtypes + 1
end
if numSubtypes == 0 then
print(" no subtypes")
end
end