Skip to content

vBot looting blacklist#78

Open
divinity76 wants to merge 4 commits intoOTAcademy:masterfrom
divinity76:vbot-looting-blacklist
Open

vBot looting blacklist#78
divinity76 wants to merge 4 commits intoOTAcademy:masterfrom
divinity76:vbot-looting-blacklist

Conversation

@divinity76
Copy link
Copy Markdown
Collaborator

@divinity76 divinity76 commented Jan 10, 2026

When "loot every item" is off, it will loot everything in the loot list.

When "loot every item" is on, it will loot everything that is not in the loot list, effectively making the loot list a blacklist when "loot every item" is on.

This allows you to loot all the super-rare items you don't have the id for, or don't even know exist.

Related upstream issue: Vithrax/vBot#15

I have tried submitting this upstream too, but it seems vBot upstream is unmaintained: Vithrax/vBot#18

When "loot every item" is off, it will loot everything in the loot list.

When "loot every item" is on, it will loot everything that is not in the loot list, effectively making the loot list a blacklist when "loot every item" is on.

Related upstream issue: Vithrax/vBot#15

I have tried submitting this upstream too, but it seems vBot upstream is unmaintained: Vithrax/vBot#18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds blacklist functionality to the vBot looting system. When the "Loot every item" toggle is enabled, it now functions as a blacklist mode - looting all items except those in the list, rather than the previous behavior of simply looting everything. This enables users to filter out unwanted items while automatically looting rare items they may not know exist.

Changes:

  • Modified the looting logic to treat the item list as a blacklist when "Loot every item" is enabled
  • Added dynamic label that changes between "Items to loot" (whitelist mode) and "Items to ignore" (blacklist mode)
  • Updated button text to indicate the blacklist functionality

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
modules/game_bot/default_configs/vBot_4.8/targetbot/looting.otui Added dynamic label for list purpose, updated button text to reflect blacklist mode, reduced font size to fit longer text
modules/game_bot/default_configs/vBot_4.8/targetbot/looting.lua Implemented blacklist logic, added label text updates in setup and update functions to reflect current mode

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +62 to +68
if ui.labelToLoot then
if ui.everyItem:isOn() then
ui.labelToLoot:setText("Items to ignore")
else
ui.labelToLoot:setText("Items to loot")
end
end
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic for updating the label text based on the everyItem toggle state is duplicated between the setup function (lines 17-23) and the update function (lines 62-68). Consider extracting this into a separate helper function like updateLabelText() to improve maintainability and reduce code duplication.

Copilot uses AI. Check for mistakes.
Comment on lines 21 to 24
!text: tr("Loot every item, except these")
margin-top: 2
font: small-9px

Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The font size has been reduced to small-9px to accommodate the longer button text. This smaller font size may impact readability and accessibility, particularly for users with visual impairments. Consider if the text can be made more concise to avoid needing a smaller font, or if the UI layout can be adjusted to accommodate the standard font size.

Suggested change
!text: tr("Loot every item, except these")
margin-top: 2
font: small-9px
!text: tr("Loot all except listed")
margin-top: 2

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The boolean logic on this line is complex and difficult to understand at a glance. Consider extracting this into a helper function with a descriptive name like shouldLootItem(item) or adding a comment explaining the two modes: whitelist mode (everyItem OFF - loot only items in list) and blacklist mode (everyItem ON - loot everything except items in list and containers).

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 20, 2026 04:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +17 to +23
if ui.labelToLoot then
if ui.everyItem:isOn() then
ui.labelToLoot:setText("Items to ignore")
else
ui.labelToLoot:setText("Items to loot")
end
end
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The label update logic is duplicated in the onClick handler and the update function. Consider extracting this into a separate function to improve maintainability and reduce code duplication. For example, create a function like updateLootLabel() that checks the state and updates the label text accordingly.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings March 4, 2026 11:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 240 to 242
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
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The looting condition is correct but hard to read/maintain as a single boolean expression with repeated lookups. Consider computing local flags (e.g., blacklistMode, isContainer, inList) and using a small if/else to decide whether to loot, so future changes don’t accidentally invert the logic.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants