From b47c01a48146db3ca67ebd28476dfa0ff22cd96a Mon Sep 17 00:00:00 2001 From: Jesse Michelsen Date: Tue, 7 Jan 2020 13:56:22 -0700 Subject: [PATCH 1/7] Add SealOrder handling to Diablo.js SealOrder is checked to see if a specific order has been defined. The default order is the old order, viz/seis/infector. If a user defined order is in place, that order is followed. The order is respected even if less than three seals are listed. If Diablo is not found, all the seals are checked in the default order. --- d2bs/kolbot/libs/bots/Diablo.js | 65 ++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/d2bs/kolbot/libs/bots/Diablo.js b/d2bs/kolbot/libs/bots/Diablo.js index 5f16fe823..c0047216c 100644 --- a/d2bs/kolbot/libs/bots/Diablo.js +++ b/d2bs/kolbot/libs/bots/Diablo.js @@ -2,6 +2,7 @@ * @filename Diablo.js * @author kolton * @desc clear Chaos Sanctuary and kill Diablo +* @return {boolean} */ function Diablo() { @@ -235,6 +236,7 @@ function Diablo() { }; this.infectorSeal = function () { + Precast.doPrecast(true); print("Inf layout " + this.infLayout); this.followPath(this.infLayout === 1 ? this.starToInfA : this.starToInfB); @@ -259,10 +261,34 @@ function Diablo() { return true; }; + const openSeals = (sealOrder) => { + print("seal order: " + sealOrder); + let seals = { + 1: () => this.vizierSeal(), + 2: () => this.seisSeal(), + 3: () => this.infectorSeal(), + "vizier": () => this.vizierSeal(), + "seis": () => this.seisSeal(), + "infector": () => this.infectorSeal(), + }; + sealOrder.forEach(seal => {seals[seal]()}); + }; + this.diabloPrep = function () { var trapCheck, tick = getTickCount(); + switch (me.classid) { + case 1: + Pather.moveTo(7792, 5294); + + break; + default: + Pather.moveTo(7788, 5292); + + break; + } + while (getTickCount() - tick < 30000) { if (getTickCount() - tick >= 8000) { switch (me.classid) { @@ -431,7 +457,7 @@ function Diablo() { Pather.useWaypoint(107); } - if (!Pather.moveTo(7790, 5544)) { + if (!Pather.moveTo(7790, 5544, 5, Config.ClearPath)) { throw new Error("Failed to move to Chaos Sanctuary"); } @@ -439,7 +465,7 @@ function Diablo() { if (Config.Diablo.Entrance) { Attack.clear(30, 0, false, this.sort); - Pather.moveTo(7790, 5544); + Pather.moveTo(7790, 5544, 3, Config.ClearPath); if (Config.PublicMode) { Pather.makePortal(); @@ -447,16 +473,16 @@ function Diablo() { Pather.teleport = !Config.Diablo.WalkClear && Pather._teleport; } - Pather.moveTo(7790, 5544); + Pather.moveTo(7790, 5544, 5, Config.ClearPath); Precast.doPrecast(true); Attack.clear(30, 0, false, this.sort); this.followPath(this.entranceToStar); } else { - Pather.moveTo(7774, 5305); + Pather.moveTo(7774, 5305, 5, Config.ClearPath); Attack.clear(15, 0, false, this.sort); } - Pather.moveTo(7791, 5293); + Pather.moveTo(7791, 5293, 5, Config.ClearPath); if (Config.PublicMode) { Pather.makePortal(); @@ -465,28 +491,23 @@ function Diablo() { } Attack.clear(30, 0, false, this.sort); - this.vizierSeal(); - this.seisSeal(); - Precast.doPrecast(true); - this.infectorSeal(); - - switch (me.classid) { - case 1: - Pather.moveTo(7792, 5294); - - break; - default: - Pather.moveTo(7788, 5292); - - break; - } - + openSeals(Config.Diablo.SealOrder); if (Config.PublicMode) { say(Config.Diablo.DiabloMsg); } - this.diabloPrep(); + try { + print("Attempting to find Diablo"); + this.diabloPrep(); + } catch (error) { + print("Diablo wasn't found. Checking seals."); + this.vizierSeal(); + this.seisSeal(); + this.infectorSeal(); + this.diabloPrep(); + } + Attack.kill(243); // Diablo Pickit.pickItems(); From 8189ab3e1e758843317ef6f860f1ca0893898f7e Mon Sep 17 00:00:00 2001 From: Jesse Michelsen Date: Tue, 7 Jan 2020 14:01:38 -0700 Subject: [PATCH 2/7] Add SealOrder processing to DiabloHelper.js This follows the same design as the SealOrder processing in Diablo.js --- d2bs/kolbot/libs/bots/DiabloHelper.js | 119 ++++++++++++++++++++++---- 1 file changed, 102 insertions(+), 17 deletions(-) diff --git a/d2bs/kolbot/libs/bots/DiabloHelper.js b/d2bs/kolbot/libs/bots/DiabloHelper.js index 6c88abae8..65c359412 100644 --- a/d2bs/kolbot/libs/bots/DiabloHelper.js +++ b/d2bs/kolbot/libs/bots/DiabloHelper.js @@ -2,6 +2,7 @@ * @filename DiabloHelper.js * @author kolton * @desc help leading player in clearing Chaos Sanctuary and killing Diablo +* @return {boolean} */ function DiabloHelper() { @@ -72,6 +73,43 @@ function DiabloHelper() { this.infLayout = this.getLayout(392, 7893); // 1 = "I", 2 = "J" }; + this.openSeal = function (classid) { + let i, + seal; + + for (i = 0; i < 5; i += 1) { + Pather.moveToPreset(108, 2, classid, classid === 394 ? 5 : 2, classid === 394 ? 5 : 0); + + seal = getUnit(2, classid); + + if (!seal) { + return false; + } + + if (classid === 394) { + Misc.click(0, 0, seal); + } else { + seal.interact(); + } + + delay(classid === 394 ? 1000 : 500); + + if (!seal.mode) { + if (classid === 394 && Attack.validSpot(seal.x + 15, seal.y)) { // de seis optimization + Pather.moveTo(seal.x + 15, seal.y); + } else { + Pather.moveTo(seal.x - 5, seal.y - 5); + } + + delay(500); + } else { + return true; + } + } + + return false; + }; + this.getBoss = function (name) { var i, boss, glow; @@ -103,6 +141,12 @@ function DiabloHelper() { this.vizierSeal = function () { this.followPath(this.vizLayout === 1 ? this.starToVizA : this.starToVizB, this.sort); + if (Config.DiabloHelper.OpenSeals) { + if (!this.openSeal(395) || !this.openSeal(396)) { + throw new Error("Failed to open Vizier seals."); + } + } + if (this.vizLayout === 1) { Pather.moveTo(7691, 5292); } else { @@ -123,6 +167,12 @@ function DiabloHelper() { this.seisSeal = function () { this.followPath(this.seisLayout === 1 ? this.starToSeisA : this.starToSeisB, this.sort); + if (Config.DiabloHelper.OpenSeals) { + if (!this.openSeal(394)) { + throw new Error("Failed to open de Seis seal."); + } + } + if (this.seisLayout === 1) { Pather.moveTo(7771, 5196); } else { @@ -141,8 +191,15 @@ function DiabloHelper() { }; this.infectorSeal = function () { + Precast.doPrecast(true); this.followPath(this.infLayout === 1 ? this.starToInfA : this.starToInfB, this.sort); + if (Config.DiabloHelper.OpenSeals) { + if (!this.openSeal(392)) { + throw new Error("Failed to open Infector seals."); + } + } + if (this.infLayout === 1) { delay(1); } else { @@ -153,6 +210,12 @@ function DiabloHelper() { throw new Error("Failed to kill Infector"); } + if (Config.DiabloHelper.OpenSeals) { + if (!this.openSeal(393)) { + throw new Error("Failed to open Infector seals."); + } + } + if (Config.FieldID) { Town.fieldID(); } @@ -160,10 +223,34 @@ function DiabloHelper() { return true; }; + const openSeals = (sealOrder) => { + print("seal order: " + sealOrder); + let seals = { + 1: () => this.vizierSeal(), + 2: () => this.seisSeal(), + 3: () => this.infectorSeal(), + "vizier": () => this.vizierSeal(), + "seis": () => this.seisSeal(), + "infector": () => this.infectorSeal(), + }; + sealOrder.forEach(seal => {seals[seal]()}); + }; + this.diabloPrep = function () { var trapCheck, tick = getTickCount(); + switch (me.classid) { + case 1: + Pather.moveTo(7793, 5291); + + break; + default: + Pather.moveTo(7788, 5292); + + break; + } + while (getTickCount() - tick < 30000) { if (getTickCount() - tick >= 8000) { switch (me.classid) { @@ -393,8 +480,10 @@ AreaInfoLoop: } } - Pather.useWaypoint(Config.RandomPrecast ? "random" : 107); - Precast.doPrecast(true); + if (Config.DiabloHelper.SafePrecast) { + Pather.useWaypoint(Config.RandomPrecast ? "random" : 107); + Precast.doPrecast(true); + } if (Config.DiabloHelper.SkipTP) { if (me.area !== 107) { @@ -457,23 +546,19 @@ CSLoop: Pather.moveTo(7774, 5305); Attack.clear(35, 0, false, this.sort); - this.vizierSeal(); - this.seisSeal(); - Precast.doPrecast(true); - this.infectorSeal(); - - switch (me.classid) { - case 1: - Pather.moveTo(7793, 5291); - - break; - default: - Pather.moveTo(7788, 5292); - - break; + openSeals(Config.DiabloHelper.SealOrder); + + try { + print("Attempting to find Diablo"); + this.diabloPrep(); + } catch (error) { + print("Diablo wasn't found. Checking seals."); + this.vizierSeal(); + this.seisSeal(); + this.infectorSeal(); + this.diabloPrep(); } - this.diabloPrep(); Attack.kill(243); // Diablo Pickit.pickItems(); From 6d0b0603db26696e2593af93c11a942abb7bda9f Mon Sep 17 00:00:00 2001 From: Jesse Michelsen Date: Tue, 7 Jan 2020 14:04:05 -0700 Subject: [PATCH 3/7] Add new settings to Diablo and DiabloHelper configs --- d2bs/kolbot/libs/common/Config.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/d2bs/kolbot/libs/common/Config.js b/d2bs/kolbot/libs/common/Config.js index b96799d68..74de2e8dd 100644 --- a/d2bs/kolbot/libs/common/Config.js +++ b/d2bs/kolbot/libs/common/Config.js @@ -405,13 +405,17 @@ var Config = { EntranceTP: "Entrance TP up", StarTP: "Star TP up", DiabloMsg: "Diablo", - WalkClear: false + WalkClear: false, + SealOrder: ["vizier", "seis", "infector"], }, DiabloHelper: { Wait: 120, Entrance: false, SkipIfBaal: false, - SkipTP: false + SkipTP: false, + OpenSeals: false, + SafePrecast: true, + SealOrder: ["vizier", "seis", "infector"], }, BattleOrders: { Mode: 0, From 8f90f0710543b909f6f793c667e851345df45b0f Mon Sep 17 00:00:00 2001 From: Jesse Michelsen Date: Tue, 7 Jan 2020 14:05:29 -0700 Subject: [PATCH 4/7] Add new params for Diablo and DiabloHelper to configs --- d2bs/kolbot/libs/config/Amazon.js | 4 ++++ d2bs/kolbot/libs/config/Assassin.js | 4 ++++ d2bs/kolbot/libs/config/Barbarian.js | 4 ++++ d2bs/kolbot/libs/config/Druid.js | 4 ++++ d2bs/kolbot/libs/config/Necromancer.js | 4 ++++ d2bs/kolbot/libs/config/Paladin.js | 4 ++++ d2bs/kolbot/libs/config/Sorceress.js | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/d2bs/kolbot/libs/config/Amazon.js b/d2bs/kolbot/libs/config/Amazon.js index 89f07f635..60b5f619d 100644 --- a/d2bs/kolbot/libs/config/Amazon.js +++ b/d2bs/kolbot/libs/config/Amazon.js @@ -88,6 +88,7 @@ function LoadConfig() { Config.Diablo.EntranceTP = "Entrance TP up"; Config.Diablo.StarTP = "Star TP up"; Config.Diablo.DiabloMsg = "Diablo"; + Config.Diablo.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.SealLeader = false; // Clear a safe spot around seals and invite leechers in. Leechers should run SealLeecher script. Don't run with Diablo or FastDiablo. // *** act 5 *** @@ -141,6 +142,9 @@ function LoadConfig() { Config.DiabloHelper.Entrance = true; // Start from entrance. Set to false to start from star. Config.DiabloHelper.SkipTP = false; // Don't wait for town portal and directly head to chaos. It will clear monsters around chaos entrance and wait for the runner. Config.DiabloHelper.SkipIfBaal = false; // End script if there are party members in a Baal run. + Config.DiabloHelper.OpenSeals = false; // Open seals as the helper + Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast + Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Assassin.js b/d2bs/kolbot/libs/config/Assassin.js index 425491951..f3071e69a 100644 --- a/d2bs/kolbot/libs/config/Assassin.js +++ b/d2bs/kolbot/libs/config/Assassin.js @@ -88,6 +88,7 @@ function LoadConfig() { Config.Diablo.EntranceTP = "Entrance TP up"; Config.Diablo.StarTP = "Star TP up"; Config.Diablo.DiabloMsg = "Diablo"; + Config.Diablo.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.SealLeader = false; // Clear a safe spot around seals and invite leechers in. Leechers should run SealLeecher script. Don't run with Diablo or FastDiablo. // *** act 5 *** @@ -141,6 +142,9 @@ function LoadConfig() { Config.DiabloHelper.Entrance = true; // Start from entrance. Set to false to start from star. Config.DiabloHelper.SkipTP = false; // Don't wait for town portal and directly head to chaos. It will clear monsters around chaos entrance and wait for the runner. Config.DiabloHelper.SkipIfBaal = false; // End script if there are party members in a Baal run. + Config.DiabloHelper.OpenSeals = false; // Open seals as the helper + Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast + Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Barbarian.js b/d2bs/kolbot/libs/config/Barbarian.js index ba8581b30..b9f8838b4 100644 --- a/d2bs/kolbot/libs/config/Barbarian.js +++ b/d2bs/kolbot/libs/config/Barbarian.js @@ -88,6 +88,7 @@ function LoadConfig() { Config.Diablo.EntranceTP = "Entrance TP up"; Config.Diablo.StarTP = "Star TP up"; Config.Diablo.DiabloMsg = "Diablo"; + Config.Diablo.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.SealLeader = false; // Clear a safe spot around seals and invite leechers in. Leechers should run SealLeecher script. Don't run with Diablo or FastDiablo. // *** act 5 *** @@ -141,6 +142,9 @@ function LoadConfig() { Config.DiabloHelper.Entrance = true; // Start from entrance. Set to false to start from star. Config.DiabloHelper.SkipTP = false; // Don't wait for town portal and directly head to chaos. It will clear monsters around chaos entrance and wait for the runner. Config.DiabloHelper.SkipIfBaal = false; // End script if there are party members in a Baal run. + Config.DiabloHelper.OpenSeals = false; // Open seals as the helper + Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast + Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Druid.js b/d2bs/kolbot/libs/config/Druid.js index cdbe5881c..49d17735b 100644 --- a/d2bs/kolbot/libs/config/Druid.js +++ b/d2bs/kolbot/libs/config/Druid.js @@ -88,6 +88,7 @@ function LoadConfig() { Config.Diablo.EntranceTP = "Entrance TP up"; Config.Diablo.StarTP = "Star TP up"; Config.Diablo.DiabloMsg = "Diablo"; + Config.Diablo.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.SealLeader = false; // Clear a safe spot around seals and invite leechers in. Leechers should run SealLeecher script. Don't run with Diablo or FastDiablo. // *** act 5 *** @@ -141,6 +142,9 @@ function LoadConfig() { Config.DiabloHelper.Entrance = true; // Start from entrance. Set to false to start from star. Config.DiabloHelper.SkipTP = false; // Don't wait for town portal and directly head to chaos. It will clear monsters around chaos entrance and wait for the runner. Config.DiabloHelper.SkipIfBaal = false; // End script if there are party members in a Baal run. + Config.DiabloHelper.OpenSeals = false; // Open seals as the helper + Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast + Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Necromancer.js b/d2bs/kolbot/libs/config/Necromancer.js index 1e2e84c82..56e382304 100644 --- a/d2bs/kolbot/libs/config/Necromancer.js +++ b/d2bs/kolbot/libs/config/Necromancer.js @@ -88,6 +88,7 @@ function LoadConfig() { Config.Diablo.EntranceTP = "Entrance TP up"; Config.Diablo.StarTP = "Star TP up"; Config.Diablo.DiabloMsg = "Diablo"; + Config.Diablo.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.SealLeader = false; // Clear a safe spot around seals and invite leechers in. Leechers should run SealLeecher script. Don't run with Diablo or FastDiablo. // *** act 5 *** @@ -141,6 +142,9 @@ function LoadConfig() { Config.DiabloHelper.Entrance = true; // Start from entrance. Set to false to start from star. Config.DiabloHelper.SkipTP = false; // Don't wait for town portal and directly head to chaos. It will clear monsters around chaos entrance and wait for the runner. Config.DiabloHelper.SkipIfBaal = false; // End script if there are party members in a Baal run. + Config.DiabloHelper.OpenSeals = false; // Open seals as the helper + Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast + Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Paladin.js b/d2bs/kolbot/libs/config/Paladin.js index 22f64187e..46da262be 100644 --- a/d2bs/kolbot/libs/config/Paladin.js +++ b/d2bs/kolbot/libs/config/Paladin.js @@ -88,6 +88,7 @@ function LoadConfig() { Config.Diablo.EntranceTP = "Entrance TP up"; Config.Diablo.StarTP = "Star TP up"; Config.Diablo.DiabloMsg = "Diablo"; + Config.Diablo.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.SealLeader = false; // Clear a safe spot around seals and invite leechers in. Leechers should run SealLeecher script. Don't run with Diablo or FastDiablo. // *** act 5 *** @@ -141,6 +142,9 @@ function LoadConfig() { Config.DiabloHelper.Entrance = true; // Start from entrance. Set to false to start from star. Config.DiabloHelper.SkipTP = false; // Don't wait for town portal and directly head to chaos. It will clear monsters around chaos entrance and wait for the runner. Config.DiabloHelper.SkipIfBaal = false; // End script if there are party members in a Baal run. + Config.DiabloHelper.OpenSeals = false; // Open seals as the helper + Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast + Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Sorceress.js b/d2bs/kolbot/libs/config/Sorceress.js index 6852b39a5..eac7f9bc1 100644 --- a/d2bs/kolbot/libs/config/Sorceress.js +++ b/d2bs/kolbot/libs/config/Sorceress.js @@ -88,6 +88,7 @@ function LoadConfig() { Config.Diablo.EntranceTP = "Entrance TP up"; Config.Diablo.StarTP = "Star TP up"; Config.Diablo.DiabloMsg = "Diablo"; + Config.Diablo.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.SealLeader = false; // Clear a safe spot around seals and invite leechers in. Leechers should run SealLeecher script. Don't run with Diablo or FastDiablo. // *** act 5 *** @@ -141,6 +142,9 @@ function LoadConfig() { Config.DiabloHelper.Entrance = true; // Start from entrance. Set to false to start from star. Config.DiabloHelper.SkipTP = false; // Don't wait for town portal and directly head to chaos. It will clear monsters around chaos entrance and wait for the runner. Config.DiabloHelper.SkipIfBaal = false; // End script if there are party members in a Baal run. + Config.DiabloHelper.OpenSeals = false; // Open seals as the helper + Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast + Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot From 520eab84510cb9a582a807ac88034a66eb4b33b8 Mon Sep 17 00:00:00 2001 From: Jesse Michelsen Date: Tue, 7 Jan 2020 14:25:09 -0700 Subject: [PATCH 5/7] Change openSeals to clearSeals since helper may not open --- d2bs/kolbot/libs/bots/DiabloHelper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 d2bs/kolbot/libs/bots/DiabloHelper.js diff --git a/d2bs/kolbot/libs/bots/DiabloHelper.js b/d2bs/kolbot/libs/bots/DiabloHelper.js old mode 100644 new mode 100755 index 65c359412..261a317de --- a/d2bs/kolbot/libs/bots/DiabloHelper.js +++ b/d2bs/kolbot/libs/bots/DiabloHelper.js @@ -223,7 +223,7 @@ function DiabloHelper() { return true; }; - const openSeals = (sealOrder) => { + const clearSeals = (sealOrder) => { print("seal order: " + sealOrder); let seals = { 1: () => this.vizierSeal(), @@ -546,7 +546,7 @@ CSLoop: Pather.moveTo(7774, 5305); Attack.clear(35, 0, false, this.sort); - openSeals(Config.DiabloHelper.SealOrder); + clearSeals(Config.DiabloHelper.SealOrder); try { print("Attempting to find Diablo"); From 39135dc313129920626a1987907671e713c360f9 Mon Sep 17 00:00:00 2001 From: Jesse Michelsen Date: Thu, 23 Jan 2020 09:56:35 -0700 Subject: [PATCH 6/7] Add RecheckSeals config param for DiabloHelper and misc cleanup --- d2bs/kolbot/libs/bots/Diablo.js | 10 +++++----- d2bs/kolbot/libs/bots/DiabloHelper.js | 15 +++++++++------ d2bs/kolbot/libs/common/Config.js | 1 + d2bs/kolbot/libs/config/Amazon.js | 1 + d2bs/kolbot/libs/config/Assassin.js | 1 + d2bs/kolbot/libs/config/Barbarian.js | 1 + d2bs/kolbot/libs/config/Druid.js | 1 + d2bs/kolbot/libs/config/Necromancer.js | 1 + d2bs/kolbot/libs/config/Paladin.js | 1 + d2bs/kolbot/libs/config/Sorceress.js | 1 + 10 files changed, 22 insertions(+), 11 deletions(-) mode change 100755 => 100644 d2bs/kolbot/libs/bots/DiabloHelper.js diff --git a/d2bs/kolbot/libs/bots/Diablo.js b/d2bs/kolbot/libs/bots/Diablo.js index c0047216c..6b18e6f2b 100644 --- a/d2bs/kolbot/libs/bots/Diablo.js +++ b/d2bs/kolbot/libs/bots/Diablo.js @@ -2,7 +2,7 @@ * @filename Diablo.js * @author kolton * @desc clear Chaos Sanctuary and kill Diablo -* @return {boolean} +* @return {boolean} */ function Diablo() { @@ -457,7 +457,7 @@ function Diablo() { Pather.useWaypoint(107); } - if (!Pather.moveTo(7790, 5544, 5, Config.ClearPath)) { + if (!Pather.moveTo(7790, 5544)) { throw new Error("Failed to move to Chaos Sanctuary"); } @@ -465,7 +465,7 @@ function Diablo() { if (Config.Diablo.Entrance) { Attack.clear(30, 0, false, this.sort); - Pather.moveTo(7790, 5544, 3, Config.ClearPath); + Pather.moveTo(7790, 5544); if (Config.PublicMode) { Pather.makePortal(); @@ -473,7 +473,7 @@ function Diablo() { Pather.teleport = !Config.Diablo.WalkClear && Pather._teleport; } - Pather.moveTo(7790, 5544, 5, Config.ClearPath); + Pather.moveTo(7790, 5544); Precast.doPrecast(true); Attack.clear(30, 0, false, this.sort); this.followPath(this.entranceToStar); @@ -482,7 +482,7 @@ function Diablo() { Attack.clear(15, 0, false, this.sort); } - Pather.moveTo(7791, 5293, 5, Config.ClearPath); + Pather.moveTo(7791, 5293); if (Config.PublicMode) { Pather.makePortal(); diff --git a/d2bs/kolbot/libs/bots/DiabloHelper.js b/d2bs/kolbot/libs/bots/DiabloHelper.js old mode 100755 new mode 100644 index 261a317de..fc44ca7f5 --- a/d2bs/kolbot/libs/bots/DiabloHelper.js +++ b/d2bs/kolbot/libs/bots/DiabloHelper.js @@ -2,7 +2,7 @@ * @filename DiabloHelper.js * @author kolton * @desc help leading player in clearing Chaos Sanctuary and killing Diablo -* @return {boolean} +* @return {boolean} */ function DiabloHelper() { @@ -552,11 +552,14 @@ CSLoop: print("Attempting to find Diablo"); this.diabloPrep(); } catch (error) { - print("Diablo wasn't found. Checking seals."); - this.vizierSeal(); - this.seisSeal(); - this.infectorSeal(); - this.diabloPrep(); + print("Diablo wasn't found"); + if (Config.DiabloHelper.RecheckSeals) { + print("Rechecking seals"); + this.vizierSeal(); + this.seisSeal(); + this.infectorSeal(); + this.diabloPrep(); + } } Attack.kill(243); // Diablo diff --git a/d2bs/kolbot/libs/common/Config.js b/d2bs/kolbot/libs/common/Config.js index 74de2e8dd..0841f81f1 100644 --- a/d2bs/kolbot/libs/common/Config.js +++ b/d2bs/kolbot/libs/common/Config.js @@ -416,6 +416,7 @@ var Config = { OpenSeals: false, SafePrecast: true, SealOrder: ["vizier", "seis", "infector"], + RecheckSeals: false, }, BattleOrders: { Mode: 0, diff --git a/d2bs/kolbot/libs/config/Amazon.js b/d2bs/kolbot/libs/config/Amazon.js index 60b5f619d..f30674631 100644 --- a/d2bs/kolbot/libs/config/Amazon.js +++ b/d2bs/kolbot/libs/config/Amazon.js @@ -145,6 +145,7 @@ function LoadConfig() { Config.DiabloHelper.OpenSeals = false; // Open seals as the helper Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear + Config.DiabloHelper.RecheckSeals = false; // Teleport to each seal and double-check that it was opened and boss was killed if Diablo doesn't appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Assassin.js b/d2bs/kolbot/libs/config/Assassin.js index f3071e69a..df4927928 100644 --- a/d2bs/kolbot/libs/config/Assassin.js +++ b/d2bs/kolbot/libs/config/Assassin.js @@ -145,6 +145,7 @@ function LoadConfig() { Config.DiabloHelper.OpenSeals = false; // Open seals as the helper Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear + Config.DiabloHelper.RecheckSeals = false; // Teleport to each seal and double-check that it was opened and boss was killed if Diablo doesn't appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Barbarian.js b/d2bs/kolbot/libs/config/Barbarian.js index b9f8838b4..42835dc97 100644 --- a/d2bs/kolbot/libs/config/Barbarian.js +++ b/d2bs/kolbot/libs/config/Barbarian.js @@ -145,6 +145,7 @@ function LoadConfig() { Config.DiabloHelper.OpenSeals = false; // Open seals as the helper Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear + Config.DiabloHelper.RecheckSeals = false; // Teleport to each seal and double-check that it was opened and boss was killed if Diablo doesn't appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Druid.js b/d2bs/kolbot/libs/config/Druid.js index 49d17735b..8672fb572 100644 --- a/d2bs/kolbot/libs/config/Druid.js +++ b/d2bs/kolbot/libs/config/Druid.js @@ -145,6 +145,7 @@ function LoadConfig() { Config.DiabloHelper.OpenSeals = false; // Open seals as the helper Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear + Config.DiabloHelper.RecheckSeals = false; // Teleport to each seal and double-check that it was opened and boss was killed if Diablo doesn't appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Necromancer.js b/d2bs/kolbot/libs/config/Necromancer.js index 56e382304..6af07461c 100644 --- a/d2bs/kolbot/libs/config/Necromancer.js +++ b/d2bs/kolbot/libs/config/Necromancer.js @@ -145,6 +145,7 @@ function LoadConfig() { Config.DiabloHelper.OpenSeals = false; // Open seals as the helper Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear + Config.DiabloHelper.RecheckSeals = false; // Teleport to each seal and double-check that it was opened and boss was killed if Diablo doesn't appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Paladin.js b/d2bs/kolbot/libs/config/Paladin.js index 46da262be..52198105d 100644 --- a/d2bs/kolbot/libs/config/Paladin.js +++ b/d2bs/kolbot/libs/config/Paladin.js @@ -145,6 +145,7 @@ function LoadConfig() { Config.DiabloHelper.OpenSeals = false; // Open seals as the helper Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear + Config.DiabloHelper.RecheckSeals = false; // Teleport to each seal and double-check that it was opened and boss was killed if Diablo doesn't appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot diff --git a/d2bs/kolbot/libs/config/Sorceress.js b/d2bs/kolbot/libs/config/Sorceress.js index eac7f9bc1..a9994166a 100644 --- a/d2bs/kolbot/libs/config/Sorceress.js +++ b/d2bs/kolbot/libs/config/Sorceress.js @@ -145,6 +145,7 @@ function LoadConfig() { Config.DiabloHelper.OpenSeals = false; // Open seals as the helper Config.DiabloHelper.SafePrecast = true; // take random WP to safely precast Config.DiabloHelper.SealOrder = ["vizier", "seis", "infector"]; // the order in which to clear the seals. If seals are excluded, they won't be checked unless diablo fails to appear + Config.DiabloHelper.RecheckSeals = false; // Teleport to each seal and double-check that it was opened and boss was killed if Diablo doesn't appear Scripts.AutoBaal = false; // Baal leecher with auto leader assignment Config.AutoBaal.FindShrine = false; // false = disabled, 1 = search after hot tp message, 2 = search as soon as leader is found Config.AutoBaal.LeechSpot = [15115, 5050]; // X, Y coords of Throne Room leech spot From 51f4451cbe6208e91aecd64e32858b978bd573fa Mon Sep 17 00:00:00 2001 From: Jesse Michelsen Date: Thu, 23 Jan 2020 10:03:44 -0700 Subject: [PATCH 7/7] Remove unnecessary change --- d2bs/kolbot/libs/bots/Diablo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d2bs/kolbot/libs/bots/Diablo.js b/d2bs/kolbot/libs/bots/Diablo.js index 6b18e6f2b..8ad2f54b7 100644 --- a/d2bs/kolbot/libs/bots/Diablo.js +++ b/d2bs/kolbot/libs/bots/Diablo.js @@ -478,7 +478,7 @@ function Diablo() { Attack.clear(30, 0, false, this.sort); this.followPath(this.entranceToStar); } else { - Pather.moveTo(7774, 5305, 5, Config.ClearPath); + Pather.moveTo(7774, 5305); Attack.clear(15, 0, false, this.sort); }