UnitAura error
3 Attachment(s)
hello . i am new here and new on addon projects. I am trying to resurect an old addon tauntmaster 2 but i get some error and i dont understand where is the problem. i am searching for a little help . thank you
error : Message: Interface\AddOns\TauntMaster2\Gui\TauntMasterGUI.lua:399: Usage: UnitAura("unit", [index][, "filter"]) Time: Thu Oct 4 12:03:49 2018 Count: 67 Stack: Interface\AddOns\TauntMaster2\Gui\TauntMasterGUI.lua:399: Usage: UnitAura("unit", [index][, "filter"]) [C]: in function `UnitAura' Interface\AddOns\TauntMaster2\Gui\TauntMasterGUI.lua:399: in function <Interface\AddOns\TauntMaster2\Gui\TauntMasterGUI.lua:398> Locals: (*temporary) = "player" (*temporary) = nil (*temporary) = nil (*temporary) = "HELPFUL" |
This isn't an area I'm familiar with, but I do know they changed UnitAura in 8.0:
https://wow.gamepedia.com/API_UnitAura It only has 3 parameters, and you can't look up auras by name just index. So UnitAura("player", 1, "HELPFUL") would give you the first helpful buff. I think this exact issue has come up a few time recently so you might want to search the forum for more details on the new way to do this. |
thank you for your reply .
Yes i read about the changes in BFA , but i still don't understand how the modification can be done . I was thinking that for this addon i don't need a buff check or maybe i am wrong . Maybe someone can look on the code and guide me to the right way. |
Try to use AuraUtil.FindAuraByName instead of UnitAura.
Lua Code:
AuraUtil.FindAuraByName works exactly same as an old UnitAura function with querying by spell name. I also learnt it from zork :D -- EDIT #1 Well, I honestly can't say it works exactly same as I have not seen how UnitAura works internally, but at least it returns same outputs :rolleyes: |
2 Attachment(s)
Thank you for your answer , but now i am getting more errors:
Message: Interface\AddOns\TauntMaster2\Gui\TauntMasterGUI.lua:397: Attempt to register unknown event "AuraUtil.FindAuraByName" Time: Thu Oct 4 16:23:38 2018 Count: 1 Stack: Interface\AddOns\TauntMaster2\Gui\TauntMasterGUI.lua:397: Attempt to register unknown event "AuraUtil.FindAuraByName" [C]: in function `RegisterEvent' Interface\AddOns\TauntMaster2\Gui\TauntMasterGUI.lua:397: in function `resolveBar_SetSpec' Interface\AddOns\TauntMaster2\Gui\TauntMasterGUI.lua:121: in function `TauntMasterGUI_ShowFrame' Interface\AddOns\TauntMaster2\TauntMaster2.lua:58: in function <Interface\AddOns\TauntMaster2\TauntMaster2.lua:52> (tail call): ? [C]: ? [string "safecall Dispatcher[1]"]:9: in function <[string "safecall Dispatcher[1]"]:5> (tail call): ? ...xternal\Wildpants\libs\AceAddon-3.0\AceAddon-3.0.lua:558: in function `EnableAddon' ...xternal\Wildpants\libs\AceAddon-3.0\AceAddon-3.0.lua:651: in function <...xternal\Wildpants\libs\AceAddon-3.0\AceAddon-3.0.lua:636> [C]: ? [C]: in function `LoadAddOn' Interface\FrameXML\UIParent.lua:446: in function `UIParentLoadAddOn' Interface\FrameXML\UIParent.lua:565: in function `TimeManager_LoadUI' Interface\FrameXML\UIParent.lua:1192: in function <Interface\FrameXML\UIParent.lua:1090> Locals: <none> |
Quote:
You only have to change those UnitAura function calls, not UNIT_AURA event :p (You might have done by accident.) Lua Code:
|
Just so you know in future, events are entirely capitalized, like UNIT_AURA, whereas API instructions are camel-cased, like AuraUtil.FindAuraByName.
|
3 Attachment(s)
Thank you all for the answer , yes right now i don't have more errors . i know i am a not good on coding but i try to learn .
Now if i can bother you with one more problem: what they change in 8.0 because configuration menu is not clickable anymore (i have uploaded a screenshot ) |
All times are GMT -6. The time now is 01:58 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI