Hi. I'm trying to create my first addon; basically just a function that designates certain castsequences according to the class of my target. I'm new to this, though. I'd just like to know how to go about making this useable in-game.
Any help would be appreciated.
Code:
local TotemByTarget = {}
function TotemByTarget:SetUp() local targetClass = UnitClass("target") /castsequence reset=4, cseq.(targetClass)[1], cseq.(targetClass)[2], cseq.(targetClass)[3], cseq.(targetClass)[4];end
local PCT = "Poison Cleansing Totem"
local HST = "Healing Stream Totem"
local ST = "Searing Totem"
local MT = "Magma Totem"
local GT = "Grounding Totem"
local TT = "Tremor Totem"
local NRT = "Nature Resistance Totem"
local FrRT = "Frost Resistance Totem"
local FiRT = "Fire Resistance Totem"
local SST = "Stoneskin Totem"
local ET = "Earthbind Totem"
local WT = "Wrath of Air Totem"
local cseq = {}
cseq.Rogue = [PCT,MT,ET,WT]
cseq.Shaman = [GT,NRT,ST,SST]
cseq.Mage = [GT,FiRT,ET,HST]
cseq.Warlock = [TT,GT,HST,ST]
cseq.Warrior = [ET,MT,HST,ST]
cseq.Druid = [SST,HT,ST,WT]
cseq.Hunter = [PCT,HST,ST,ET]
cseq.Paladin = [WT,ET,HST,ST]
Like I said, I'm new to this. I understand I've probably made some mistakes in the script as well.
To clarify, I'd like to be able to access this function with a macro.