From dbbd06cf976702924d48cf116b225d0415efcc99 Mon Sep 17 00:00:00 2001 From: Mike Gilmore Date: Sat, 13 Apr 2019 20:15:12 -0600 Subject: [PATCH] Change Pather.pathTo back to Pather.moveTo --- d2bs/kolbot/libs/bots/Andariel.js | 4 +- d2bs/kolbot/libs/bots/AutoBaal.js | 6 +- d2bs/kolbot/libs/bots/Baal.js | 18 ++-- d2bs/kolbot/libs/bots/BaalAssistant.js | 42 ++++----- d2bs/kolbot/libs/bots/BaalHelper.js | 18 ++-- d2bs/kolbot/libs/bots/BattleOrders.js | 2 +- d2bs/kolbot/libs/bots/BoneAsh.js | 2 +- .../kolbot/libs/bots/ClassicChaosAssistant.js | 24 ++--- d2bs/kolbot/libs/bots/Countess.js | 4 +- d2bs/kolbot/libs/bots/Cows.js | 4 +- d2bs/kolbot/libs/bots/Crafting.js | 2 +- d2bs/kolbot/libs/bots/Diablo.js | 36 ++++---- d2bs/kolbot/libs/bots/DiabloHelper.js | 26 +++--- d2bs/kolbot/libs/bots/Duriel.js | 2 +- d2bs/kolbot/libs/bots/Eldritch.js | 6 +- d2bs/kolbot/libs/bots/Enchant.js | 4 +- d2bs/kolbot/libs/bots/FastDiablo.js | 18 ++-- d2bs/kolbot/libs/bots/Follower.js | 4 +- d2bs/kolbot/libs/bots/GhostBusters.js | 2 +- d2bs/kolbot/libs/bots/MFHelper.js | 2 +- d2bs/kolbot/libs/bots/Mephisto.js | 46 +++++----- d2bs/kolbot/libs/bots/OrgTorch.js | 20 ++--- d2bs/kolbot/libs/bots/Pindleskin.js | 2 +- d2bs/kolbot/libs/bots/Questing.js | 2 +- d2bs/kolbot/libs/bots/Rakanishu.js | 2 +- d2bs/kolbot/libs/bots/Rushee.js | 8 +- d2bs/kolbot/libs/bots/SealLeader.js | 32 +++---- d2bs/kolbot/libs/bots/Travincal.js | 8 +- d2bs/kolbot/libs/bots/Tristram.js | 2 +- d2bs/kolbot/libs/bots/TristramLeech.js | 4 +- d2bs/kolbot/libs/bots/Wakka.js | 4 +- d2bs/kolbot/libs/common/Attack.js | 12 +-- d2bs/kolbot/libs/common/Attacks/Paladin.js | 4 +- d2bs/kolbot/libs/common/Misc.js | 6 +- d2bs/kolbot/libs/common/Pather.js | 36 ++++---- d2bs/kolbot/tools/AntiHostile.js | 12 +-- d2bs/kolbot/tools/RushThread.js | 88 +++++++++---------- 37 files changed, 260 insertions(+), 254 deletions(-) diff --git a/d2bs/kolbot/libs/bots/Andariel.js b/d2bs/kolbot/libs/bots/Andariel.js index 7e47bfe0d..998797527 100644 --- a/d2bs/kolbot/libs/bots/Andariel.js +++ b/d2bs/kolbot/libs/bots/Andariel.js @@ -26,7 +26,7 @@ function Andariel() { } if (getDistance(me, target) <= 10) { - Pather.pathTo(me.x > 22548 ? 22535 : 22560, 9520); + Pather.moveTo(me.x > 22548 ? 22535 : 22560, 9520); } } @@ -41,7 +41,7 @@ function Andariel() { throw new Error("Failed to move to Catacombs Level 4"); } - Pather.pathTo(22549, 9520); + Pather.moveTo(22549, 9520); if (me.classid === 1 && me.gametype === 0) { this.killAndariel(); diff --git a/d2bs/kolbot/libs/bots/AutoBaal.js b/d2bs/kolbot/libs/bots/AutoBaal.js index 4c8f9853a..513eaa4bc 100644 --- a/d2bs/kolbot/libs/bots/AutoBaal.js +++ b/d2bs/kolbot/libs/bots/AutoBaal.js @@ -212,7 +212,7 @@ function AutoBaal() { if (throneCheck && me.area === 109) { // wait for throne signal - leader's safe message print("ÿc4AutoBaal: ÿc0Trying to take TP to throne."); Pather.usePortal(131, null); // take TP to throne - Pather.pathTo(Config.AutoBaal.LeechSpot[0], Config.AutoBaal.LeechSpot[1]); // move to a safe spot + Pather.moveTo(Config.AutoBaal.LeechSpot[0], Config.AutoBaal.LeechSpot[1]); // move to a safe spot Precast.doPrecast(true); Town.getCorpse(); // check for corpse - happens if you die and reenter } @@ -222,7 +222,7 @@ function AutoBaal() { } if (baalCheck && me.area === 131) { // wait for baal signal - leader's baal message - Pather.pathTo(15092, 5010); // move closer to chamber portal + Pather.moveTo(15092, 5010); // move closer to chamber portal Precast.doPrecast(false); while (getUnit(1, 543)) { // wait for baal to go through the portal @@ -235,7 +235,7 @@ function AutoBaal() { print("ÿc4AutoBaal: ÿc0Entering chamber."); if (Pather.usePortal(null, null, portal)) { // enter chamber - Pather.pathTo(15166, 5903); // go to a safe position + Pather.moveTo(15166, 5903); // go to a safe position } Town.getCorpse(); // check for corpse - happens if you die and reenter diff --git a/d2bs/kolbot/libs/bots/Baal.js b/d2bs/kolbot/libs/bots/Baal.js index c7127da17..0f6bb35b2 100644 --- a/d2bs/kolbot/libs/bots/Baal.js +++ b/d2bs/kolbot/libs/bots/Baal.js @@ -119,7 +119,7 @@ function Baal() { } for (i = 0; i < pos.length; i += 2) { - Pather.pathTo(pos[i], pos[i + 1]); + Pather.moveTo(pos[i], pos[i + 1]); Attack.clear(25); } }; @@ -129,7 +129,7 @@ function Baal() { if (hydra) { do { if (hydra.mode !== 12 && hydra.getStat(172) !== 2) { - Pather.pathTo(15072, 5002); + Pather.moveTo(15072, 5002); while (hydra.mode !== 12) { delay(500); if (!copyUnit(hydra).x) { @@ -208,7 +208,7 @@ function Baal() { throw new Error("Failed to move to Throne of Destruction."); } - Pather.pathTo(15095, 5029); + Pather.moveTo(15095, 5029); if (Config.Baal.DollQuit && getUnit(1, 691)) { say("Dolls found! NG."); @@ -224,7 +224,7 @@ function Baal() { if (Config.PublicMode) { this.announce(); - Pather.pathTo(15118, 5002); + Pather.moveTo(15118, 5002); Pather.makePortal(); say(Config.Baal.HotTPMessage); Attack.clear(15); @@ -233,7 +233,7 @@ function Baal() { this.clearThrone(); if (Config.PublicMode) { - Pather.pathTo(15118, 5045); + Pather.moveTo(15118, 5045); Pather.makePortal(); say(Config.Baal.SafeTPMessage); Precast.doPrecast(true); @@ -241,12 +241,12 @@ function Baal() { tick = getTickCount(); - Pather.pathTo(15094, me.classid === 3 ? 5029 : 5038); + Pather.moveTo(15094, me.classid === 3 ? 5029 : 5038); MainLoop: while (true) { if (getDistance(me, 15094, me.classid === 3 ? 5029 : 5038) > 3) { - Pather.pathTo(15094, me.classid === 3 ? 5029 : 5038); + Pather.moveTo(15094, me.classid === 3 ? 5029 : 5038); } if (!getUnit(1, 543)) { @@ -309,7 +309,7 @@ MainLoop: say(Config.Baal.BaalMessage); } - Pather.pathTo(15090, 5008); + Pather.moveTo(15090, 5008); delay(5000); Precast.doPrecast(true); @@ -325,7 +325,7 @@ MainLoop: throw new Error("Couldn't find portal."); } - Pather.pathTo(15134, 5923); + Pather.moveTo(15134, 5923); Attack.kill(544); // Baal Pickit.pickItems(); } diff --git a/d2bs/kolbot/libs/bots/BaalAssistant.js b/d2bs/kolbot/libs/bots/BaalAssistant.js index 05be7312a..9a0c8e5ac 100644 --- a/d2bs/kolbot/libs/bots/BaalAssistant.js +++ b/d2bs/kolbot/libs/bots/BaalAssistant.js @@ -141,7 +141,7 @@ function BaalAssistant() { return false; } if (getDistance(me, 15094, 5029) > 3) { - Pather.pathTo(15094, 5029); + Pather.moveTo(15094, 5029); } if (Config.AttackSkill[4] > 0) { Skill.setSkill(Config.AttackSkill[4], 0); @@ -225,7 +225,7 @@ function BaalAssistant() { } } for (i = 0; i < pos.length; i += 2) { - Pather.pathTo(pos[i], pos[i + 1]); + Pather.moveTo(pos[i], pos[i + 1]); Attack.clear(25); } }; @@ -235,7 +235,7 @@ function BaalAssistant() { if (hydra) { do { if (hydra.mode !== 12 && hydra.getStat(172) !== 2) { - Pather.pathTo(15072, 5002); + Pather.moveTo(15072, 5002); while (hydra.mode !== 12) { delay(500); if (!copyUnit(hydra).x) { @@ -398,26 +398,26 @@ function BaalAssistant() { } if (entrance) { - Pather.pathTo(entrance.x > me.x ? entrance.x - 5 : entrance.x + 5, entrance.y > me.y ? entrance.y - 5 : entrance.y + 5); + Pather.moveTo(entrance.x > me.x ? entrance.x - 5 : entrance.x + 5, entrance.y > me.y ? entrance.y - 5 : entrance.y + 5); } - if (!Pather.moveToExit(131, true) || !Pather.pathTo(15118, 5002)) { + if (!Pather.moveToExit(131, true) || !Pather.moveTo(15118, 5002)) { throw new Error("Failed to move to Throne of Destruction."); } - Pather.pathTo(15095, 5029); + Pather.moveTo(15095, 5029); if ((SoulQuit && getUnit(1, 641)) || (DollQuit && getUnit(1, 691))) { print("Burning Souls or Undead Soul Killers found, ending script."); return true; } - Pather.pathTo(15118, 5002); + Pather.moveTo(15118, 5002); if (Helper) { Attack.clear(15); - Pather.pathTo(15118, 5002); + Pather.moveTo(15118, 5002); } else { - Pather.pathTo(15117, 5045); + Pather.moveTo(15117, 5045); } secondAttempt = true; @@ -431,9 +431,9 @@ function BaalAssistant() { } if (Helper) { Attack.clear(15); - Pather.pathTo(15118, 5002); + Pather.moveTo(15118, 5002); } else { - Pather.pathTo(15117, 5045); + Pather.moveTo(15117, 5045); } } } @@ -477,9 +477,9 @@ function BaalAssistant() { if (Helper) { Attack.clear(15); - Pather.pathTo(15118, 5002); + Pather.moveTo(15118, 5002); } else { - Pather.pathTo(15117, 5045); + Pather.moveTo(15117, 5045); } secondAttempt = true; @@ -493,9 +493,9 @@ function BaalAssistant() { } if (Helper) { Attack.clear(15); - Pather.pathTo(15118, 5002); + Pather.moveTo(15118, 5002); } else { - Pather.pathTo(15117, 5045); + Pather.moveTo(15117, 5045); } } } @@ -515,7 +515,7 @@ function BaalAssistant() { Attack.clear(15); this.clearThrone(); - Pather.pathTo(15094, me.classid === 3 ? 5029 : 5038); + Pather.moveTo(15094, me.classid === 3 ? 5029 : 5038); Precast.doPrecast(true); } @@ -524,7 +524,7 @@ function BaalAssistant() { MainLoop: while (true) { if (Helper) { if (getDistance(me, 15094, me.classid === 3 ? 5029 : 5038) > 3) { - Pather.pathTo(15094, me.classid === 3 ? 5029 : 5038); + Pather.moveTo(15094, me.classid === 3 ? 5029 : 5038); } } @@ -607,11 +607,11 @@ function BaalAssistant() { if ((throneStatus || baalCheck) && KillBaal && me.area === 131) { if (Helper) { - Pather.pathTo(15090, 5008); + Pather.moveTo(15090, 5008); delay(2000); Precast.doPrecast(true); } else { - Pather.pathTo(15090, 5010); + Pather.moveTo(15090, 5010); Precast.doPrecast(true); } @@ -638,7 +638,7 @@ function BaalAssistant() { if (Helper) { delay(1000); - Pather.pathTo(15134, 5923); + Pather.moveTo(15134, 5923); baal = getUnit(1, 544); Attack.kill(544); Pickit.pickItems(); @@ -649,7 +649,7 @@ function BaalAssistant() { return true; } } else { - Pather.pathTo(15177, 5952); + Pather.moveTo(15177, 5952); baal = getUnit(1, 544); while (baal) { delay(1000); diff --git a/d2bs/kolbot/libs/bots/BaalHelper.js b/d2bs/kolbot/libs/bots/BaalHelper.js index 77a1e57c1..f5bb06b2b 100644 --- a/d2bs/kolbot/libs/bots/BaalHelper.js +++ b/d2bs/kolbot/libs/bots/BaalHelper.js @@ -117,7 +117,7 @@ function BaalHelper() { // experi-mental } for (i = 0; i < pos.length; i += 2) { - Pather.pathTo(pos[i], pos[i + 1]); + Pather.moveTo(pos[i], pos[i + 1]); Attack.clear(30); } }; @@ -128,7 +128,7 @@ function BaalHelper() { // experi-mental if (hydra) { do { if (hydra.mode !== 12 && hydra.getStat(172) !== 2) { - Pather.pathTo(15118, 5002); + Pather.moveTo(15118, 5002); while (hydra.mode !== 12) { delay(500); @@ -213,7 +213,7 @@ WSKLoop: } if (entrance) { - Pather.pathTo(entrance.x > me.x ? entrance.x - 5 : entrance.x + 5, entrance.y > me.y ? entrance.y - 5 : entrance.y + 5); + Pather.moveTo(entrance.x > me.x ? entrance.x - 5 : entrance.x + 5, entrance.y > me.y ? entrance.y - 5 : entrance.y + 5); } if (!Pather.moveToExit([130, 131], false)) { @@ -224,7 +224,7 @@ WSKLoop: throw new Error("Failed to move to Throne of Destruction."); } - if (!Pather.pathTo(15113, 5040)) { + if (!Pather.moveTo(15113, 5040)) { D2Bot.printToConsole("path fail"); } } else { @@ -256,12 +256,12 @@ WSKLoop: tick = getTickCount(); - Pather.pathTo(15093, me.classid === 3 ? 5029 : 5039); + Pather.moveTo(15093, me.classid === 3 ? 5029 : 5039); MainLoop: while (true) { if (getDistance(me, 15093, me.classid === 3 ? 5029 : 5039) > 3) { - Pather.pathTo(15093, me.classid === 3 ? 5029 : 5039); + Pather.moveTo(15093, me.classid === 3 ? 5029 : 5039); } if (!getUnit(1, 543)) { @@ -321,7 +321,7 @@ MainLoop: } if (Config.BaalHelper.KillBaal) { - Pather.pathTo(15092, 5011); + Pather.moveTo(15092, 5011); Precast.doPrecast(false); while (getUnit(1, 543)) { @@ -329,7 +329,7 @@ MainLoop: } delay(1000); - Pather.pathTo(15092, 5011); + Pather.moveTo(15092, 5011); portal = getUnit(2, 563); @@ -339,7 +339,7 @@ MainLoop: throw new Error("Couldn't find portal."); } - Pather.pathTo(15134, 5923); + Pather.moveTo(15134, 5923); Attack.kill(544); // Baal Pickit.pickItems(); } else { diff --git a/d2bs/kolbot/libs/bots/BattleOrders.js b/d2bs/kolbot/libs/bots/BattleOrders.js index e368d0feb..eada7f1ee 100644 --- a/d2bs/kolbot/libs/bots/BattleOrders.js +++ b/d2bs/kolbot/libs/bots/BattleOrders.js @@ -40,7 +40,7 @@ function BattleOrders() { quit(); } - Pather.pathTo(me.x + 6, me.y + 6); + Pather.moveTo(me.x + 6, me.y + 6); var i, tick = getTickCount(), diff --git a/d2bs/kolbot/libs/bots/BoneAsh.js b/d2bs/kolbot/libs/bots/BoneAsh.js index f15a7ce99..8f478c61c 100644 --- a/d2bs/kolbot/libs/bots/BoneAsh.js +++ b/d2bs/kolbot/libs/bots/BoneAsh.js @@ -9,7 +9,7 @@ function BoneAsh() { Pather.useWaypoint(32); Precast.doPrecast(true); - if (!Pather.pathTo(20047, 4898)) { + if (!Pather.moveTo(20047, 4898)) { throw new Error("Failed to move to Bone Ash"); } diff --git a/d2bs/kolbot/libs/bots/ClassicChaosAssistant.js b/d2bs/kolbot/libs/bots/ClassicChaosAssistant.js index c9523f100..2d515cc0b 100644 --- a/d2bs/kolbot/libs/bots/ClassicChaosAssistant.js +++ b/d2bs/kolbot/libs/bots/ClassicChaosAssistant.js @@ -104,9 +104,9 @@ function Idle() { switch (me.area) { case 108: if (this.infLayout === 1) { - Pather.pathTo(7893, 5306); + Pather.moveTo(7893, 5306); } else { - Pather.pathTo(7929, 5294); + Pather.moveTo(7929, 5294); } Pather.makePortal(); say("Infector of Souls TP Up!"); @@ -119,9 +119,9 @@ function Idle() { switch (me.area) { case 108: if (this.seisLayout === 1) { - Pather.pathTo(7773, 5191); + Pather.moveTo(7773, 5191); } else { - Pather.pathTo(7794, 5189); + Pather.moveTo(7794, 5189); } Pather.makePortal(); say("Lord De Seis TP Up!"); @@ -134,9 +134,9 @@ function Idle() { switch (me.area) { case 108: if (this.vizLayout === 1) { - Pather.pathTo(7681, 5302); + Pather.moveTo(7681, 5302); } else { - Pather.pathTo(7675, 5305); + Pather.moveTo(7675, 5305); } Pather.makePortal(); say("Grand Vizier of Chaos TP Up!"); @@ -152,9 +152,9 @@ function Idle() { this.openSeal(392) say("Infector of Souls spawned!"); if (this.infLayout === 1) { - Pather.pathTo(7893, 5306); + Pather.moveTo(7893, 5306); } else { - Pather.pathTo(7929, 5294); + Pather.moveTo(7929, 5294); } break; } @@ -167,9 +167,9 @@ function Idle() { this.openSeal(394) say("Lord De Seis spawned!"); if (this.seisLayout === 1) { - Pather.pathTo(7773, 5191); + Pather.moveTo(7773, 5191); } else { - Pather.pathTo(7794, 5189); + Pather.moveTo(7794, 5189); } break; } @@ -182,9 +182,9 @@ function Idle() { this.openSeal(396) say("Grand Vizier of Chaos spawned!"); if (this.vizLayout === 1) { - Pather.pathTo(7681, 5302); + Pather.moveTo(7681, 5302); } else { - Pather.pathTo(7675, 5305); + Pather.moveTo(7675, 5305); } break; } diff --git a/d2bs/kolbot/libs/bots/Countess.js b/d2bs/kolbot/libs/bots/Countess.js index 6a4f55cdf..f7131db2b 100644 --- a/d2bs/kolbot/libs/bots/Countess.js +++ b/d2bs/kolbot/libs/bots/Countess.js @@ -23,10 +23,10 @@ function Countess() { switch (poi.roomx * 5 + poi.x) { case 12565: - Pather.pathTo(12578, 11043); + Pather.moveTo(12578, 11043); break; case 12526: - Pather.pathTo(12548, 11083); + Pather.moveTo(12548, 11083); break; } diff --git a/d2bs/kolbot/libs/bots/Cows.js b/d2bs/kolbot/libs/bots/Cows.js index 3ebb9f6a7..eb53e834d 100644 --- a/d2bs/kolbot/libs/bots/Cows.js +++ b/d2bs/kolbot/libs/bots/Cows.js @@ -67,7 +67,7 @@ function Cows() { result = Pather.getNearestWalkable(room[0], room[1], 10, 2); if (result) { - Pather.pathTo(result[0], result[1], 3); + Pather.moveTo(result[0], result[1], 3); if (!Attack.clear(30)) { return false; @@ -105,7 +105,7 @@ function Cows() { throw new Error("Tristram portal not found"); } - Pather.pathTo(25048, 5177); + Pather.moveTo(25048, 5177); wirt = getUnit(2, 268); diff --git a/d2bs/kolbot/libs/bots/Crafting.js b/d2bs/kolbot/libs/bots/Crafting.js index bc8ea29fd..28adfb2b0 100644 --- a/d2bs/kolbot/libs/bots/Crafting.js +++ b/d2bs/kolbot/libs/bots/Crafting.js @@ -350,7 +350,7 @@ function shopStuff(npcId, classids, amount) { path = this.processPath(npc, path); for (i = 0; i < path.length; i += 2) { - Pather.pathTo(path[i] - 3, path[i + 1] - 3); + Pather.moveTo(path[i] - 3, path[i + 1] - 3); moveNPC(npc, path[i], path[i + 1]); for (j = 0; j < leadTimeout; j += 1) { diff --git a/d2bs/kolbot/libs/bots/Diablo.js b/d2bs/kolbot/libs/bots/Diablo.js index dc480b617..5f16fe823 100644 --- a/d2bs/kolbot/libs/bots/Diablo.js +++ b/d2bs/kolbot/libs/bots/Diablo.js @@ -117,9 +117,9 @@ function Diablo() { if (!seal.mode) { if (classid === 394 && Attack.validSpot(seal.x + 15, seal.y)) { // de seis optimization - Pather.pathTo(seal.x + 15, seal.y); + Pather.moveTo(seal.x + 15, seal.y); } else { - Pather.pathTo(seal.x - 5, seal.y - 5); + Pather.moveTo(seal.x - 5, seal.y - 5); } delay(500); @@ -152,7 +152,7 @@ function Diablo() { for (i = 0; i < positions.length; i += 1) { if (Attack.validSpot(target.x + positions[i][0], target.y + positions[i][1])) { // check if we can move there - Pather.pathTo(target.x + positions[i][0], target.y + positions[i][1]); + Pather.moveTo(target.x + positions[i][0], target.y + positions[i][1]); Skill.setSkill(Config.AttackSkill[2], 0); for (n = 0; n < amount; n += 1) { @@ -201,9 +201,9 @@ function Diablo() { } if (this.vizLayout === 1) { - Pather.pathTo(7691, 5292); + Pather.moveTo(7691, 5292); } else { - Pather.pathTo(7695, 5316); + Pather.moveTo(7695, 5316); } if (!this.getBoss(getLocaleString(2851))) { @@ -222,9 +222,9 @@ function Diablo() { } if (this.seisLayout === 1) { - Pather.pathTo(7771, 5196); + Pather.moveTo(7771, 5196); } else { - Pather.pathTo(7798, 5186); + Pather.moveTo(7798, 5186); } if (!this.getBoss(getLocaleString(2852))) { @@ -245,7 +245,7 @@ function Diablo() { if (this.infLayout === 1) { delay(1); } else { - Pather.pathTo(7928, 5295); // temp + Pather.moveTo(7928, 5295); // temp } if (!this.getBoss(getLocaleString(2853))) { @@ -334,7 +334,7 @@ function Diablo() { this.clearStrays(); } - Pather.pathTo(path[i], path[i + 1], 3, getDistance(me, path[i], path[i + 1]) > 50); + Pather.moveTo(path[i], path[i + 1], 3, getDistance(me, path[i], path[i + 1]) > 50); Attack.clear(30, 0, false, this.sort); // Push cleared positions so they can be checked for strays @@ -374,7 +374,7 @@ function Diablo() { } if (getDistance(me, oldPos.x, oldPos.y) > 5) { - Pather.pathTo(oldPos.x, oldPos.y); + Pather.moveTo(oldPos.x, oldPos.y); } return true; @@ -404,7 +404,7 @@ function Diablo() { } if (getDistance(me, oldPos.x, oldPos.y) > 5) { - Pather.pathTo(oldPos.x, oldPos.y); + Pather.moveTo(oldPos.x, oldPos.y); } return true; @@ -431,7 +431,7 @@ function Diablo() { Pather.useWaypoint(107); } - if (!Pather.pathTo(7790, 5544)) { + if (!Pather.moveTo(7790, 5544)) { throw new Error("Failed to move to Chaos Sanctuary"); } @@ -439,7 +439,7 @@ function Diablo() { if (Config.Diablo.Entrance) { Attack.clear(30, 0, false, this.sort); - Pather.pathTo(7790, 5544); + Pather.moveTo(7790, 5544); if (Config.PublicMode) { Pather.makePortal(); @@ -447,16 +447,16 @@ function Diablo() { Pather.teleport = !Config.Diablo.WalkClear && Pather._teleport; } - Pather.pathTo(7790, 5544); + Pather.moveTo(7790, 5544); Precast.doPrecast(true); Attack.clear(30, 0, false, this.sort); this.followPath(this.entranceToStar); } else { - Pather.pathTo(7774, 5305); + Pather.moveTo(7774, 5305); Attack.clear(15, 0, false, this.sort); } - Pather.pathTo(7791, 5293); + Pather.moveTo(7791, 5293); if (Config.PublicMode) { Pather.makePortal(); @@ -472,11 +472,11 @@ function Diablo() { switch (me.classid) { case 1: - Pather.pathTo(7792, 5294); + Pather.moveTo(7792, 5294); break; default: - Pather.pathTo(7788, 5292); + Pather.moveTo(7788, 5292); break; } diff --git a/d2bs/kolbot/libs/bots/DiabloHelper.js b/d2bs/kolbot/libs/bots/DiabloHelper.js index 070d718dd..6c88abae8 100644 --- a/d2bs/kolbot/libs/bots/DiabloHelper.js +++ b/d2bs/kolbot/libs/bots/DiabloHelper.js @@ -104,9 +104,9 @@ function DiabloHelper() { this.followPath(this.vizLayout === 1 ? this.starToVizA : this.starToVizB, this.sort); if (this.vizLayout === 1) { - Pather.pathTo(7691, 5292); + Pather.moveTo(7691, 5292); } else { - Pather.pathTo(7695, 5316); + Pather.moveTo(7695, 5316); } if (!this.getBoss(getLocaleString(2851))) { @@ -124,9 +124,9 @@ function DiabloHelper() { this.followPath(this.seisLayout === 1 ? this.starToSeisA : this.starToSeisB, this.sort); if (this.seisLayout === 1) { - Pather.pathTo(7771, 5196); + Pather.moveTo(7771, 5196); } else { - Pather.pathTo(7798, 5186); + Pather.moveTo(7798, 5186); } if (!this.getBoss(getLocaleString(2852))) { @@ -146,7 +146,7 @@ function DiabloHelper() { if (this.infLayout === 1) { delay(1); } else { - Pather.pathTo(7928, 5295); // temp + Pather.moveTo(7928, 5295); // temp } if (!this.getBoss(getLocaleString(2853))) { @@ -298,7 +298,7 @@ function DiabloHelper() { this.clearStrays(); } - Pather.pathTo(path[i], path[i + 1], 3, getDistance(me, path[i], path[i + 1]) > 50); + Pather.moveTo(path[i], path[i + 1], 3, getDistance(me, path[i], path[i + 1]) > 50); Attack.clear(30, 0, false, this.sort); // Push cleared positions so they can be checked for strays @@ -338,7 +338,7 @@ function DiabloHelper() { } if (getDistance(me, oldPos.x, oldPos.y) > 5) { - Pather.pathTo(oldPos.x, oldPos.y); + Pather.moveTo(oldPos.x, oldPos.y); } return true; @@ -401,12 +401,12 @@ AreaInfoLoop: Pather.useWaypoint(107); } - if (!Pather.pathTo(7790, 5544)) { + if (!Pather.moveTo(7790, 5544)) { throw new Error("Failed to move to Chaos Sanctuary"); } if (!Config.DiabloHelper.Entrance) { - Pather.pathTo(7774, 5305); + Pather.moveTo(7774, 5305); } CSLoop: @@ -451,11 +451,11 @@ CSLoop: Attack.clear(35, 0, false, this.sort); this.followPath(this.entranceToStar); } else { - Pather.pathTo(7774, 5305); + Pather.moveTo(7774, 5305); Attack.clear(35, 0, false, this.sort); } - Pather.pathTo(7774, 5305); + Pather.moveTo(7774, 5305); Attack.clear(35, 0, false, this.sort); this.vizierSeal(); this.seisSeal(); @@ -464,11 +464,11 @@ CSLoop: switch (me.classid) { case 1: - Pather.pathTo(7793, 5291); + Pather.moveTo(7793, 5291); break; default: - Pather.pathTo(7788, 5292); + Pather.moveTo(7788, 5292); break; } diff --git a/d2bs/kolbot/libs/bots/Duriel.js b/d2bs/kolbot/libs/bots/Duriel.js index 49fd777de..f7ce972af 100644 --- a/d2bs/kolbot/libs/bots/Duriel.js +++ b/d2bs/kolbot/libs/bots/Duriel.js @@ -35,7 +35,7 @@ function Duriel() { } if (getDistance(me, target) <= 10) { - Pather.pathTo(22638, me.y < target.y ? 15722 : 15693); + Pather.moveTo(22638, me.y < target.y ? 15722 : 15693); } } diff --git a/d2bs/kolbot/libs/bots/Eldritch.js b/d2bs/kolbot/libs/bots/Eldritch.js index b5aa1c0fe..5adc50603 100644 --- a/d2bs/kolbot/libs/bots/Eldritch.js +++ b/d2bs/kolbot/libs/bots/Eldritch.js @@ -10,7 +10,7 @@ function Eldritch() { Town.doChores(); Pather.useWaypoint(111); Precast.doPrecast(true); - Pather.pathTo(3745, 5084); + Pather.moveTo(3745, 5084); Attack.clear(15, 0, getLocaleString(22500)); // Eldritch the Rectifier if (Config.Eldritch.OpenChest) { @@ -28,12 +28,12 @@ function Eldritch() { } if (Config.Eldritch.KillShenk) { - Pather.pathTo(3876, 5130); + Pather.moveTo(3876, 5130); Attack.clear(15, 0, getLocaleString(22435)); // Shenk the Overseer } if (Config.Eldritch.KillDacFarren) { - Pather.pathTo(4478, 5108); + Pather.moveTo(4478, 5108); Attack.clear(15, 0, getLocaleString(22501)); // Dac Farren } diff --git a/d2bs/kolbot/libs/bots/Enchant.js b/d2bs/kolbot/libs/bots/Enchant.js index 0f706cec3..548c4a27d 100644 --- a/d2bs/kolbot/libs/bots/Enchant.js +++ b/d2bs/kolbot/libs/bots/Enchant.js @@ -162,7 +162,7 @@ function Enchant() { return false; } - Pather.pathTo(25048, 5177); + Pather.moveTo(25048, 5177); wirt = getUnit(2, 268); @@ -581,7 +581,7 @@ MainLoop: } if (spot && getDistance(me, spot) > 10) { - Pather.pathTo(spot.x, spot.y); + Pather.moveTo(spot.x, spot.y); } if (command && !this.floodCheck(command)) { diff --git a/d2bs/kolbot/libs/bots/FastDiablo.js b/d2bs/kolbot/libs/bots/FastDiablo.js index eb90cf380..553d69f0f 100644 --- a/d2bs/kolbot/libs/bots/FastDiablo.js +++ b/d2bs/kolbot/libs/bots/FastDiablo.js @@ -73,7 +73,7 @@ function FastDiablo() { for (i = 0; i < positions.length; i += 1) { if (Attack.validSpot(target.x + positions[i][0], target.y + positions[i][1])) { // check if we can move there - Pather.pathTo(target.x + positions[i][0], target.y + positions[i][1]); + Pather.moveTo(target.x + positions[i][0], target.y + positions[i][1]); Skill.setSkill(Config.AttackSkill[2], 0); for (n = 0; n < amount; n += 1) { @@ -197,9 +197,9 @@ function FastDiablo() { if (!seal.mode) { if (classid === 394 && Attack.validSpot(seal.x + 15, seal.y)) { // de seis optimization - Pather.pathTo(seal.x + 15, seal.y); + Pather.moveTo(seal.x + 15, seal.y); } else { - Pather.pathTo(seal.x - 5, seal.y - 5); + Pather.moveTo(seal.x - 5, seal.y - 5); } delay(500); @@ -219,9 +219,9 @@ function FastDiablo() { this.openSeal(396); if (this.vizLayout === 1) { - Pather.pathTo(7691, 5292); + Pather.moveTo(7691, 5292); } else { - Pather.pathTo(7695, 5316); + Pather.moveTo(7695, 5316); } if (!this.getBoss(getLocaleString(2851))) { @@ -231,9 +231,9 @@ function FastDiablo() { this.openSeal(394); if (this.seisLayout === 1) { - Pather.pathTo(7771, 5196); + Pather.moveTo(7771, 5196); } else { - Pather.pathTo(7798, 5186); + Pather.moveTo(7798, 5186); } if (!this.getBoss(getLocaleString(2852))) { @@ -246,14 +246,14 @@ function FastDiablo() { if (this.infLayout === 1) { delay(1); } else { - Pather.pathTo(7928, 5295); // temp + Pather.moveTo(7928, 5295); // temp } if (!this.getBoss(getLocaleString(2853))) { throw new Error("Failed to kill Infector"); } - Pather.pathTo(7788, 5292); + Pather.moveTo(7788, 5292); this.diabloPrep(); Attack.kill(243); // Diablo Pickit.pickItems(); diff --git a/d2bs/kolbot/libs/bots/Follower.js b/d2bs/kolbot/libs/bots/Follower.js index 320572894..0cb909ec8 100644 --- a/d2bs/kolbot/libs/bots/Follower.js +++ b/d2bs/kolbot/libs/bots/Follower.js @@ -313,7 +313,7 @@ function Follower() { target = getUnit(2, 342); if (target) { - Pather.pathTo(target.x - 3, target.y - 1); + Pather.moveTo(target.x - 3, target.y - 1); } Pather.usePortal(null); @@ -735,7 +735,7 @@ function Follower() { break; case "move": coord = CollMap.getRandCoordinate(me.x, -5, 5, me.y, -5, 5); - Pather.pathTo(coord.x, coord.y); + Pather.moveTo(coord.x, coord.y); break; case "wp": diff --git a/d2bs/kolbot/libs/bots/GhostBusters.js b/d2bs/kolbot/libs/bots/GhostBusters.js index 7ed58fabf..b932b8986 100644 --- a/d2bs/kolbot/libs/bots/GhostBusters.js +++ b/d2bs/kolbot/libs/bots/GhostBusters.js @@ -27,7 +27,7 @@ function GhostBusters() { result = Pather.getNearestWalkable(room[0], room[1], 15, 2); if (result) { - Pather.pathTo(result[0], result[1], 3); + Pather.moveTo(result[0], result[1], 3); monList = []; monster = getUnit(1); diff --git a/d2bs/kolbot/libs/bots/MFHelper.js b/d2bs/kolbot/libs/bots/MFHelper.js index 94e6b65f9..e59b5aabf 100644 --- a/d2bs/kolbot/libs/bots/MFHelper.js +++ b/d2bs/kolbot/libs/bots/MFHelper.js @@ -125,7 +125,7 @@ function MFHelper() { result = Pather.getNearestWalkable(room[0], room[1], 10, 2); if (result) { - Pather.pathTo(result[0], result[1], 3); + Pather.moveTo(result[0], result[1], 3); if (!Attack.clear(30)) { return false; diff --git a/d2bs/kolbot/libs/bots/Mephisto.js b/d2bs/kolbot/libs/bots/Mephisto.js index 5f071ef47..75095caef 100644 --- a/d2bs/kolbot/libs/bots/Mephisto.js +++ b/d2bs/kolbot/libs/bots/Mephisto.js @@ -35,7 +35,7 @@ function Mephisto() { if (Attack.validSpot(pos.x, pos.y)) { me.overhead("move, bitch!"); - Pather.pathTo(pos.x, pos.y); + Pather.moveTo(pos.x, pos.y); break; } @@ -58,7 +58,7 @@ function Mephisto() { count = 0; delay(350); - Pather.pathTo(17563, 8072); + Pather.moveTo(17563, 8072); mephisto = getUnit(1, 242); @@ -67,40 +67,40 @@ function Mephisto() { } delay(350); - Pather.pathTo(17575, 8086); + Pather.moveTo(17575, 8086); delay(350); - Pather.pathTo(17584, 8091); + Pather.moveTo(17584, 8091); delay(1200); - Pather.pathTo(17600, 8095); + Pather.moveTo(17600, 8095); delay(550); - Pather.pathTo(17610, 8094); + Pather.moveTo(17610, 8094); delay(2500); Attack.clear(10); - Pather.pathTo(17610, 8094); + Pather.moveTo(17610, 8094); distance = getDistance(me, mephisto); while (distance > 27) { count += 1; - Pather.pathTo(17600, 8095); + Pather.moveTo(17600, 8095); delay(150); - Pather.pathTo(17584, 8091); + Pather.moveTo(17584, 8091); delay(150); - Pather.pathTo(17575, 8086); + Pather.moveTo(17575, 8086); delay(150); - Pather.pathTo(17563, 8072); + Pather.moveTo(17563, 8072); delay(350); - Pather.pathTo(17575, 8086); + Pather.moveTo(17575, 8086); delay(350); - Pather.pathTo(17584, 8091); + Pather.moveTo(17584, 8091); delay(1200); - Pather.pathTo(17600, 8095); + Pather.moveTo(17600, 8095); delay(550); - Pather.pathTo(17610, 8094); + Pather.moveTo(17610, 8094); delay(2500); Attack.clear(10); - Pather.pathTo(17610, 8094); + Pather.moveTo(17610, 8094); distance = getDistance(me, mephisto); @@ -117,7 +117,7 @@ function Mephisto() { coords = [17600, 8125, 17600, 8015, 17643, 8068]; for (i = 0; i < coords.length; i += 2) { - Pather.pathTo(coords[i], coords[i + 1]); + Pather.moveTo(coords[i], coords[i + 1]); if (Config.MFLeader) { Pather.makePortal(); @@ -142,7 +142,7 @@ function Mephisto() { this.killCouncil(); } - Pather.pathTo(17566, 8069); + Pather.moveTo(17566, 8069); if (me.classid === 1) { if (Config.Mephisto.MoatTrick) { @@ -164,21 +164,21 @@ function Mephisto() { Pickit.pickItems(); if (Config.OpenChests) { - Pather.pathTo(17572, 8011); + Pather.moveTo(17572, 8011); Chest.scan(5); //Chest stuff should no longer be necessary but leaving it here just in case Chest.openChests(); - Pather.pathTo(17572, 8125); + Pather.moveTo(17572, 8125); Chest.scan(5); Chest.openChests(); - Pather.pathTo(17515, 8061); + Pather.moveTo(17515, 8061); Chest.scan(5); Chest.openChests(); } if (Config.Mephisto.TakeRedPortal) { - Pather.pathTo(17590, 8068); + Pather.moveTo(17590, 8068); delay(1500); - Pather.pathTo(17601, 8070); + Pather.moveTo(17601, 8070); Pather.usePortal(null); } diff --git a/d2bs/kolbot/libs/bots/OrgTorch.js b/d2bs/kolbot/libs/bots/OrgTorch.js index ebe471c51..10ad6f900 100644 --- a/d2bs/kolbot/libs/bots/OrgTorch.js +++ b/d2bs/kolbot/libs/bots/OrgTorch.js @@ -11,7 +11,7 @@ function OrgTorch() { // Identify & mule this.checkTorch = function () { if (me.area === 136) { - Pather.pathTo(25105, 5140); + Pather.moveTo(25105, 5140); Pather.usePortal(109); } @@ -101,7 +101,7 @@ function OrgTorch() { print("Getting Fade"); Pather.useWaypoint(107); Precast.doPrecast(true); - Pather.pathTo(7811, 5872); + Pather.moveTo(7811, 5872); if (me.classid === 3 && me.getSkill(125, 1)) { Skill.setSkill(125, 0); @@ -187,7 +187,7 @@ function OrgTorch() { findLoc = [20196, 8694, 20308, 8588, 20187, 8639, 20100, 8550, 20103, 8688, 20144, 8709, 20263, 8811, 20247, 8665]; for (i = 0; i < findLoc.length; i += 2) { - Pather.pathTo(findLoc[i], findLoc[i + 1]); + Pather.moveTo(findLoc[i], findLoc[i + 1]); delay(500); if (getUnit(1, 708)) { @@ -209,23 +209,23 @@ function OrgTorch() { break; case 136: // Tristram - Pather.pathTo(25068, 5078); + Pather.moveTo(25068, 5078); Precast.doPrecast(true); findLoc = [25040, 5101, 25040, 5166, 25122, 5170]; for (i = 0; i < findLoc.length; i += 2) { - Pather.pathTo(findLoc[i], findLoc[i + 1]); + Pather.moveTo(findLoc[i], findLoc[i + 1]); } Skill.setSkill(125, 0); this.lure(704); - Pather.pathTo(25129, 5198); + Pather.moveTo(25129, 5198); Skill.setSkill(125, 0); this.lure(704); if (!getUnit(1, 704)) { - Pather.pathTo(25122, 5170); + Pather.moveTo(25122, 5170); } if (Config.OrgTorch.UseSalvation && me.classid === 3 && me.getSkill(125, 1)) { @@ -243,17 +243,17 @@ function OrgTorch() { Attack.init(); } - Pather.pathTo(25162, 5141); + Pather.moveTo(25162, 5141); delay(3250); if (!getUnit(1, 709)) { - Pather.pathTo(25122, 5170); + Pather.moveTo(25122, 5170); } Attack.kill(709); if (!getUnit(1, 705)) { - Pather.pathTo(25122, 5170); + Pather.moveTo(25122, 5170); } Attack.kill(705); diff --git a/d2bs/kolbot/libs/bots/Pindleskin.js b/d2bs/kolbot/libs/bots/Pindleskin.js index 9df4f1770..ce6245cd5 100644 --- a/d2bs/kolbot/libs/bots/Pindleskin.js +++ b/d2bs/kolbot/libs/bots/Pindleskin.js @@ -36,7 +36,7 @@ function Pindleskin() { Precast.doPrecast(true); } - Pather.pathTo(10058, 13234); + Pather.moveTo(10058, 13234); try { Attack.clear(15, 0, getLocaleString(22497)); // Pindleskin diff --git a/d2bs/kolbot/libs/bots/Questing.js b/d2bs/kolbot/libs/bots/Questing.js index be46520eb..3ba88fbb0 100644 --- a/d2bs/kolbot/libs/bots/Questing.js +++ b/d2bs/kolbot/libs/bots/Questing.js @@ -173,7 +173,7 @@ function Questing() { } Precast.doPrecast(true); - Pather.pathTo(3883, 5113); + Pather.moveTo(3883, 5113); Attack.kill(getLocaleString(22435)); // Shenk the Overseer Town.goToTown(); diff --git a/d2bs/kolbot/libs/bots/Rakanishu.js b/d2bs/kolbot/libs/bots/Rakanishu.js index ca00d5ec8..2e74e4a7f 100644 --- a/d2bs/kolbot/libs/bots/Rakanishu.js +++ b/d2bs/kolbot/libs/bots/Rakanishu.js @@ -20,7 +20,7 @@ function Rakanishu() { throw new Error("Failed to move to Tristram"); } - Pather.pathTo(25149, 5180); + Pather.moveTo(25149, 5180); Attack.clear(20, 0xF, 365); // Griswold } diff --git a/d2bs/kolbot/libs/bots/Rushee.js b/d2bs/kolbot/libs/bots/Rushee.js index 0523a693a..dd689a88b 100644 --- a/d2bs/kolbot/libs/bots/Rushee.js +++ b/d2bs/kolbot/libs/bots/Rushee.js @@ -241,7 +241,7 @@ function Rushee() { npc = getUnit(1, NPC.Jerhyn); if (!npc || !npc.openMenu()) { - Pather.pathTo(5166, 5206); + Pather.moveTo(5166, 5206); return false; } @@ -280,7 +280,7 @@ function Rushee() { delay(1500); } - Pather.pathTo(17591, 8070); + Pather.moveTo(17591, 8070); Pather.usePortal(null); break; @@ -553,7 +553,7 @@ function Rushee() { break; case 108: // Chaos Sanctuary Pather.usePortal(108, Config.Leader); - Pather.pathTo(7762, 5268); + Pather.moveTo(7762, 5268); Packet.flash(me.gid); delay(500); Pather.walkTo(7763, 5267, 2); @@ -562,7 +562,7 @@ function Rushee() { delay(500); } - Pather.pathTo(7763, 5267); + Pather.moveTo(7763, 5267); actions.shift(); break; diff --git a/d2bs/kolbot/libs/bots/SealLeader.js b/d2bs/kolbot/libs/bots/SealLeader.js index e27f7dd57..3e15d2022 100644 --- a/d2bs/kolbot/libs/bots/SealLeader.js +++ b/d2bs/kolbot/libs/bots/SealLeader.js @@ -59,7 +59,7 @@ function SealLeader() { for (i = 0; i < positions.length; i += 1) { if (Attack.validSpot(target.x + positions[i][0], target.y + positions[i][1])) { // check if we can move there - Pather.pathTo(target.x + positions[i][0], target.y + positions[i][1]); + Pather.moveTo(target.x + positions[i][0], target.y + positions[i][1]); Skill.setSkill(Config.AttackSkill[2], 0); for (n = 0; n < amount; n += 1) { @@ -183,9 +183,9 @@ function SealLeader() { if (!seal.mode) { if (classid === 394 && Attack.validSpot(seal.x + 15, seal.y)) { // de seis optimization - Pather.pathTo(seal.x + 15, seal.y); + Pather.moveTo(seal.x + 15, seal.y); } else { - Pather.pathTo(seal.x - 5, seal.y - 5); + Pather.moveTo(seal.x - 5, seal.y - 5); } delay(500); @@ -204,9 +204,9 @@ function SealLeader() { this.initLayout(); if (this.vizLayout === 1) { - Pather.pathTo(7708, 5269); + Pather.moveTo(7708, 5269); } else { - Pather.pathTo(7647, 5267); + Pather.moveTo(7647, 5267); } Attack.securePosition(me.x, me.y, 35, 3000, true); @@ -216,9 +216,9 @@ function SealLeader() { this.openSeal(396); if (this.vizLayout === 1) { - Pather.pathTo(7691, 5292); + Pather.moveTo(7691, 5292); } else { - Pather.pathTo(7695, 5316); + Pather.moveTo(7695, 5316); } // Kill Viz @@ -229,9 +229,9 @@ function SealLeader() { say("out"); if (this.seisLayout === 1) { - Pather.pathTo(7767, 5147); + Pather.moveTo(7767, 5147); } else { - Pather.pathTo(7820, 5147); + Pather.moveTo(7820, 5147); } Attack.securePosition(me.x, me.y, 35, 3000, true); @@ -240,9 +240,9 @@ function SealLeader() { this.openSeal(394); if (this.seisLayout === 1) { - Pather.pathTo(7771, 5196); + Pather.moveTo(7771, 5196); } else { - Pather.pathTo(7798, 5186); + Pather.moveTo(7798, 5186); } if (!this.getBoss(getLocaleString(2852))) { @@ -252,9 +252,9 @@ function SealLeader() { say("out"); if (this.infLayout === 1) { - Pather.pathTo(7860, 5314); + Pather.moveTo(7860, 5314); } else { - Pather.pathTo(7909, 5317); + Pather.moveTo(7909, 5317); } Attack.securePosition(me.x, me.y, 35, 3000, true); @@ -263,7 +263,7 @@ function SealLeader() { this.openSeal(392); if (this.infLayout === 2) { - Pather.pathTo(7928, 5295); + Pather.moveTo(7928, 5295); } if (!this.getBoss(getLocaleString(2853))) { @@ -272,9 +272,9 @@ function SealLeader() { this.openSeal(393); say("out"); - Pather.pathTo(7763, 5267); + Pather.moveTo(7763, 5267); Pather.makePortal(); - Pather.pathTo(7788, 5292); + Pather.moveTo(7788, 5292); say("in"); this.diabloPrep(); Attack.kill(243); // Diablo diff --git a/d2bs/kolbot/libs/bots/Travincal.js b/d2bs/kolbot/libs/bots/Travincal.js index d11f3fc4d..a50262744 100644 --- a/d2bs/kolbot/libs/bots/Travincal.js +++ b/d2bs/kolbot/libs/bots/Travincal.js @@ -30,11 +30,11 @@ function Travincal() { orgY = me.y; if (Config.Travincal.PortalLeech) { - Pather.pathTo(orgX + 85, orgY - 139); + Pather.moveTo(orgX + 85, orgY - 139); Attack.securePosition(orgX + 70, orgY - 139, 25, 2000); Attack.securePosition(orgX + 100, orgY - 139, 25, 2000); Attack.securePosition(orgX + 85, orgY - 139, 25, 5000); - Pather.pathTo(orgX + 85, orgY - 139); + Pather.moveTo(orgX + 85, orgY - 139); Pather.makePortal(); delay(1000); Precast.doPrecast(true); @@ -45,7 +45,7 @@ function Travincal() { for (i = 0; i < coords.length; i += 2) { if (i % 4 === 0) { - Pather.pathTo(orgX + coords[i], orgY + coords[i + 1]); + Pather.moveTo(orgX + coords[i], orgY + coords[i + 1]); } else { Skill.cast(143, 0, orgX + coords[i], orgY + coords[i + 1]); Attack.clearList(this.buildList(1)); @@ -54,7 +54,7 @@ function Travincal() { Attack.clearList(this.buildList(0)); } else { - Pather.pathTo(orgX + 101, orgY - 56); + Pather.moveTo(orgX + 101, orgY - 56); // Stack Merc if (me.classid === 4 && !me.getSkill(54, 1) && me.gametype === 1) { diff --git a/d2bs/kolbot/libs/bots/Tristram.js b/d2bs/kolbot/libs/bots/Tristram.js index 13bb592a6..893435c2c 100644 --- a/d2bs/kolbot/libs/bots/Tristram.js +++ b/d2bs/kolbot/libs/bots/Tristram.js @@ -67,7 +67,7 @@ function Tristram() { Attack.securePosition(me.x, me.y, 10, 1000); } - Pather.pathTo(me.x, me.y + 6); + Pather.moveTo(me.x, me.y + 6); if (Config.Tristram.PortalLeech) { Pather.makePortal(); diff --git a/d2bs/kolbot/libs/bots/TristramLeech.js b/d2bs/kolbot/libs/bots/TristramLeech.js index 85a92c611..4150a7964 100644 --- a/d2bs/kolbot/libs/bots/TristramLeech.js +++ b/d2bs/kolbot/libs/bots/TristramLeech.js @@ -86,13 +86,13 @@ function TristramLeech() { Attack.clear(10); } } else { - Pather.pathTo(copyUnit(leaderUnit).x, copyUnit(leaderUnit).y); + Pather.moveTo(copyUnit(leaderUnit).x, copyUnit(leaderUnit).y); Attack.clear(10); } } catch(err){ if (whereisleader.area === me.area){ - Pather.pathTo(whereisleader.x, whereisleader.y); + Pather.moveTo(whereisleader.x, whereisleader.y); Attack.clear(10); } } diff --git a/d2bs/kolbot/libs/bots/Wakka.js b/d2bs/kolbot/libs/bots/Wakka.js index aae60ef5a..7b748269b 100644 --- a/d2bs/kolbot/libs/bots/Wakka.js +++ b/d2bs/kolbot/libs/bots/Wakka.js @@ -221,7 +221,7 @@ function Wakka() { } } - if (Pather.pathTo(path[0].x, path[0].y)) { + if (Pather.moveTo(path[0].x, path[0].y)) { path.shift(); } @@ -360,7 +360,7 @@ function Wakka() { break; } - Pather.pathTo(7767, 5263); + Pather.moveTo(7767, 5263); diablo = getUnit(1, 243); diff --git a/d2bs/kolbot/libs/common/Attack.js b/d2bs/kolbot/libs/common/Attack.js index ae3084ff7..7e81a75e9 100644 --- a/d2bs/kolbot/libs/common/Attack.js +++ b/d2bs/kolbot/libs/common/Attack.js @@ -515,7 +515,7 @@ var Attack = { if (gidAttack[i].attacks > 0 && gidAttack[i].attacks % ((target.spectype & 0x7) ? 4 : 2) === 0) { //print("random move m8"); coord = CollMap.getRandCoordinate(me.x, -1, 1, me.y, -1, 1, 5); - Pather.pathTo(coord.x, coord.y); + Pather.moveTo(coord.x, coord.y); } break; @@ -683,7 +683,7 @@ var Attack = { // Tele in random direction with Blessed Hammer if (gidAttack[i].attacks > 0 && gidAttack[i].attacks % ((target.spectype & 0x7) ? 5 : 15) === 0) { coord = CollMap.getRandCoordinate(me.x, -1, 1, me.y, -1, 1, 4); - Pather.pathTo(coord.x, coord.y); + Pather.moveTo(coord.x, coord.y); } break; @@ -742,7 +742,7 @@ var Attack = { while (true) { if (getDistance(me, x, y) > 5) { - Pather.pathTo(x, y); + Pather.moveTo(x, y); } monster = getUnit(1); @@ -903,7 +903,7 @@ var Attack = { result = Pather.getNearestWalkable(room[0], room[1], 18, 3); if (result) { - Pather.pathTo(result[0], result[1], 3, spectype, true); + Pather.moveTo(result[0], result[1], 3, spectype, true); previousArea = result; //this.countUniques(); @@ -913,7 +913,7 @@ var Attack = { } // Make sure bot does not get stuck in different area. else if (currentArea !== getArea().id) { - Pather.pathTo(previousArea[0], previousArea[1], 3, spectype); + Pather.moveTo(previousArea[0], previousArea[1], 3, spectype); } } @@ -1082,7 +1082,7 @@ var Attack = { if (typeof index === "number") { //print("Dodge build time: " + (getTickCount() - tick)); - return Pather.pathTo(grid[index].x, grid[index].y, 0); + return Pather.moveTo(grid[index].x, grid[index].y, 0); } return false; diff --git a/d2bs/kolbot/libs/common/Attacks/Paladin.js b/d2bs/kolbot/libs/common/Attacks/Paladin.js index f52224557..59fc0f650 100644 --- a/d2bs/kolbot/libs/common/Attacks/Paladin.js +++ b/d2bs/kolbot/libs/common/Attacks/Paladin.js @@ -231,7 +231,7 @@ var ClassAttack = { cy = Math.round(Math.sin(i) * distance); if (Attack.validSpot(unit.x + cx, unit.y + cy)) { - return Pather.pathTo(unit.x + cx, unit.y + cy); + return Pather.moveTo(unit.x + cx, unit.y + cy); } } @@ -295,7 +295,7 @@ var ClassAttack = { if (Math.round(getDistance(me, x, y) > 0)) { if (Pather.teleport && !me.inTown && me.getStat(97, 54)) { if (getDistance(me, x, y) > 40) { - Pather.pathTo(x, y); + Pather.moveTo(x, y); } else { Pather.teleportTo(x, y, 3); } diff --git a/d2bs/kolbot/libs/common/Misc.js b/d2bs/kolbot/libs/common/Misc.js index fc9f927de..8db6437fa 100644 --- a/d2bs/kolbot/libs/common/Misc.js +++ b/d2bs/kolbot/libs/common/Misc.js @@ -919,7 +919,7 @@ var Chest = { return true; } - if (Pather.pathTo(unit.x + 1, unit.y + 2, 0, clearPath) && getDistance(me, unit.x + 1, unit.y + 2) < 5) { + if (Pather.moveTo(unit.x + 1, unit.y + 2, 0, clearPath) && getDistance(me, unit.x + 1, unit.y + 2) < 5) { //Misc.click(0, 0, unit); sendPacket(1, 0x13, 4, unit.type, 4, unit.gid); @@ -1351,14 +1351,14 @@ var Misc = { coords = shrineLocs.shift(); - Pather.pathTo(coords[0], coords[1], 2); + Pather.moveTo(coords[0], coords[1], 2); shrine = getUnit(2, "shrine"); if (shrine) { do { if (shrine.objtype === type && shrine.mode === 0) { - Pather.pathTo(shrine.x - 2, shrine.y - 2); + Pather.moveTo(shrine.x - 2, shrine.y - 2); if (!use || this.getShrine(shrine)) { return true; diff --git a/d2bs/kolbot/libs/common/Pather.js b/d2bs/kolbot/libs/common/Pather.js index 2071c4674..a7da217f6 100644 --- a/d2bs/kolbot/libs/common/Pather.js +++ b/d2bs/kolbot/libs/common/Pather.js @@ -149,7 +149,7 @@ var Pather = { }, /* - Pather.pathTo(x, y, retry, clearPath, pop, maneuvering); + Pather.moveTo(x, y, retry, clearPath, pop, maneuvering); x - the x coord to path to y - the y coord to path to retry - the number of times to retry before aborting @@ -157,7 +157,7 @@ var Pather = { pop - removes the first path node before pathing maneuvering - set to true if only moving short distances - prevents performing node actions */ - pathTo: function(x, y, retry, clearPath, pop, maneuvering) { + moveTo: function(x, y, retry, clearPath, pop, maneuvering) { //Validate Arguments if (getDistance(me, x, y) < 2) return true; //Don't bother if the distance is really close @@ -166,10 +166,10 @@ var Pather = { return false; if (x === undefined || y === undefined) - throw new Error("Pather.pathTo: Function must be called with at least 2 arguments."); + throw new Error("Pather.moveTo: Function must be called with at least 2 arguments."); if (typeof x !== "number" || typeof y !== "number") - throw new Error("Pather.pathTo: Coords must be numbers"); + throw new Error("Pather.moveTo: Coords must be numbers"); if (maneuvering === undefined) maneuvering = false; @@ -295,10 +295,16 @@ var Pather = { }, + /* + Pather.maneuverTo(x, y, retry, clearPath, pop); + Shortcut method for Pather.moveTo + Useful when the bot should move from point A to B without taking diversions (chests/shrines/etc) + + */ maneuverTo: function(x, y, retry, clearPath, pop) { //print("Maneuvering"); - return this.pathTo(x, y, retry, clearPath, pop, true); + return this.moveTo(x, y, retry, clearPath, pop, true); }, @@ -549,15 +555,15 @@ ModeLoop: } if (unit instanceof PresetUnit) { - return this.pathTo(unit.roomx * 5 + unit.x + offX, unit.roomy * 5 + unit.y + offY, 3, clearPath); + return this.moveTo(unit.roomx * 5 + unit.x + offX, unit.roomy * 5 + unit.y + offY, 3, clearPath); } if (!useTeleport) { // The unit will most likely be moving so call the first walk with 'pop' parameter - this.pathTo(unit.x + offX, unit.y + offY, 0, clearPath, true); + this.moveTo(unit.x + offX, unit.y + offY, 0, clearPath, true); } - return this.pathTo(unit.x + offX, unit.y + offY, useTeleport && unit.type && unit.type === 1 ? 3 : 0, clearPath, pop); + return this.moveTo(unit.x + offX, unit.y + offY, useTeleport && unit.type && unit.type === 1 ? 3 : 0, clearPath, pop); }, /* @@ -597,7 +603,7 @@ ModeLoop: throw new Error("moveToPreset: Couldn't find preset unit - id " + unitId); } - return this.pathTo(presetUnit.roomx * 5 + presetUnit.x + offX, presetUnit.roomy * 5 + presetUnit.y + offY, 3, clearPath, pop); + return this.moveTo(presetUnit.roomx * 5 + presetUnit.x + offX, presetUnit.roomy * 5 + presetUnit.y + offY, 3, clearPath, pop); }, /* @@ -648,7 +654,7 @@ ModeLoop: return false; } - if (!this.pathTo(dest[0], dest[1], 3, clearPath)) { + if (!this.moveTo(dest[0], dest[1], 3, clearPath)) { return false; } @@ -661,7 +667,7 @@ ModeLoop: targetRoom = this.getNearestRoom(areas[i]); if (targetRoom) { - this.pathTo(targetRoom[0], targetRoom[1]); + this.moveTo(targetRoom[0], targetRoom[1]); } else { // might need adjustments return false; @@ -817,7 +823,7 @@ ModeLoop: } coord = CollMap.getRandCoordinate(me.x, -1, 1, me.y, -1, 1, 3); - this.pathTo(coord.x, coord.y); + this.moveTo(coord.x, coord.y); } return false; @@ -885,7 +891,7 @@ ModeLoop: } coord = CollMap.getRandCoordinate(me.x, -1, 1, me.y, -1, 1, 3); - this.pathTo(coord.x, coord.y); + this.moveTo(coord.x, coord.y); } return targetArea ? me.area === targetArea : me.area !== preArea; @@ -1423,7 +1429,7 @@ MainLoop: this.useWaypoint(target.course[0], !this.plotCourse_openedWpMenu); Precast.doPrecast(false); } else if (me.area === 109 && target.course[0] === 110) { // Harrogath -> Bloody Foothills - this.pathTo(5026, 5095); + this.moveTo(5026, 5095); unit = getUnit(2, 449); // Gate @@ -1479,7 +1485,7 @@ MainLoop: } } } else if (me.area === 54 && target.course[0] === 74) { // Palace -> Arcane - this.pathTo(10073, 8670); + this.moveTo(10073, 8670); this.usePortal(null); } else if (me.area === 109 && target.course[0] === 121) { // Harrogath -> Nihlathak's Temple Town.move(NPC.Anya); diff --git a/d2bs/kolbot/tools/AntiHostile.js b/d2bs/kolbot/tools/AntiHostile.js index a750d29ea..a560e5b08 100644 --- a/d2bs/kolbot/tools/AntiHostile.js +++ b/d2bs/kolbot/tools/AntiHostile.js @@ -176,7 +176,7 @@ function main() { coordy = Math.round((Math.sin((angle + angles[i]) * Math.PI / 180)) * range + unit.y); // unit.targety if (Attack.validSpot(coordx, coordy)) { - return Pather.pathTo(coordx, coordy); + return Pather.moveTo(coordx, coordy); } } @@ -216,7 +216,7 @@ function main() { case 1: // Sorceress prevPos = {x: me.x, y: me.y}; this.pause(); - Pather.pathTo(15103, 5247); + Pather.moveTo(15103, 5247); while (!this.findPlayer() && hostiles.length > 0) { if (!me.getState(121)) { @@ -241,7 +241,7 @@ function main() { prevPos = {x: me.x, y: me.y}; this.pause(); - Pather.pathTo(15103, 5247); + Pather.moveTo(15103, 5247); while (!this.findPlayer() && hostiles.length > 0) { // Tornado path is a function of target x. Slight randomization will make sure it can't always miss @@ -252,7 +252,7 @@ function main() { case 6: // Assassin prevPos = {x: me.x, y: me.y}; this.pause(); - Pather.pathTo(15103, 5247); + Pather.moveTo(15103, 5247); while (!this.findPlayer() && hostiles.length > 0) { if (Config.UseTraps) { @@ -276,7 +276,7 @@ function main() { // Player left, return to old position if (!hostiles.length && prevPos) { - Pather.pathTo(prevPos.x, prevPos.y); + Pather.moveTo(prevPos.x, prevPos.y); this.resume(); // Reset position @@ -363,7 +363,7 @@ function main() { } } - Pather.pathTo(prevPos.x, prevPos.y); + Pather.moveTo(prevPos.x, prevPos.y); this.resume(); } } diff --git a/d2bs/kolbot/tools/RushThread.js b/d2bs/kolbot/tools/RushThread.js index 76245c5b8..f39c2f7c7 100644 --- a/d2bs/kolbot/tools/RushThread.js +++ b/d2bs/kolbot/tools/RushThread.js @@ -103,7 +103,7 @@ function main() { Pather.useWaypoint(35, true); Precast.doPrecast(true); - if (!Pather.moveToExit([36, 37], true) || !Pather.pathTo(22582, 9612)) { + if (!Pather.moveToExit([36, 37], true) || !Pather.moveTo(22582, 9612)) { throw new Error("andy failed"); } @@ -112,13 +112,13 @@ function main() { say("1"); while (!this.playerIn()) { - Pather.pathTo(22582, 9612); + Pather.moveTo(22582, 9612); delay(250); } Attack.kill(156); say("2"); - Pather.pathTo(22582, 9612); + Pather.moveTo(22582, 9612); while (this.playerIn()) { delay(250); @@ -169,7 +169,7 @@ function main() { Pather.useWaypoint(44, true); Precast.doPrecast(true); - if (!Pather.moveToExit([45, 58, 61], true) || !Pather.pathTo(15044, 14045)) { + if (!Pather.moveToExit([45, 58, 61], true) || !Pather.moveTo(15044, 14045)) { throw new Error("amulet failed"); } @@ -342,12 +342,12 @@ function main() { Pather.teleport = false; - Pather.pathTo(22579, 15706); + Pather.moveTo(22579, 15706); Pather.teleport = true; - Pather.pathTo(22577, 15649, 10); - Pather.pathTo(22577, 15609, 10); + Pather.moveTo(22577, 15649, 10); + Pather.moveTo(22577, 15609, 10); Pather.makePortal(); say("1"); @@ -361,7 +361,7 @@ function main() { Pather.useWaypoint(52); Pather.moveToExit([51, 50], true); - Pather.pathTo(10022, 5047); + Pather.moveTo(10022, 5047); say("a3"); Town.goToTown(3); Town.doChores(); @@ -381,7 +381,7 @@ function main() { var coords = [me.x, me.y]; - Pather.pathTo(coords[0] + 23, coords[1] - 102); + Pather.moveTo(coords[0] + 23, coords[1] - 102); Pather.makePortal(); Attack.securePosition(me.x, me.y, 40, 3000); say("1"); @@ -390,9 +390,9 @@ function main() { delay(250); } - Pather.pathTo(coords[0] + 30, coords[1] - 134); - Pather.pathTo(coords[0] + 86, coords[1] - 130); - Pather.pathTo(coords[0] + 71, coords[1] - 94); + Pather.moveTo(coords[0] + 30, coords[1] - 134); + Pather.moveTo(coords[0] + 86, coords[1] - 130); + Pather.moveTo(coords[0] + 71, coords[1] - 94); Attack.securePosition(me.x, me.y, 40, 3000); /*Attack.kill(getLocaleString(2863)); @@ -400,7 +400,7 @@ function main() { Attack.kill(getLocaleString(2860));*/ say("2"); - Pather.pathTo(coords[0] + 23, coords[1] - 102); + Pather.moveTo(coords[0] + 23, coords[1] - 102); Pather.usePortal(null, me.name); return true; @@ -415,7 +415,7 @@ function main() { Pather.useWaypoint(101, true); Precast.doPrecast(true); Pather.moveToExit(102, true); - Pather.pathTo(17692, 8023); + Pather.moveTo(17692, 8023); Pather.makePortal(); delay(2000); say("1"); @@ -424,10 +424,10 @@ function main() { delay(250); } - Pather.pathTo(17591, 8070); + Pather.moveTo(17591, 8070); Attack.kill(242); Pickit.pickItems(); - Pather.pathTo(17692, 8023); + Pather.moveTo(17692, 8023); Pather.makePortal(); say("2"); @@ -435,7 +435,7 @@ function main() { delay(250); } - Pather.pathTo(17591, 8070); + Pather.moveTo(17591, 8070); Attack.securePosition(me.x, me.y, 40, 3000); hydra = getUnit(1, getLocaleString(3325)); @@ -449,7 +449,7 @@ function main() { } Pather.makePortal(); - Pather.pathTo(17581, 8070); + Pather.moveTo(17581, 8070); say("1"); while (!this.playerIn()) { @@ -457,7 +457,7 @@ function main() { } say("a4"); - //Pather.pathTo(17591, 8070); + //Pather.moveTo(17591, 8070); while (!this.playersInAct(4)) { delay(250); @@ -537,7 +537,7 @@ function main() { for (i = 0; i < positions.length; i += 1) { if (Attack.validSpot(target.x + positions[i][0], target.y + positions[i][1])) { // check if we can move there - Pather.pathTo(target.x + positions[i][0], target.y + positions[i][1]); + Pather.moveTo(target.x + positions[i][0], target.y + positions[i][1]); Skill.setSkill(Config.AttackSkill[2], 0); for (n = 0; n < amount; n += 1) { @@ -591,7 +591,7 @@ function main() { Town.doChores(); Pather.useWaypoint(107, true); Precast.doPrecast(true); - Pather.pathTo(7790, 5544); + Pather.moveTo(7790, 5544); this.initLayout(); if (!this.openSeal(395) || !this.openSeal(396)) { @@ -599,9 +599,9 @@ function main() { } if (this.vizLayout === 1) { - Pather.pathTo(7691, 5292); + Pather.moveTo(7691, 5292); } else { - Pather.pathTo(7695, 5316); + Pather.moveTo(7695, 5316); } if (!this.getBoss(getLocaleString(2851))) { @@ -613,9 +613,9 @@ function main() { } if (this.seisLayout === 1) { - Pather.pathTo(7771, 5196); + Pather.moveTo(7771, 5196); } else { - Pather.pathTo(7798, 5186); + Pather.moveTo(7798, 5186); } if (!this.getBoss(getLocaleString(2852))) { @@ -629,23 +629,23 @@ function main() { if (this.infLayout === 1) { delay(1); } else { - Pather.pathTo(7928, 5295); // temp + Pather.moveTo(7928, 5295); // temp } if (!this.getBoss(getLocaleString(2853))) { throw new Error("Failed to kill Infector"); } - Pather.pathTo(7763, 5267); + Pather.moveTo(7763, 5267); Pather.makePortal(); - Pather.pathTo(7727, 5267); + Pather.moveTo(7727, 5267); say("1"); while (!this.playerIn()) { delay(250); } - Pather.pathTo(7763, 5267); + Pather.moveTo(7763, 5267); while (!getUnit(1, 243)) { delay(500); @@ -700,7 +700,7 @@ function main() { throw new Error("Failed to go to Ancients way."); } - Pather.pathTo(10089, 12622); + Pather.moveTo(10089, 12622); Pather.makePortal(); say("3"); @@ -708,7 +708,7 @@ function main() { delay(250); } - Pather.pathTo(10048, 12628); + Pather.moveTo(10048, 12628); altar = getUnit(2, 546); @@ -726,7 +726,7 @@ function main() { } Attack.clear(50); - Pather.pathTo(10089, 12622); + Pather.moveTo(10089, 12622); me.cancel(); Pather.makePortal(); @@ -766,7 +766,7 @@ function main() { } if (getDistance(me, 15093, 5029) > 3) { - Pather.pathTo(15093, 5029); + Pather.moveTo(15093, 5029); } if (Config.AttackSkill[4] > 0) { @@ -855,7 +855,7 @@ function main() { } for (i = 0; i < pos.length; i += 2) { - Pather.pathTo(pos[i], pos[i + 1]); + Pather.moveTo(pos[i], pos[i + 1]); Attack.clear(30); } }; @@ -866,7 +866,7 @@ function main() { if (hydra) { do { if (hydra.mode !== 12 && hydra.getStat(172) !== 2) { - Pather.pathTo(15118, 5002); + Pather.moveTo(15118, 5002); while (hydra.mode !== 12) { delay(500); @@ -894,17 +894,17 @@ function main() { } } - Pather.pathTo(15113, 5040); + Pather.moveTo(15113, 5040); Attack.clear(15); this.clearThrone(); tick = getTickCount(); - Pather.pathTo(15093, me.classid === 3 ? 5029 : 5039); + Pather.moveTo(15093, me.classid === 3 ? 5029 : 5039); MainLoop: while (true) { if (getDistance(me, 15093, me.classid === 3 ? 5029 : 5039) > 3) { - Pather.pathTo(15093, me.classid === 3 ? 5029 : 5039); + Pather.moveTo(15093, me.classid === 3 ? 5029 : 5039); } if (!getUnit(1, 543)) { @@ -964,7 +964,7 @@ MainLoop: } this.clearThrone(); - Pather.pathTo(15092, 5011); + Pather.moveTo(15092, 5011); Precast.doPrecast(true); while (getUnit(1, 543)) { @@ -981,9 +981,9 @@ MainLoop: throw new Error("Couldn't find portal."); } - Pather.pathTo(15213, 5908); + Pather.moveTo(15213, 5908); Pather.makePortal(); - Pather.pathTo(15170, 5950); + Pather.moveTo(15170, 5950); delay(1000); say("3"); @@ -991,7 +991,7 @@ MainLoop: delay(250); } - Pather.pathTo(15134, 5923); + Pather.moveTo(15134, 5923); Attack.kill(544); // Baal Pickit.pickItems(); @@ -1255,7 +1255,7 @@ MainLoop: Pather.useWaypoint(111, true); Precast.doPrecast(false); - Pather.pathTo(3846, 5120); + Pather.moveTo(3846, 5120); Attack.securePosition(me.x, me.y, 30, 3000); Pather.makePortal(); say("1"); @@ -1266,7 +1266,7 @@ MainLoop: Attack.kill(getLocaleString(22435)); // Shenk Pickit.pickItems(); - Pather.pathTo(3846, 5120); + Pather.moveTo(3846, 5120); say("2"); while (this.playerIn()) {