Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

looting blacklist #881

Merged
merged 8 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion mods/game_bot/default_configs/vBot_4.8/targetbot/looting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ TargetBot.Looting.setup = function()
UI.Container(TargetBot.Looting.onContainersUpdate, true, nil, ui.containers)
ui.everyItem.onClick = function()
ui.everyItem:setOn(not ui.everyItem:isOn())
if ui.everyItem:isOn() then
ui.labelToLoot:setText("Items to ignore")
else
ui.labelToLoot:setText("Items to loot")
end
TargetBot.save()
end
ui.maxDangerPanel.value.onTextChange = function()
Expand Down Expand Up @@ -224,7 +229,7 @@ TargetBot.Looting.lootContainer = function(lootContainers, container)
for i, item in ipairs(container:getItems()) do
if item:isContainer() and not itemsById[item:getId()] then
nextContainer = item
elseif itemsById[item:getId()] or (ui.everyItem:isOn() and not item:isContainer()) then
elseif (not ui.everyItem:isOn() and itemsById[item:getId()]) or (ui.everyItem:isOn() and (not item:isContainer() and not itemsById[item:getId()])) then
item.lootTries = (item.lootTries or 0) + 1
if item.lootTries < 5 then -- if can't be looted within 0.5s then skip it
return TargetBot.Looting.lootItem(lootContainers, item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ TargetBotLootingPanel < Panel

BotSwitch
id: everyItem
!text: tr("Loot every item")
!text: tr("Loot every item, except these")
margin-top: 2
font: small-9px

Label
margin-top: 5
Expand Down
Loading