1. #1

    How do I update an addon(LUA)

    Hello guys.

    So, I'm a big fan of Lorti UI, but I have a problem with the addon right now, and that's when you change stances(auras) it freezes for a few seconds.
    I simply want to know WHAT do I have to fix in the .lua to update it so it works w/o that lag?

    I mean, most addons requires this whenever a big patch comes out, but what do they really have to change to make it work?

    Edit: So, I've decided to try fix this myself, but I need some help to understand what this shiet means.
    Here's what I've got so far;

    LUA Error:
    Code:
    Message: Interface\AddOns\Lorti UI\func\functions.lua:103: attempt to index local 'bo' (a nil value)
    Time: 01/24/12 16:36:16
    Count: 1
    Stack: Interface\AddOns\Lorti UI\func\functions.lua:103: in function <Interface\AddOns\Lorti UI\func\functions.lua:86>
    [C]: in function `ActionButton_Update'
    Interface\FrameXML\ActionButton.lua:478: in function `ActionButton_OnEvent'
    Interface\FrameXML\ActionButton.lua:105: in function <Interface\FrameXML\ActionButton.lua:98>
    line 103:
    Code:
    --hide the border (plain ugly, sry blizz)
    [line103]bo:Hide()
    bo.Show = nomoreplay
    line 86:
    Code:
    --initial style func
    [line86] local function rActionButtonStyler_AB_style(self)
    So what does this even mean?
    Last edited by Balyn; 2012-01-24 at 03:40 PM.
    I'm a kittycat

  2. #2
    Deleted
    bo is nil (no value) at line 103 when the code tries to index it (since ":Hide()" tries to call a member function called "Hide"). Go upwards in the code and look for bo's definition (something along the lines of [local ] bo = (something)). Paste that.

  3. #3
    Quote Originally Posted by Treeston View Post
    bo is nil (no value) at line 103 when the code tries to index it (since ":Hide()" tries to call a member function called "Hide"). Go upwards in the code and look for bo's definition (something along the lines of [local ] bo = (something)). Paste that.
    local bo = _G[name.."Border"] at line 95
    Code:
      --initial style func
      local function rActionButtonStyler_AB_style(self)
      
        if not self.rABS_Styled and self:GetParent() and  self:GetParent():GetName() ~= "MultiCastActionBarFrame" and self:GetParent():GetName() ~= "MultiCastActionPage1" and self:GetParent():GetName() ~= "MultiCastActionPage2" and self:GetParent():GetName() ~= "MultiCastActionPage3" then
          
          local action = self.action
          local name = self:GetName()
          local bu  = _G[name]
          local ic  = _G[name.."Icon"]
          local co  = _G[name.."Count"]
          local bo  = _G[name.."Border"]
          local ho  = _G[name.."HotKey"]
          local cd  = _G[name.."Cooldown"]
          local na  = _G[name.."Name"]
          local fl  = _G[name.."Flash"]
          local nt  = _G[name.."NormalTexture"]
    That's all I can find for "Bo"
    Last edited by Balyn; 2012-01-24 at 05:10 PM.
    I'm a kittycat

  4. #4
    Deleted
    Hmm, it's trying to hide the border of an action button which is called <button name>Border. Possible that Blizzard renamed the frames.

    For now:
    Code:
    if bo then
        bo:Hide()
        bo.Show = nomoreplay
    end

  5. #5
    Quote Originally Posted by Treeston View Post
    Hmm, it's trying to hide the border of an action button which is called <button name>Border. Possible that Blizzard renamed the frames.

    For now:
    Code:
    if bo then
        bo:Hide()
        bo.Show = nomoreplay
    end
    Tried changing the
    Code:
          --hide the border (plain ugly, sry blizz)
          bo:Hide()
          bo.Show = nomoreplay
    To

    Code:
    --hide the border (plain ugly, sry blizz)
    if bo then
        bo:Hide()
        bo.Show = nomoreplay
    end
    Got a new LUA error:
    Code:
    Message: Interface\AddOns\Lorti UI\func\functions.lua:124: attempt to index local 'na' (a nil value)
    Line 124 is "na:Hide()"
    Code:
    local na  = _G[name.."Name"]
    I've looked around with Fstack but as you said, they may have changed the name.
    Could it perhaps have something to do with The Extra Action Button?
    Last edited by Balyn; 2012-01-24 at 06:05 PM.
    I'm a kittycat

  6. #6
    Deleted
    Hmm.
    Try adding before line 124:
    Code:
    if not na then print(name) return end
    That should tell you what button is giving issues.

  7. #7
    Quote Originally Posted by Treeston View Post
    Hmm.
    Try adding before line 124:
    Code:
    if not na then print(name) return end
    That should tell you what button is giving issues.
    ExtraActionButton1
    in the chat.

    Other than that, It works.
    I'm a kittycat

  8. #8
    Deleted
    Well, you can essentially do this for everything.
    Code:
    if na then
        na:Hide()
    end
    Equivalent for all the others that give errors.
    (And remove the debug code added last time.)

  9. #9
    Quote Originally Posted by Treeston View Post
    Well, you can essentially do this for everything.
    Code:
    if na then
        na:Hide()
    end
    Equivalent for all the others that give errors.
    (And remove the debug code added last time.)
    Right, okay. cheers mate. ^^
    Could you just explain shortly what the "real" problem was?

    Just so I learn I mean. ^^

    Altho, I get this error:
    Code:
    Interface\AddOns\Lorti UI\func\functions.lua:256: 'end' expected (to close 'function' at line 86) near '<eof>'
    I mean, "To close function"? How can it be too close?! :P

    86:
    local function rActionButtonStyler_AB_style(self)
    256.. There is no line 256. :P

    Edit: right, it's just me being retarded. Thank you very, very much mate. Got it all fixed now
    Last edited by Balyn; 2012-01-24 at 06:31 PM.
    I'm a kittycat

  10. #10
    Deleted
    Means you missed a "end" somewhere - check all the if's you added.
    It's expecting the function definition (starting at line 86) to be closed before the file ends ("near '<eof>'" [=end of file]). Since I assume it's properly closed, this means that there's an 'end' missing somewhere else (the parser simply only notices it at the end).

    As for the earlier errors, it's because Blizzard usually doesn't store their "special" textures (borders, labels, etc) in sub-frames of the frame table (as most addons do, as it makes more sense) but instead uses up another global named the same as the parent button with an added suffix (MultiBarLeftButton1's (I think that's one of the action buttons, could be wrong there) "use this spell now" highlight border would be stored in the global MultiBarLeftButton1Border, for example.

    What the addon does is retrieve the passed button's name (= its global key), append "Button", then :Hide() the global with that key. If that global doesn't exist (Blizzard renaming their global keys, for example - or a button not having them, as is likely the case with ExtraActionButton1, which is the boss ability button for Dream/Heroic Will(?)), the addon attempts to index a nil value (since non-existing table keys default to nil in Lua), throwing an error.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •