From 5fd2c17ec2c9cb4fb8a73d8f8e550a80b33327a9 Mon Sep 17 00:00:00 2001 From: p3lim Date: Tue, 28 Dec 2010 02:20:17 +0100 Subject: [PATCH] Use ITEM_PUSH instead, no need to search individual bags --- Automate.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Automate.lua b/Automate.lua index 11b235d..75ca9ad 100644 --- a/Automate.lua +++ b/Automate.lua @@ -59,15 +59,16 @@ addon:Register('QUEST_AUTOCOMPLETE', function() end end) -addon:Register('UNIT_INVENTORY_CHANGED', function(unit) - if(unit ~= 'player') then return end +addon:Register('ITEM_PUSH', function(bag) + -- This is some weird shit + if(bag > 0) then + bag = bag - CharacterBag0Slot:GetID() + 1 + end - for bag = 1, 5 do - for slot = 1, GetContainerNumSlots(bag) do - local _, id, active = GetContainerItemQuestInfo(bag, slot) - if(id and not active) then - UseContainerItem(bag, slot) - end + for slot = 1, GetContainerNumSlots(bag) do + local _, id, active = GetContainerItemQuestInfo(bag, slot) + if(id and not active) then + UseContainerItem(bag, slot) end end -end) \ No newline at end of file +end) -- 1.7.9.5