Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(2 Kb)
Download
Updated: 09-26-12 03:38 PM
Pictures
File Info
Compatibility:
Mists of Pandaria (5.0.4)
Updated:09-26-12 03:38 PM
Created:12-17-10 04:35 PM
Downloads:4,937
Favorites:52
MD5:
AiL
Version: 0.9.3
by: havoc74 [More]
Simply adds your average item level to your character frame, and adds other players' average item level to the tooltip.

*** NOTICE *** Version 0.9.1 may require you to actually click on your target to get correct results. This is a bug in Blizzard's API, sorry for the inconvenience.
12-30-2010: AiL-0.4: Bug Fix: While Inspect Frame is open, mousing over another player throws an exception. Thank you zaphon.

12-29-2010: AiL-0.3: Bug Fix: GetAiL() returning nil on a naked player unit. Thank you Krellmax and zaphon.

6-13-2012: AiL-0.6: As per comment requests, I updated AiL to update the Character Frame when an item is swapped with another. Also, as far as I can tell, the Transmog doesn't affect the addon in any way. All tests on self and other players proved to be accurate. Thank you again for the comments, and again, I apologize for not updating this addon more frequently.

6-13-2012: AiL-0.7: Quick Bug Fix - iLevel reporting as nil at load.

7-20-2012: AiL-0.8: Responded to a request to remove the "AiL -VERSION- Loaded." Chat Frame Notification.

9-1-2012: AiL-0.9: Updated to MoP Pre-Release patch 5.0.4.

9-7-2012: AiL-0.9.1: Using Skarj's suggestion, AiL works, but you may have to actually click on your target to get correct results.

9-23-2012: AiL-0.9.2: Fixed the issue of not being able to inspect a unit if AiL is enabled.

9-26-2012: AiL-0.9.3: Removed the un-needed Character Frame. This also eliminated an LUA error on showing the Character Frame.
Optional Files (0)


Archived Files (1)
File Name
Version
Size
Author
Date
 AiL
0.9.2
2kB
havoc74
09-23-12 11:26 AM


Post A Reply Comment Options
Unread 01-18-13, 09:31 AM  
Tomate
A Defias Bandit
 
Tomate's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 252
Uploads: 4
I have made an updated version of AiL which works much better than the current version. It still need some tweaking but the value display seams to be correct.
This version correct issue with Transmo and upgraded items.
In addition to that, ilvl is displayed with two decimal places.
Lua Code:
  1. local MINCOLOR = 0.5
  2. local COLORINC = 0.2
  3. local INCMOD = 0.5
  4. local MinIL = 463
  5. local MaxIL = 580
  6.  
  7. local slotName = {
  8.     "HeadSlot","NeckSlot","ShoulderSlot","BackSlot","ChestSlot","WristSlot",
  9.     "HandsSlot","WaistSlot","LegsSlot","FeetSlot","Finger0Slot","Finger1Slot",
  10.     "Trinket0Slot","Trinket1Slot","MainHandSlot","SecondaryHandSlot"
  11. }
  12.  
  13. -- Construct your saarch pattern based on the existing global string:)
  14. local S_ITEM_LEVEL   = "^" .. gsub(ITEM_LEVEL, "%%d", "(%%d+)")
  15. -- Create the tooltip:
  16. local scantip = CreateFrame("GameTooltip", "MyScanningTooltip", nil, "GameTooltipTemplate")
  17. scantip:SetOwner(UIParent, "ANCHOR_NONE")
  18.  
  19. local function GetAiL(unit)
  20.     i = 0
  21.     total = 0
  22.     itn = 0
  23.    
  24.     if unit ~= nil then
  25.         for i in ipairs(slotName) do
  26.             itemLink = GetInventoryItemLink(unit, GetInventorySlotInfo(slotName[i]));
  27.            
  28.             if itemLink ~= nil then
  29.                 -- Pass the item link to the tooltip:
  30.                 scantip:SetHyperlink(itemLink)
  31.  
  32.                 -- Scan the tooltip:
  33.                 for i = 2, scantip:NumLines() do -- Line 1 is always the name so you can skip it.
  34.                     local text = _G["MyScanningTooltipTextLeft"..i]:GetText()
  35.                     if text and text ~= "" then
  36.                         local currentUpgradedItemLevel = strmatch(text, S_ITEM_LEVEL)
  37.                         if currentUpgradedItemLevel then
  38.                             itn = itn + 1
  39.                             total = total + currentUpgradedItemLevel
  40.                         end
  41.                     end
  42.                 end
  43.             end
  44.         end
  45.     end
  46.  
  47.     if total < 1 or itn < 1 then
  48.         return 0
  49.     end
  50.  
  51.     return (total / itn)
  52. end
  53.  
  54. local function GetAiLColor(ail)
  55.     local r, gb
  56.    
  57.     if ail < MinIL then
  58.         r = (ail / MinIL)
  59.         gb = r
  60.     else
  61.         r = MINCOLOR + ((ail / MaxIL) * INCMOD)
  62.         gb = 1.0 - ((ail / MaxIL) * INCMOD)
  63.     end
  64.    
  65.     if r < MINCOLOR then
  66.         r = MINCOLOR
  67.         gb = r
  68.     end
  69.    
  70.     return r, gb
  71. end
  72.  
  73.  
  74.  
  75.  
  76. local function Setup()
  77.     local tooltipGuid
  78.     local tooltipUnit
  79.    
  80.     GameTooltip:HookScript("OnTooltipSetUnit", function(self, ...)
  81.         local ail, r, gb
  82.         local _, unit = GameTooltip:GetUnit()
  83.         tooltipUnit = unit
  84.         tooltipGuid = UnitGUID(unit)
  85.         if (unit and CanInspect(unit)) then
  86.             local isInspectOpen = (InspectFrame and InspectFrame:IsShown()) or (Examiner and Examiner:IsShown())
  87.             if unit and CanInspect(unit) and not isInspectOpen then
  88.                 NotifyInspect(unit)
  89.             end
  90.         end
  91.     end)
  92.    
  93.    
  94.     AiLFrame = CreateFrame("Frame", nil, CharacterModelFrame);
  95.     AiLFrame.s = AiLFrame:CreateFontString(nil, "OVERLAY");
  96.     AiLFrame.s:SetPoint("TOPRIGHT", CharacterModelFrame, "TOPRIGHT", -2, -2);
  97.     AiLFrame.s:SetJustifyH("RIGHT");
  98.     AiLFrame.s:SetFontObject(GameFontNormal);
  99.     AiLFrame:RegisterEvent("UNIT_INVENTORY_CHANGED");
  100.     AiLFrame:RegisterEvent("INSPECT_READY")
  101.     AiLFrame:SetScript("OnEvent", function(self, event, unit)
  102.         if (event == "UNIT_INVENTORY_CHANGED") then
  103.             AiLFrame.s:SetText(format("AiL: " .. string.format("%0.2f", GetAiL("player"))));
  104.         end
  105.         if (event == "INSPECT_READY") then
  106.             if unit == tooltipGuid then
  107.                 ail = GetAiL(tooltipUnit)
  108.                 if ail ~= 0 then
  109.                     r, gb = GetAiLColor(floor(ail))
  110.                     ClearInspectPlayer()
  111.                     GameTooltip:AddLine(format("AiL: " .. string.format("%0.2f", ail)), r, gb, gb)
  112.                     GameTooltip:Show()
  113.                 end
  114.             end
  115.         end
  116.     end);
  117.     AiLFrame:Show();
  118.  
  119.     CharacterModelFrame:HookScript("OnShow", function(self)
  120.         AiLFrame.s:SetText(format("AiL: " .. string.format("%0.2f", GetAiL("player"))))
  121.     end)
  122.    
  123.     local VERSION = GetAddOnMetadata("AiL", "Version");
  124.     DEFAULT_CHAT_FRAME:AddMessage("NOTICE: AiL " .. VERSION .. " sometimes requires you to click on your target for the correct results");
  125. end
  126.  
  127. Setup()

LAST UPDATE 05-12-2014
Last edited by Tomate : 05-12-14 at 12:28 PM.
Tomate is offline Report comment to moderator  
Reply With Quote
Unread 11-03-12, 06:01 AM  
havoc74
A Kobold Labourer
 
havoc74's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 32
Uploads: 4
Re: False read

Originally Posted by draconisaerius
Addon seems to be counting either shirt or tabard as well somehow. My mate is all epics except for 2 heroic dungeon items but it says he is 416 ilvl.
Did you try clicking on your friend? This is an issue with Blizzard, sometime you have to click on the unit after you mouse-over. If it still doesn't work, I look into it, but I can't promise anything. At least not until Blizzard fixes their API.
__________________
havoc74
Taerion of Hydraxis (Nelf Blood DK)
havoc74 is offline Report comment to moderator  
Reply With Quote
Unread 10-25-12, 03:11 AM  
draconisaerius
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
False read

Addon seems to be counting either shirt or tabard as well somehow. My mate is all epics except for 2 heroic dungeon items but it says he is 416 ilvl.
Last edited by draconisaerius : 10-25-12 at 03:11 AM.
draconisaerius is offline Report comment to moderator  
Reply With Quote
Unread 09-26-12, 03:34 PM  
havoc74
A Kobold Labourer
 
havoc74's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 32
Uploads: 4
Re: Re: New Error

Originally Posted by siweia
Why not delete the function that show player's item level on the topright of the character frame?
It probably the reason why the error occurs. I deleted it, because you can see your item level on the character stats frame, and I didn't get the error.
That's not a bad idea. There's really no point in having it in the Character Frame anymore since Blizzard is providing both equipped and bagged Average Item Levels. I think I will post another version reflecting your idea. Good suggestion! TY
__________________
havoc74
Taerion of Hydraxis (Nelf Blood DK)
havoc74 is offline Report comment to moderator  
Reply With Quote
Unread 09-26-12, 03:17 AM  
siweia
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 18
File comments: 39
Uploads: 4
Re: New Error

Originally Posted by havoc74
Okay, since I fixed the last issue, a new issue has risen for me at least.

When I now open my character Pane, I get an LUA error, anyone else having this issue?

I'm going to wait till after MoP releases, most likely there will be other issues along with that, but let me know if anyone else is experiencing the same thing.
Why not delete the function that show player's item level on the topright of the character frame?
It probably the reason why the error occurs. I deleted it, because you can see your item level on the character stats frame, and I didn't get the error.
Last edited by siweia : 09-26-12 at 03:20 AM.
siweia is offline Report comment to moderator  
Reply With Quote
Unread 09-25-12, 06:02 AM  
Maxen
A Deviate Faerie Dragon

Forum posts: 17
File comments: 221
Uploads: 0
Yup, getting that error too!
Maxen is offline Report comment to moderator  
Reply With Quote
Unread 09-24-12, 06:50 PM  
havoc74
A Kobold Labourer
 
havoc74's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 32
Uploads: 4
New Error

Okay, since I fixed the last issue, a new issue has risen for me at least.

When I now open my character Pane, I get an LUA error, anyone else having this issue?

I'm going to wait till after MoP releases, most likely there will be other issues along with that, but let me know if anyone else is experiencing the same thing.
__________________
havoc74
Taerion of Hydraxis (Nelf Blood DK)
Last edited by havoc74 : 09-24-12 at 06:53 PM.
havoc74 is offline Report comment to moderator  
Reply With Quote
Unread 09-23-12, 11:57 AM  
muek
A Kobold Labourer

Forum posts: 1
File comments: 12
Uploads: 0
Re: Re: Re: not able to inspect

its working now thanks
Last edited by muek : 09-23-12 at 01:00 PM.
muek is offline Report comment to moderator  
Reply With Quote
Unread 09-23-12, 11:27 AM  
havoc74
A Kobold Labourer
 
havoc74's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 32
Uploads: 4
Re: Re: not able to inspect

Originally Posted by havoc74
Originally Posted by muek
Hi im getting a interesting bug happening when ail is enabled, i cant inspect other people, i tried this with just ail enable and same result once i disable ail the inspect window pops up as expected. Theres no error message it just doesnt show
Yeah, your right, my apologies, I'll look into this right away, thank you for posting
Should be fixed now, let me know if it still doesn't work for you. Thanks again for pointing this out to me.
__________________
havoc74
Taerion of Hydraxis (Nelf Blood DK)
havoc74 is offline Report comment to moderator  
Reply With Quote
Unread 09-23-12, 11:19 AM  
havoc74
A Kobold Labourer
 
havoc74's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 32
Uploads: 4
Re: not able to inspect

Originally Posted by muek
Hi im getting a interesting bug happening when ail is enabled, i cant inspect other people, i tried this with just ail enable and same result once i disable ail the inspect window pops up as expected. Theres no error message it just doesnt show
Yeah, your right, my apologies, I'll look into this right away, thank you for posting
__________________
havoc74
Taerion of Hydraxis (Nelf Blood DK)
havoc74 is offline Report comment to moderator  
Reply With Quote
Unread 09-18-12, 05:05 PM  
muek
A Kobold Labourer

Forum posts: 1
File comments: 12
Uploads: 0
not able to inspect

Hi im getting a interesting bug happening when ail is enabled, i cant inspect other people, i tried this with just ail enable and same result once i disable ail the inspect window pops up as expected. Theres no error message it just doesnt show
muek is offline Report comment to moderator  
Reply With Quote
Unread 09-12-12, 04:12 PM  
havoc74
A Kobold Labourer
 
havoc74's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 32
Uploads: 4
Originally Posted by Maxen
If I'm not mistaken, Blizzard does calculate both equipped avg ilvl and avg ilvl of your best gears (includin gears in bags).
You may absolutely be correct, I honestly don't know for sure, but all my tests (some of which were click-on-target) were accurate. I really do hope Blizzard fixes the API calls though, it's a pain in the butt when your used to just mouse-over...
__________________
havoc74
Taerion of Hydraxis (Nelf Blood DK)
havoc74 is offline Report comment to moderator  
Reply With Quote
Unread 09-11-12, 06:42 PM  
Maxen
A Deviate Faerie Dragon

Forum posts: 17
File comments: 221
Uploads: 0
If I'm not mistaken, Blizzard does calculate both equipped avg ilvl and avg ilvl of your best gears (includin gears in bags).
Maxen is offline Report comment to moderator  
Reply With Quote
Unread 09-11-12, 04:52 PM  
havoc74
A Kobold Labourer
 
havoc74's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 32
Uploads: 4
Originally Posted by Venives
I'm still having the wrong result on transmogrified people.
AiL's algorithm average's equipped gear only, so if your asking a friend what their average item level is and then comparing it to AiL's it *will* be different. Blizzard's average item level includes gear in bags as well, unless they changed that part of their API. If your getting an obvious incorrect value, like 25 or something under 200 for a level 85 toon, then try clicking on that target. If it's still reporting incorrect values then we will have to wait for Blizzard to fix that, it is not a bug in AiL.
__________________
havoc74
Taerion of Hydraxis (Nelf Blood DK)
havoc74 is offline Report comment to moderator  
Reply With Quote
Unread 09-09-12, 08:39 AM  
Venives
A Kobold Labourer

Forum posts: 0
File comments: 3
Uploads: 0
I'm still having the wrong result on transmogrified people.
Venives is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: