Skip to content

Commit

Permalink
Cubing fails with telek open stash
Browse files Browse the repository at this point in the history
Opening stash with telek and opening cube causes both cube and stash to be closed on ending the interaction. This causes failure to stash item from stash -> cube.
  • Loading branch information
noah- authored Mar 22, 2018
1 parent 099a6ac commit 07c7337
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions d2bs/kolbot/libs/common/Town.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ var Town = {
pot = this.getPotion(npc, Config.BeltColumn[i]);

if (pot) {
//print("ÿc2column ÿc0" + i + "ÿc2 needs ÿc0" + col[i] + " ÿc2potions");
//print("ÿc2column ÿc0" + i + "ÿc2 needs ÿc0" + col[i] + " ÿc2potions");

// Shift+buy will trigger if there's no empty columns or if only the current column is empty
if (useShift) {
Expand Down Expand Up @@ -771,7 +771,7 @@ MainLoop:
Misc.itemLogger("Dropped", item, "fieldID");

if (Config.DroppedItemsAnnounce.Enable && Config.DroppedItemsAnnounce.Quality.indexOf(item.quality) > -1) {
say("Dropped: [" + Pickit.itemQualityToName(item.quality).charAt(0).toUpperCase() + Pickit.itemQualityToName(item.quality).slice(1) + "] " + item.fname.split("\n").reverse().join(" ").replace(/ÿc[0-9!"+<;.*]/, "").trim());
say("Dropped: [" + Pickit.itemQualityToName(item.quality).charAt(0).toUpperCase() + Pickit.itemQualityToName(item.quality).slice(1) + "] " + item.fname.split("\n").reverse().join(" ").replace(/ÿc[0-9!"+<;.*]/, "").trim());

if (Config.DroppedItemsAnnounce.LogToOOG && Config.DroppedItemsAnnounce.OOGQuality.indexOf(item.quality) > -1) {
Misc.logItem("Field Dropped", item, result.line);
Expand Down Expand Up @@ -895,7 +895,7 @@ CursorLoop:
return false;
}

print("ÿc4MiniShopBotÿc0: Scanning " + npc.itemcount + " items.");
print("ÿc4MiniShopBotÿc0: Scanning " + npc.itemcount + " items.");

do {
if (this.ignoredItemTypes.indexOf(item.itemType) === -1) {
Expand Down Expand Up @@ -941,7 +941,7 @@ CursorLoop:
if (NTIPAliasClassID.hasOwnProperty(Config.GambleItems[i].replace(/\s+/g, "").toLowerCase())) {
this.gambleIds.push(NTIPAliasClassID[Config.GambleItems[i].replace(/\s+/g, "").toLowerCase()]);
} else {
Misc.errorReport("ÿc1Invalid gamble entry:ÿc0 " + Config.GambleItems[i]);
Misc.errorReport("ÿc1Invalid gamble entry:ÿc0 " + Config.GambleItems[i]);
}
} else {
this.gambleIds.push(Config.GambleItems[i]);
Expand Down Expand Up @@ -1242,8 +1242,8 @@ CursorLoop:
delay(me.ping * 2 + 500);

if (cubeItems[0].bodylocation === bodyLoc) {
print(cubeItems[0].fname.split("\n").reverse().join(" ").replace(/ÿc[0-9!"+<;.*]/, "").trim() + " successfully repaired and equipped.");
D2Bot.printToConsole(cubeItems[0].fname.split("\n").reverse().join(" ").replace(/ÿc[0-9!"+<;.*]/, "").trim() + " successfully repaired and equipped.", 5);
print(cubeItems[0].fname.split("\n").reverse().join(" ").replace(/ÿc[0-9!"+<;.*]/, "").trim() + " successfully repaired and equipped.");
D2Bot.printToConsole(cubeItems[0].fname.split("\n").reverse().join(" ").replace(/ÿc[0-9!"+<;.*]/, "").trim() + " successfully repaired and equipped.", 5);

return true;
}
Expand Down Expand Up @@ -1358,7 +1358,7 @@ CursorLoop:
repairAction.push("repair");
}
} else {
print("ÿc4Town: ÿc1Can't afford repairs.");
print("ÿc4Town: ÿc1Can't afford repairs.");
}

return repairAction;
Expand Down Expand Up @@ -1585,21 +1585,16 @@ MainLoop:
return true;
}

var i, tick, stash,
telekinesis = me.classid === 1 && me.getSkill(43, 1);
var i, tick, stash;

for (i = 0; i < 5; i += 1) {
this.move("stash");

stash = getUnit(2, 267);

if (stash) {
if (telekinesis) {
Skill.cast(43, 0, stash);
} else {
Misc.click(0, 0, stash);
//stash.interact();
}
Misc.click(0, 0, stash);
//stash.interact();

tick = getTickCount();

Expand All @@ -1622,8 +1617,6 @@ MainLoop:
} else {
this.move("stash");
}

telekinesis = false;
}
}

Expand Down Expand Up @@ -2084,7 +2077,7 @@ MainLoop:

moveToSpot: function (spot) {
var i, path, townSpot,
longRange = (me.classid === 1 && this.telekinesis && me.getSkill(43, 1) && ["stash", "portalspot"].indexOf(spot) > -1) || spot === "waypoint";
longRange = (me.classid === 1 && this.telekinesis && me.getSkill(43, 1) && ["portalspot"].indexOf(spot) > -1) || spot === "waypoint";

if (!this.act[me.act - 1].hasOwnProperty("spot") || !this.act[me.act - 1].spot.hasOwnProperty(spot)) {
return false;
Expand Down Expand Up @@ -2222,4 +2215,4 @@ MainLoop:

return true;
}
};
};

0 comments on commit 07c7337

Please sign in to comment.