Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions targetbot/looting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ TargetBot.Looting.setup = function()
ui = UI.createWidget("TargetBotLootingPanel")
UI.Container(TargetBot.Looting.onItemsUpdate, true, nil, ui.items)
UI.Container(TargetBot.Looting.onContainersUpdate, true, nil, ui.containers)
UI.Separator()
UI.Label("Loot Blacklist (creature1,creature2):")
UI.TextEdit(table.concat(storage.blacklist, ","), function(_, text)
storage.blacklist = {}
for _, creature in ipairs(string.split(text, ",")) do
table.insert(storage.blacklist, creature)
end
end)
UI.Separator()
ui.everyItem.onClick = function()
ui.everyItem:setOn(not ui.everyItem:isOn())
TargetBot.save()
Expand Down Expand Up @@ -302,6 +311,11 @@ onCreatureDisappear(function(creature)
local pos = player:getPosition()
local mpos = creature:getPosition()
local name = creature:getName()

for _, v in ipairs(storage.blacklist) do
if name == v then return end
end

if pos.z ~= mpos.z or math.max(math.abs(pos.x-mpos.x), math.abs(pos.y-mpos.y)) > 6 then return end
schedule(20, function() -- check in 20ms if there's container (dead body) on that tile
if not containers[1] then return end
Expand Down