Page 2 of 3 FirstFirst
1
2
3
LastLast
  1. #21
    Deleted
    Exactly. My code won't be blocked by the GUI.

  2. #22
    The error hasn't occured since I posted, XD

    As for the code, it works amazing. I can't thank you enough. Now if only Blizzard would fix their Floating Combat Text so I could see how much damage each move is doing, XD

  3. #23
    The error's back, but it seems to only affect my characters that use PowerAurasClassic, so I assume something with it is causing the errors. But it only affects them if this addon is enabled at the same time. :S

  4. #24
    Deleted
    I've used this "addon" (read: code) for a couple of weeks now and since 2 weeks ago (I guess latest patch 4.0.1a) I keep having "UI failed because of an addon" or some sort of error.

    when at that point I rightclick a buff it says that the problem is the addon, i called it "health&percent".
    Is there some thing in the code that needs to be changed after this patch? Cause it does my head in!

    I do like to point out that its an sweet addon, just a bit buggy for me :'(

    PS: I dont use any buff display addons that could be it. But it is saying that this code is causing the problem.

  5. #25
    Deleted
    I don't see anything that might be blocked by the default UI there.

  6. #26
    Deleted
    Really odd, cause that's the only thing that's causing issues that i cant click off my buffs, its giving the reply that the failure in the UI is caused by this addon.
    It occurs only once or twice a week, so its nothing that annoying but its just odd.
    I'll see if it gets better after the next patch since this one is very buggy for me in general.
    (unable to loot some, cant see some items - refusing to load, unable to inspect at times - no i dont use gearscore, and some other things, we'll see..)

  7. #27
    Deleted
    The addon doesn't even as much as touch your buff frames.

  8. #28
    Treeston, thank you for you time for creating this code, it is almost a perfect replacement for what I used MobInfo2 for. The only other thing that I miss from MI2 is the ToolTip health for when you hover over a mob.

    Now that MI2 is broken again with the 4.0.6 patch, is there any chance you could provide code to add this function to the ToolTip?

    Thanks again!
    Last edited by Neema; 2011-02-10 at 09:52 PM.

  9. #29
    Deleted
    Code:
    local function round(num, places)
        return tonumber(string.format("%."..(places or 0).."f",num))
    end
    local function short(num)
        if num > 10000000 then
            return round(num/1000000, 1).."m"
        elseif num > 10000 then
            return round(num/1000, 1).."k"
        else
            return num
        end
    end
    local a = CreateFrame("Frame")
    a:SetScript("OnEvent", function()
        if not UnitExists("mouseover") then return end
        local uh, uhm = UnitHealth("mouseover"), UnitHealthMax("mouseover")
        GameTooltip:AddDoubleLine("Health", short(uh).."/"..short(uhm).." ("..round(uh/uhm*100,1).."%)", 1, 0.82, 0, 1, 1,1)
    end)
    a:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
    Untested, obviously.

  10. #30
    Wow, thanks for the fast response!

    I just tested it and it does add the mob health to the ToolTip, but unfortunately the health text is not lining up with the tooltip box and the tooltip box does not scale to the addition of the new text.

    Here are two examples:
    neemanet.net/images/tthealth01.jpg
    neemanet.net/images/tthealth02.jpg

    Sorry about the links, I can't post pictures yet.

    Thanks again!

  11. #31
    Deleted
    Code:
    local function round(num, places)
        return tonumber(string.format("%."..(places or 0).."f",num))
    end
    local function short(num)
        if num > 10000000 then
            return round(num/1000000, 1).."m"
        elseif num > 10000 then
            return round(num/1000, 1).."k"
        else
            return num
        end
    end
    local a = CreateFrame("Frame")
    a:SetScript("OnEvent", function()
        if not UnitExists("mouseover") then return end
        local uh, uhm = UnitHealth("mouseover"), UnitHealthMax("mouseover")
        GameTooltip:AddDoubleLine("Health", short(uh).."/"..short(uhm).." ("..round(uh/uhm*100,1).."%)", 1, 0.82, 0, 1, 1,1)
        GameTooltip:Show()
    end)
    a:RegisterEvent("UPDATE_MOUSEOVER_UNIT")

  12. #32
    Thanks Treeston, that works like a charm! I love it, all the functions I needed in a nice light code base, perfect!

  13. #33
    Deleted
    If you're using it in conjunction with the first code I posted (in the same file), you can cut off the two "local function ... end" chunks (everything in the new code before the
    Code:
    local a = CreateFrame("Frame")
    line) to preserve some more memory. I just placed them in the new code because I wanted it to work when used on its own as well.

  14. #34
    I was wondering about that, as I did combine the two code pieces together. Before removing the two chunks, this addon was only taking 6.1K of memory and it dropped to 5.3K after the update.

    Thanks again for provide a nice lightweight piece of code to do exactly what I needed!
    Last edited by Neema; 2011-02-12 at 12:48 PM.

  15. #35
    Deleted
    It may sound strange, but what i loved most about MobInfo2, wasn't the Health-Display (which was covered by an Built-In-Plugin named MobHealth).

    I truely miss the feature to collect the data of which mob dropped what and how often. And to search this said data for things like "leather" and to get the mobs with the best dropchance so far. Hell, you could even filter it by "drop", "herbalism", "mining", "skinning" and "Pick-Pocket" (all for mobs only), which was awesome for farming the dwarven-dice ,)


    is there any possibility to get such feature back?
    Last edited by mmoc50acda90bd; 2011-02-12 at 01:22 PM.

  16. #36
    I made an addition to the code to include the mobs power/mana in the tooltip window. If there is a better way of doing this, please feel free to correct any mistakes in what I have done:

    Code:
    local a = CreateFrame("Frame")
    a:SetScript("OnEvent", function()
        if not UnitExists("mouseover") then return end
        local uh, uhm = UnitHealth("mouseover"), UnitHealthMax("mouseover")
        local upp, uppm = UnitPower("mouseover"), UnitPowerMax("mouseover")
        local pt = {[0] = "Mana", [1] = "Rage", [2] = "Focus", [3] = "Energy", [4] = "Happiness", [5] = "Runes", [6] = "Runic Power", [7] = "Soul Shards", [8] = "Eclipse", [9] = "Holy Power"}
        local upt = UnitPowerType("mouseover")
        GameTooltip:AddDoubleLine("Health", short(uh).."/"..short(uhm).." ("..round(uh/uhm*100,1).."%)", 1,0.82,0, 1,1,1)
        if uppm > 0 then
        		GameTooltip:AddDoubleLine(pt[upt], short(upp).."/"..short(uppm).." ("..round(upp/uppm*100,1).."%)", 0.5,0.5ss,1, 1,1,1)
        end
        GameTooltip:Show()
    end)
    a:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
    Note that this is to be added to the code provided by Treeston that adds health info to the mob frame.
    Thanks!

  17. #37
    Deleted
    Move the local pt declaration outside the function (to the top).

  18. #38
    Thanks for the advice, was wondering why the memory requirement went up as much as it did.

    I have some background in programming but I am pretty new to LUA.

    Thanks for helping out!

    Code:
    local a = CreateFrame("Frame")
    local pt = {[0] = "Mana", [1] = "Rage", [2] = "Focus", [3] = "Energy", [4] = "Happiness", [5] = "Runes", [6] = "Runic Power", [7] = "Soul Shards", [8] = "Eclipse", [9] = "Holy Power"}
    a:SetScript("OnEvent", function()
        if not UnitExists("mouseover") then return end
        local uh, uhm = UnitHealth("mouseover"), UnitHealthMax("mouseover")
        local upp, uppm = UnitPower("mouseover"), UnitPowerMax("mouseover")
        local upt = UnitPowerType("mouseover")
        GameTooltip:AddDoubleLine("Health", short(uh).."/"..short(uhm).." ("..round(uh/uhm*100,1).."%)", 1,0.82,0, 1,1,1)
        if uppm > 0 then
        		GameTooltip:AddDoubleLine(pt[upt], short(upp).."/"..short(uppm).." ("..round(upp/uppm*100,1).."%)", 0.5,0.5ss,1, 1,1,1)
        end
        GameTooltip:Show()
    end)
    a:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
    Last edited by Neema; 2011-02-12 at 08:56 PM.

  19. #39
    Deleted
    You were basically re-creating the table every time your mouseover changed. Table creation is pretty hefty in Lua memory-wise.

  20. #40
    I'm using your code Treeston and it's working like a charm , thank you , except for one little thing :

    The mana value of people who are out of range and therefor not 'cached' is always around 25k , while the HP are immediatly shown correctly . Is this intended by Blizzard or can you update your Code ? Because MobInfo / MobHealth displayed the correct mana value in the past immediatly , regardless of the inspect range .

    Oh , I'm using the german client , don't know if it makes any difference .

Posting Permissions

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