So, I have this written by sort of combining codes for tristram leech and travincal leech, it functions, but only for the first tomb, then as soon as my leader leaves the tomb, my bot exits the game - I just want to figure out how to either have it follow him into the next tomb, or go to town, and take his next tp - can anyone help? Here is the code
/**
@filename TombLeech.js
@author ToS/XxXGoD/YGM
@desc Tomb Leech (Helper)
*/
function TombLeech() {
var leader, i;
// Get leader's Unit
this.getLeaderUnit = function (name) {
var player = getUnit(0, name);
if (player) {
do {
if (player.mode !== 0 && player.mode !== 17) {
return player;
}
} while (player.getNext());
}
return false;
};
Town.doChores();
Pather.useWaypoint(40); // Back To Rouge
Town.move("portalspot"); // Portal Spot
leader = Config.Leader;
for (i = 0; i < 40; i += 1) {
var whereisleader = getParty(leader);
if (whereisleader) {
if (whereisleader.area === 66) {
break;
}
}
delay(300);
}
if (me.inTown && Pather.usePortal((66 <= 72), Config.Leader)) {
}
delay(50);
while (whereisleader.area === 66) {
var whereisleader = getParty(leader);
var leaderUnit = this.getLeaderUnit(leader);
if (whereisleader.area === me.area){
try{
if (copyUnit(leaderUnit).x) {
if (getDistance(me, leaderUnit) > 30) {
Pather.moveToUnit(leaderUnit);
Attack.clear(10);
}
} else {
Pather.moveTo(copyUnit(leaderUnit).x, copyUnit(leaderUnit).y);
Attack.clear(10);
}
}
catch(err){
if (whereisleader.area === me.area){
Pather.moveTo(whereisleader.x, whereisleader.y);
Attack.clear(10);
}
}
delay(100);
}
}
return true;
So, I have this written by sort of combining codes for tristram leech and travincal leech, it functions, but only for the first tomb, then as soon as my leader leaves the tomb, my bot exits the game - I just want to figure out how to either have it follow him into the next tomb, or go to town, and take his next tp - can anyone help? Here is the code
/**
function TombLeech() {
}