Skip to content

Commit

Permalink
Update ControlBot.js
Browse files Browse the repository at this point in the history
- Add stop command to halt wp giving
  • Loading branch information
theBGuy committed Dec 25, 2024
1 parent 3a896ab commit cdc164f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion d2bs/kolbot/libs/scripts/ControlBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,10 +639,17 @@ const ControlBot = new Runnable(
*/
const giveWps = function (nick) {
let next = false;
let stop = false;
/**
* @param {string} who
* @param {string} msg
*/
const nextWatcher = function (who, msg) {
if (who !== nick) return;
if (msg === "next") {
next = true;
} else if (msg === "stop") {
stop = true;
}
};

Expand Down Expand Up @@ -671,7 +678,7 @@ const ControlBot = new Runnable(
addEventListener("chatmsg", nextWatcher);

for (let wp of wps.get(act)) {
if (checkHostiles()) {
if (stop || checkHostiles()) {
break;
}

Expand Down

0 comments on commit cdc164f

Please sign in to comment.