View Single Post
05-09-06, 09:30 AM   #2
wereHamster
A Black Drake
 
wereHamster's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 80
Additional functions

This section contains additional functions to what the default LUA-Environment already provides.

Localization
Code:
L(s) -- returns localized string
Spells
Code:
SpellReady(s) -- returns true if the spell is not on cooldown
  -- does not check for mana or reagents.
CastSpell(s, onSelf) -- alias for CastSpellByName()

Inventory/Containers
Code:
local item = ItemCreate(pattern) -- returns a handle to the item
item:Type() -- returns "Container" or "Inventory" or nil if item doesn't exist
item:IsReady() -- item not on cooldown
item:IsLocked() -- item can be moved/equiped
item:Use() -- use the item
item:Equip(slot) -- slot is optional, if not specified then autoequips the item
    -- all possible slot strings can be found here
ItemUse(itemList) -- uses the first item that is not on cooldown
    -- and returns its name
Buffs/Debuffs
Code:
BuffActive(unit, buff) -- checks if the unit has an active buff
DebuffActive(unit, debuff) -- checks if the unit has an active debuff
Misc
Code:
Announce(msg) -- announce msg to SAY, RAID or PARTY chat
Debug(msg) -- prints msg to the default chatframe
ShapeshiftForm() -- returns localized shapeshift form name

Last edited by wereHamster : 05-10-06 at 07:08 AM.
  Reply With Quote