Skip to content

Commit

Permalink
Update ControlBot.js
Browse files Browse the repository at this point in the history
- Use chantlist to check for parent during autochant
  • Loading branch information
theBGuy committed Dec 20, 2024
1 parent 925f513 commit d65929b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions d2bs/kolbot/libs/scripts/ControlBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ const ControlBot = new Runnable(
if (unit) {
do {
// merc or any other owned unit
if (unit.getParent() && unit.getParent().name === nick) {
let parent = unit.getParent();
if (!parent) continue;
if (parent.name === nick) {
Packet.enchant(unit);
delay(500);
}
Expand Down Expand Up @@ -455,7 +457,7 @@ const ControlBot = new Runnable(
if (unit) {
do {
if (unit.getParent()
&& chanted.includes(unit.getParent().name)
&& chantList.has(unit.getParent().name)
&& !unit.getState(sdk.states.Enchant)
&& unit.distance <= 40) {
Packet.enchant(unit);
Expand Down

0 comments on commit d65929b

Please sign in to comment.