View Single Post
10-27-14, 06:29 AM   #1
Shenj
A Murloc Raider
Join Date: Feb 2011
Posts: 5
Exclamation AutoLootFix for 6.0

Hey, im not sure if a lot of people know but there has been a bug in the autoloot in WoW for a very long time where sometimes it would not actually autoloot and AutoLootFix fixed this bug, but in 6.0 the way AutoLoot works has changed and this Addon is no longer working as intended

It's a fairly basic Addon and I hope someone can look into how to make it work, sadly while the "click more than once causes autoloot to be disabled" bug has kinda been fixed, sometimes it will still not autoloot which makes it a bit harder to reproduce but it happens pretty often for me at the very least.

In LootFrame.lua of Blizzards Loot Frame AutoLoot now looks like this.

Lua Code:
  1. ...
  2.     if ( event == "LOOT_OPENED" ) then
  3.         local autoLoot = ...;
  4.         if( autoLoot == 1 ) then
  5.             LootFrame_InitAutoLootTable( self );
  6.             LootFrame:SetScript("OnUpdate", LootFrame_OnUpdate);
  7.             self.AutoLootDelay = LOOTFRAME_AUTOLOOT_DELAY;
  8.         else
  9.             self.AutoLootDelay = 0;
  10.             self.AutoLootTable = nil;
  11.         end
  12.        
  13.         self.page = 1;
  14.         LootFrame_Show(self);
  15.         if ( not self:IsShown()) then
  16.             CloseLoot(autoLoot == 0);   -- The parameter tells code that we were unable to open the UI
  17.         end
  18.     elseif( event == "LOOT_READY" ) then
  19.         LootFrame_InitAutoLootTable( self );
  20.     ...

In AutoLootFix it's this:
Lua Code:
  1. f:SetScript("OnEvent", function(self, event, ...)
  2.     if event == "PLAYER_ENTERING_WORLD" then
  3.         UpdateAutoLootStatus(GetCVar"autoLootDefault")
  4.     elseif event == "CVAR_UPDATE" then
  5.         local glStr, value = ...
  6.         if glStr == "AUTO_LOOT_DEFAULT_TEXT" then
  7.             UpdateAutoLootStatus(value)
  8.         end
  9.     elseif event == "LOOT_OPENED" then
  10.         if not IsAutoLootKeyDown() then
  11.         --  HideUIPanel(LootFrame)
  12.         end
  13.         local shouldAutoLoot = ...
  14.         if shouldAutoLoot == 0 and not IsAutoLootKeyDown() then
  15.             --print"autoLoot bugged" < This still triggers when autoloot fails
  16.             for i = 1, GetNumLootItems() do
  17.                 LootSlot(i)    
  18.             end
  19.         end
  20.     end
  21. end)

The Addon still triggers fine but the following no longer applies and needs to be changed, sadly i have no damn clue how to make it work as simple as it may be.
Lua Code:
  1. for i = 1, GetNumLootItems() do
  2.                 LootSlot(i)    
  3.             end
  4.         end

For now i replaced the whole addon with this, disabled AutoLoot and AutoLoot key in the Interface and instead use this autoloot, it works but i'd like something that's less hacky
Lua Code:
  1. local f = CreateFrame"Frame"
  2. f:RegisterEvent"LOOT_OPENED"
  3.  
  4. f:SetScript("OnEvent", function(self, event, ...)
  5.     if event == "LOOT_OPENED" and not IsAltKeyDown() then
  6.         for i = 1, GetNumLootItems() do
  7.             LootSlot(i)
  8.         end
  9.     end
  10. end)

Last edited by Shenj : 11-03-14 at 06:34 PM.
  Reply With Quote