Quote:
Originally Posted by Finallyb
klar kann man das, wieso nicht?
das meiste ist schon da. du kannst zum einen das bo-script verwenden und zum anderen lohnt sich ein blick auf das vizer.js (unter bots).
da hast du schon mal ins cs teln und seals öffnen.
das kopierst du, wirfst alles ab line 41 raus und kopierst die star koordinaten aus dem dia script rein. dann fehlt noch eine tp- und toTown-anweisung und im einfachsten fall eine endlosschleife mit nem delay drin.
|
müsste das hier für den anfang okay sein? kann das überhaupt nicht mit dem script umschreiben
Code:
/**
* @filename Diablo.js
* @author kolton
* @desc clear Chaos Sanctuary and kill Diablo
*/
function Diablo() {
// sort functions
this.entranceSort = function (a, b) {
return getDistance(a.x, a.y, 7790, 5544) - getDistance(b.x, b.y, 7790, 5544);
};
this.starSort = function (a, b) {
return getDistance(a.x, a.y, 7774, 5305) - getDistance(b.x, b.y, 7774, 5305);
};
// general functions
this.getLayout = function (seal, value) {
var sealPreset = getPresetUnit(108, 2, seal);
if (!seal) {
throw new Error("Seal preset not found. Can't continue.");
}
if (sealPreset.roomy * 5 + sealPreset.y === value || sealPreset.roomx * 5 + sealPreset.x === value) {
return 1;
}
return 2;
};
this.initLayout = function () {
this.seisLayout = this.getLayout(394, 7773);
};
this.openSeal = function (classid) {
var i, seal, warn;
switch (classid) {
case 396:
case 394:
case 392:
warn = true;
break;
default:
warn = false;
break;
}
for (i = 0; i < 5; i += 1) {
Pather.moveToPreset(me.area, 2, classid, classid === 394 ? 5 : 2, classid === 394 ? 5 : 0);
seal = getUnit(2, classid);
if (!seal) {
return false;
}
if (seal.mode) { // for pubbies
if (warn) {
say(Config.Diablo.SealWarning);
}
return true;
}
warn = false;
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 = getUnit(2, 131);
for (i = 0; i < 16; i += 1) {
boss = getUnit(1, name);
if (boss) {
return Attack.clear(40, 0, name);
}
delay(250);
}
return !!glow;
};
this.seisSeal = function () {
print("Seis layout " + this.seisLayout);
this.followPath(this.seisLayout === 1 ? this.starToSeisA : this.starToSeisB, this.starSort);
if (!this.openSeal(394)) {
throw new Error("Failed to open de Seis seal.");
}
if (this.seisLayout === 1) {
Pather.moveTo(7771, 5196);
} else {
Pather.moveTo(7798, 5186);
}
if (!this.getBoss(getLocaleString(2852))) {
throw new Error("Failed to kill de Seis");
}
return true;
};