Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
[help] LUA Error after creating very basic addon
Post Flair (click to view more posts with a particular flair)
Author Summary
IamLeperMessiah is in help
Post Body

So a little about what I did.

I went to https://addon.bool.no/ and put 2 lines in that I wanted to test out.

RegisterAttributeDriver(PlayerFrame, "state-visibility", "[combat][@target,exists]show;hide")
RegisterAttributeDriver(ObjectiveTrackerFrame, "state-visibility", "[group:party][raid]hide;show")

As you can see, the first line hides the player frame if no target or out of combat. The 2nd line hides the objective tracker if in a group or raid.

So far so good. It works fine on my hunter. *edit* also tested fine on my priest.

I logged over to my druid and I'm immediately presented with this error:

Message: Interface/FrameXML/ComboFramePlayer.lua:17: Usage: local power = UnitPower(unitToken [, powerType, unmodified])
Time: Mon Jan 30 17:01:46 2023
Count: 1
Stack: Interface/FrameXML/ComboFramePlayer.lua:17: Usage: local power = UnitPower(unitToken [, powerType, unmodified])
[string "=(tail call)"]: ?
[string "@Interface/AddOns/WagoAnalytics/WagoAnalytics.lua"]:72: in function <Interface/AddOns/WagoAnalytics/WagoAnalytics.lua:70>
[string "=[C]"]: ?
[string "=[C]"]: in function `UnitPower'
[string "@Interface/FrameXML/ComboFramePlayer.lua"]:17: in function `UpdatePower'
[string "@Interface/FrameXML/ClassPowerBar.lua"]:58: in function `OnEvent'
[string "@Interface/FrameXML/ClassResourceBarTemplate.lua"]:58: in function <Interface/FrameXML/ClassResourceBarTemplate.lua:38>

Locals: (*temporary) = <function> defined =[C]:-1

I thought ok, its mentioning "wago analytics" so I disabled that addon and still get this:

Message: Interface/FrameXML/ComboFramePlayer.lua:17: Usage: local power = UnitPower(unitToken [, powerType, unmodified])
Time: Mon Jan 30 17:03:08 2023
Count: 1
Stack: Interface/FrameXML/ComboFramePlayer.lua:17: Usage: local power = UnitPower(unitToken [, powerType, unmodified])
[string "=(tail call)"]: ?
[string "=[C]"]: ?
[string "=[C]"]: in function `UnitPower'
[string "@Interface/FrameXML/ComboFramePlayer.lua"]:17: in function `UpdatePower'
[string "@Interface/FrameXML/ClassPowerBar.lua"]:58: in function `OnEvent'
[string "@Interface/FrameXML/ClassResourceBarTemplate.lua"]:58: in function <Interface/FrameXML/ClassResourceBarTemplate.lua:38>

Locals: (*temporary) = <function> defined =[C]:-1

So I am at a loss. Any LUA gurus out there that can tell me whats going on or how to fix that?

*EDIT*

I seem to have fixed it by making it wait until player entered the world.

local EventFrame = CreateFrame("frame", "EventFrame")
EventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")

EventFrame:SetScript("OnEvent", function(self, event, ...)
    if(event == "PLAYER_ENTERING_WORLD") then
      RegisterAttributeDriver(PlayerFrame, "state-visibility", "[combat][@target,exists]show;hide")
      RegisterAttributeDriver(ObjectiveTrackerFrame, "state-visibility", "[group:party][raid]hide;show")
    end
end)

Is this the best way to do this? Just looking for input from coding perspective. Trying to teach myself LUA coding on the fly here.

Author
Account Strength
90%
Account Age
11 years
Verified Email
Yes
Verified Flair
No
Total Karma
653
Link Karma
305
Comment Karma
348
Profile updated: 3 days ago
Posts updated: 1 month ago

Subreddit

Post Details

Location
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago