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
8 changes: 6 additions & 2 deletions Core/MultiBot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1429,8 +1429,12 @@ function MultiBot.SyncBridgeRosterToPlayers(roster)
local _, playerClassToken = UnitClass("player")
local playerClass = MultiBot.toClass(playerClassToken or "UNKNOWN")
local selfButton = MultiBot.addSelf(playerClass, playerName)
if selfButton and selfButton.setDisable then
selfButton.setDisable()
if selfButton then
if selfButton.setDisable then selfButton.setDisable() end
selfButton.doLeft = function(pButton)
SendChatMessage(".playerbot bot self", "SAY")
MultiBot.OnOffSwitch(pButton)
end
end
Comment on lines +1432 to 1438

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check call sites of SyncBridgeRosterToPlayers
rg -n 'SyncBridgeRosterToPlayers' --type lua -g '!**/test/**'

# Check if selfbot active state is tracked in bridge roster or elsewhere
rg -n 'IsBridgeRosterBotActive\|SelfBot\|selfBot\|self_bot' --type lua -C3

Repository: Wishmaster117/MultiBot-Chatless

Length of output: 169


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the relevant file and nearby symbols.
git ls-files 'Core/MultiBot.lua'
wc -l Core/MultiBot.lua
rg -n 'SyncBridgeRosterToPlayers|OnOffSwitch|IsBridgeRosterBotActive|setDisable|setEnable|doLeft' Core/MultiBot.lua -n -C 4

# Inspect the function body around the cited lines.
sed -n '1408,1485p' Core/MultiBot.lua

# Find any bridge roster/selfbot state tracking elsewhere in the repo.
rg -n 'IsBridgeRosterBotActive|SyncBridgeRosterToPlayers|selfbot|self bot|selfBot|self_bot|bridge roster|bot self' .

Repository: Wishmaster117/MultiBot-Chatless

Length of output: 9383


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the active-state helper and self-button construction.
sed -n '1288,1375p' Core/MultiBot.lua
sed -n '1510,1615p' Core/MultiBot.lua
sed -n '1760,1845p' Core/MultiBot.lua

# Show the specific toggle handler used by the self button.
rg -n 'function MultiBot\.OnOffSwitch|OnOffSwitch\s*=' Core/MultiBot.lua Core/MultiBotHandler.lua Core/MultiBotEngine.lua -n -C 6

Repository: Wishmaster117/MultiBot-Chatless

Length of output: 8299


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the self-button constructor and any state initialization it performs.
rg -n 'function MultiBot\.addSelf|addSelf\s*=' Core/MultiBot.lua Core/MultiBotEngine.lua -n -C 8
sed -n '1980,2085p' Core/MultiBotEngine.lua

# Re-read the toggle helper for exact state behavior.
sed -n '834,845p' Core/MultiBotEngine.lua

Repository: Wishmaster117/MultiBot-Chatless

Length of output: 5278


Sync the self button with the current selfbot state. SyncBridgeRosterToPlayers always calls setDisable() for selfButton, while the roster buttons mirror IsBridgeRosterBotActive(...). If the selfbot is already active, the button still renders disabled and a click can toggle the command while the UI flips the wrong way. Use the same active-state source here and call setEnable()/setDisable() accordingly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Core/MultiBot.lua` around lines 1432 - 1438, The self button handling in
MultiBot.OnOffSwitch is not synced to the actual selfbot active state, so it can
be disabled even when the selfbot is already active. Update the selfButton setup
to use the same state source as the roster buttons (the active-state check used
by SyncBridgeRosterToPlayers and IsBridgeRosterBotActive), and switch between
setEnable() and setDisable() accordingly before assigning doLeft. This keeps the
self button UI aligned with the current selfbot state and prevents the toggle
behavior from flipping the wrong way.

end

Expand Down