Thread Tools Display Modes
10-03-18, 09:06 PM   #1
cosmabgd
A Murloc Raider
Join Date: Oct 2018
Posts: 6
UnitAura error

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"
Attached Files
File Type: lua TauntMasterGUI.lua (16.6 KB, 130 views)
File Type: xml TauntMasterGUI.xml (10.5 KB, 205 views)
File Type: lua TauntMaster2.lua (6.7 KB, 137 views)
  Reply With Quote
10-03-18, 10:09 PM   #2
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 106
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.
  Reply With Quote
10-03-18, 11:56 PM   #3
cosmabgd
A Murloc Raider
Join Date: Oct 2018
Posts: 6
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.
  Reply With Quote
10-04-18, 12:48 AM   #4
Lyak
A Cyclonian
Join Date: Jul 2018
Posts: 46
Try to use AuraUtil.FindAuraByName instead of UnitAura.

Lua Code:
  1. AuraUtil.FindAuraByName(ResolveName, "player", "HELPFUL")

AuraUtil.FindAuraByName works exactly same as an old UnitAura function with querying by spell name.

I also learnt it from zork

-- 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

Last edited by Lyak : 10-04-18 at 01:49 AM.
  Reply With Quote
10-04-18, 01:27 AM   #5
cosmabgd
A Murloc Raider
Join Date: Oct 2018
Posts: 6
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>
Attached Files
File Type: lua TauntMaster2.lua (6.7 KB, 119 views)
File Type: lua TauntMasterGUI.lua (16.6 KB, 101 views)
  Reply With Quote
10-04-18, 01:45 AM   #6
Lyak
A Cyclonian
Join Date: Jul 2018
Posts: 46
Originally Posted by cosmabgd View Post
Thank you for your answer , but now i am getting more errors:
You just registered an event called "AuraUtil.FindAuraByName" which, of course, does not exist.

You only have to change those UnitAura function calls, not UNIT_AURA event
(You might have done by accident.)

Lua Code:
  1. if (currentSpecName == 250) or (currentSpecName == 104) or (currentSpecName == 268) or (currentSpecName == 66) or (currentSpecName == 73) or (currentSpecName == 581) then
  2.     -- 250 - Blood(Death Knight),  104 - Guardian(Druid) , 268 - Brewmaster(Monk ), 66 - Protection(Paladin) ,  73 - Protection(Warrior)  , 581 - Vengeance(Demon Hunter)
  3.     resolveBar:SetMinMaxValues(0, 240)
  4.     resolveBar:SetValue(0)
  5.     resolveBar:RegisterEvent("UNIT_AURA") -- THIS
  6.     resolveBar:SetScript("OnEvent", function(resolveBar, event, ...)
  7.         if (AuraUtil.FindAuraByName(ResolveName, "player", "HELPFUL")) then

Last edited by Lyak : 10-04-18 at 01:54 AM.
  Reply With Quote
10-04-18, 02:15 PM   #7
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Just so you know in future, events are entirely capitalized, like UNIT_AURA, whereas API instructions are camel-cased, like AuraUtil.FindAuraByName.
  Reply With Quote
10-04-18, 07:05 PM   #8
cosmabgd
A Murloc Raider
Join Date: Oct 2018
Posts: 6
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 )
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_100518_095851.jpg
Views:	199
Size:	450.5 KB
ID:	9125  
Attached Files
File Type: lua TauntMasterConfig.lua (12.7 KB, 161 views)
File Type: lua TauntMaster2.lua (6.7 KB, 165 views)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » UnitAura error

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off