1. #1

    Broker Alt Item Level

    I'm hoping someone knows of or could make a simple addon for me.

    I use Chocolate Bar with a variety of Broker plug ins, the only thing I'm missing is a plug in that shows the Item level of my alts.

    I don't need anything really fancy, just something that will display a tool tip with Chocolate Bar showing my Characters Names and their Equiped/Max Item level.

    If this is possible great if not thanks for reading.

  2. #2

  3. #3
    Haha, that's the thread I started a few months ago before taking a break.

    Unfortunately it doesn't seem to work. Doing everything the way it's listed doesn't show anything in game. The add on shows up in menus and such, but doesn't actually show any information.

  4. #4
    Quote Originally Posted by Panacia View Post
    Quote Originally Posted by Kurkon View Post
    Haha, that's the thread I started a few months ago before taking a break.

    Unfortunately it doesn't seem to work. Doing everything the way it's listed doesn't show anything in game. The add on shows up in menus and such, but doesn't actually show any information.
    I tried to fix up only the bare essentials of Choonster's code
    Although probably Treeston, or someone else, will actually write up something way cleaner than that

    Some notes about the original code:
    • He could also do it without using Ace3
    • The event should've been UNIT_INVENTORY_CHANGED instead of UNIT_INVENTORY_UPDATE
    • The original dataobj table reference was disposed of, because it was reassigned to LibStub("AceAddon-3.0").NewAddon, and then OnTooltipShow was added to that table instead. That's why it showed up in Data Display addons, while not doing anything
    • There is no embeding of LibDataBroker in the .toc file. If this code actually works, then some other addon which embeds LibDataBroker, was loaded before your code

    Again, probably someone else will come in, and write up something more .. cleaner and/or provide you a zip/addon with LibDataBroker embeded

    Code:
    local ILVL_FORMAT = "%d(E)/%d(T)"
    local PLAYER_NAME;
    local SERVER_NAME;
    
    local addon, dataobj = ...
    dataobj.type = "data source"
    dataobj.text = ""
    
    LibStub("LibDataBroker-1.1"):NewDataObject(addon, dataobj)
    local AIL = LibStub("AceAddon-3.0"):NewAddon(addon, "AceEvent-3.0")
    
    function AIL:OnInitialize()
    	self.db = LibStub("AceDB-3.0"):New(addon .. "DB")
    end
    
    function AIL:OnEnable()
    	self:RegisterEvent("PLAYER_ENTERING_WORLD")
    	self:RegisterEvent("UNIT_INVENTORY_CHANGED", "Update")
    end
    
    function AIL:PLAYER_ENTERING_WORLD(event)
    	PLAYER_NAME = UnitName("player")
    	SERVER_NAME = GetRealmName()
    	self:UnregisterEvent(event)
    	self:Update(nil, "player")
    end
    
    function AIL:Update(event, unit)
    	if unit ~= "player" then return end
    	local ilvl, ilvlEquipped = GetAverageItemLevel()
    	self.db.realm[PLAYER_NAME] = self.db.realm[PLAYER_NAME] or {}
    	self.db.realm[PLAYER_NAME].ilvl = ilvl
    	self.db.realm[PLAYER_NAME].ilvlEq = ilvlEquipped
    	dataobj.text = ILVL_FORMAT:format(ilvlEquipped, ilvl)
    end
    
    function dataobj:OnTooltipShow()
    	self:AddLine(SERVER_NAME)
    	for name, data in pairs(AIL.db.realm) do
    		self:AddDoubleLine(name, ILVL_FORMAT:format(data.ilvlEq, data.ilvl),  1, 1, 1,  1, 1, 1)
    	end
    end
    Last edited by Ketho; 2012-06-26 at 03:45 AM.

  5. #5
    Thank you for the input I'll try it again and see how it goes.

    Just wish I understood the coding basics so I could just make the addon myself.


    I tried with the new code posted by Ketho, still nothing showing up. However it does appear in my list of Addons in game.

    Any suggestions or help would be awesome.
    Last edited by Kurkon; 2012-06-26 at 04:27 AM.

  6. #6
    Deleted
    Quote Originally Posted by Kurkon View Post
    Haha, that's the thread I started a few months ago before taking a break.

    Unfortunately it doesn't seem to work. Doing everything the way it's listed doesn't show anything in game. The add on shows up in menus and such, but doesn't actually show any information.
    Oh, whoops

  7. #7
    If anyone else in interested an addon author on wowinterface.com put together the addon for me.


    http://www.wowinterface.com/download...o.php?id=21173


    here it is if anyone else is interested

Posting Permissions

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