Implement some sort of basic filtering/looting
This commit is contained in:
16
Autoloot.lua
16
Autoloot.lua
@@ -116,6 +116,11 @@ function shared.Autoloot.Init()
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
---@type Filter[]
|
||||||
|
local Filters = {
|
||||||
|
GoldFilter,
|
||||||
|
}
|
||||||
|
|
||||||
-- _ ___ ___ _____ _ ___ ____ ___ ____
|
-- _ ___ ___ _____ _ ___ ____ ___ ____
|
||||||
-- | | / _ \ / _ \_ _| | | / _ \ / ___|_ _/ ___|
|
-- | | / _ \ / _ \_ _| | | / _ \ / ___|_ _/ ___|
|
||||||
-- | | | | | | | | || | | | | | | | | _ | | |
|
-- | | | | | | | | || | | | | | | | | _ | | |
|
||||||
@@ -127,9 +132,14 @@ function shared.Autoloot.Init()
|
|||||||
lootReadyFrame:SetScript("OnEvent", function()
|
lootReadyFrame:SetScript("OnEvent", function()
|
||||||
local lootInfo = GetLootInfo()
|
local lootInfo = GetLootInfo()
|
||||||
shared.DumpTable(lootInfo, 0)
|
shared.DumpTable(lootInfo, 0)
|
||||||
for _, loot in ipairs(lootInfo) do
|
|
||||||
if loot.locked then
|
for slot = #lootInfo, 1, -1 do
|
||||||
Name(loot.item)
|
for _, filter in ipairs(Filters) do
|
||||||
|
if filter.Matches(slot) then
|
||||||
|
print(string.format("Autolooting slot %s", tostring(slot)))
|
||||||
|
shared.DumpTable(filter, 0)
|
||||||
|
LootSlot(slot)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--aura_env.FilterService.Run(lootInfo)
|
--aura_env.FilterService.Run(lootInfo)
|
||||||
|
Reference in New Issue
Block a user