Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- table_spell_1 = { }
- print(#table_spell_1)
- --[[---------------------------------------------
- OnEvent
- ]]-----------------------------------------------
- local f = CreateFrame("Frame")
- f:RegisterEvent("UNIT_SPELLCAST_FAILED"); --2
- f:SetScript("OnEvent", function(self, event, ...)
- local arg = {...}
- if event == "UNIT_SPELLCAST_FAILED"
- and arg[1] == "player"
- and arg[2] ~= ""
- then
- table.insert(table_spell_1, arg[2])
- print(arg[2])
- print(#table_spell_1)
- print(#table_spell_1[1])
- print(#table_spell_1[2])
- -- wipe(table_spell_1)
- end
- end)
- --[[---------------------------------------------
- OnUpdate
- ]]-----------------------------------------------
- f:SetScript("OnUpdate", function()
- if #table_spell_1 >= 1 then
- CastSpellByName(table_spell_1[1])
- -- Cast(table_spell_1[1])
- -- wipe(table_spell_1)
- -- table.remove(table_spell_1, arg[2])
- end
- if #table_spell_1 >= 4 then
- table.remove(table_spell_1, 1)
- -- wipe(table_spell_1)
- end
- end)
- local f = CreateFrame("Frame")
- f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED");
- f:SetScript("OnEvent", function(self, event, ...)
- local arg = {...}
- if event == "UNIT_SPELLCAST_SUCCEEDED"
- and arg[1] == "player"
- and arg[2] == table_spell_1[1]
- then
- print("true")
- table.remove(table_spell_1, 1)
- wipe(table_spell_1)
- -- table.remove(table_spell_1, 1)
- -- table.insert(table_spell_1, arg[2])
- -- print(arg[2])
- -- print(#table_spell_1)
- -- wipe(table_spell_1)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement