add on - World of Warcraft Lua - Changing frame:SetAttribute() -
i'm working on addon world of warcraft overhauls interface adapt play style.
in addon, have large button acts "main dps rotation" mage. change spell casts based on optimal @ given time. doesn't cast spell automatically, presents next best option user.
here code far:
print "interface overhaul : loaded" heatingupisactive = false print(heatingupisactive) local button = createframe("button", "mybutton", uiparent,"secureactionbuttontemplate") button:setwidth(256) button:setheight(256) button:setframestrata("high") button:setpoint("left") button:settext("main rotation") button:registerforclicks("anyup") button:setattribute("type", "spell") button:setattribute("spell", "fireball") button:registerevent("unit_aura"); local function auragained(self, event, ...) if (unitaura("player", "heating up")) if (heatingupisactive == false) heatingupisactive = true print (heatingupisactive) print ("heating active!") button:setattribute("spell", "inferno blast") end else heatingupisactive = false print("heating not active.") print(heatingupisactive) end end button:setscript("onevent", auragained); local tex = button:createtexture("artwork"); tex:setpoint("left") tex:setwidth(256) tex:setheight(256) tex:settexture("interface\\addons\\interfaceoverhaul\\button2")
if heatingupisactive == true
, button cast ("spell", "inferno blast")
instead of ("spell", "fireball")
, doesn't work if place correct part of if
statements.
any thoughts?
as mud said, cannot rebind buttons in combat anymore. blizzard made change prevent bots being able automate combat. notably, in order cast spell need use 1 of secure templates, , these secure templates allow modification of attributes control when you're not in combat. cannot have 1 button change spells mid-combat. similarly, prevent modifying attributes position or visibility, cannot move buttons under mouse either.
the best can display visual indicator of spell should cast, rely on user press correct button.
Comments
Post a Comment