Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a way for some follower to not make some mfleader area run #2852

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
3c31518
Adding core 1.5 branch
kolton Feb 1, 2014
de6e32b
Updated readme
kolton Feb 1, 2014
b19dd4d
Merge commit '727298c755eab9660f0bb6d6ba20f0008bb3d13b' into CORE15
kolton Feb 11, 2014
9101c7e
Merge commit 'f01bb0e069d1bb65ec1a81db2e86dc10fd82dd18' into CORE15
kolton Feb 13, 2014
317e365
Update 1.5 core
kolton May 15, 2014
4dab7c0
May 21 update
kolton May 21, 2014
2e1d1fe
removed some obsolete code
kolton May 21, 2014
e6e7645
autoequip fixes
kolton May 22, 2014
48cae7f
ladder reset hype fix pack
kolton May 24, 2014
1feb682
aufiequip fixup
kolton May 25, 2014
f49387d
autoequip again
kolton May 25, 2014
3d74c98
necro fix
kolton May 25, 2014
f4acad7
diablo helper fix
kolton May 31, 2014
aae328c
Update 1.5 core
kolton Jun 3, 2014
10b1684
jun 3
kolton Jun 3, 2014
0d34b55
jun 10
kolton Jun 10, 2014
698f0b7
jun 19
kolton Jun 19, 2014
ec842ea
D2BotChannel.dbj - fixed a bug where it would keep trying to rejoin i…
kolton Nov 20, 2014
49d980b
shopbot hotfix
kolton Nov 20, 2014
4882d86
diablohelper fix
kolton Nov 20, 2014
c032591
removed a beep() accidentally left in
kolton Nov 20, 2014
629155b
fixed drinking potions from inv and [toblock], ignore soj sales and c…
kolton Nov 21, 2014
26bedce
fixes
kolton Nov 21, 2014
d9a2328
22.nov
kolton Nov 22, 2014
ac1bb57
rushee fix
kolton Nov 24, 2014
6229b89
fix check for cain quest
cuss Nov 24, 2014
97871c4
added a new character config option
cuss Nov 25, 2014
485dd78
Tristram.js - check for and do Cain quest if needed
cuss Nov 25, 2014
f2b4d7e
Merge pull request #98 from cuss/CORE15
kolton Nov 25, 2014
169b476
fix missed ; in Tristram.js
cuss Nov 27, 2014
a0a1ac1
mule fix
kolton Nov 29, 2014
20742d2
rusher meph fix
kolton Nov 29, 2014
e42ecd4
Merge pull request #100 from cuss/CORE15
kolton Nov 29, 2014
3599736
a few fixes to Tristram.js
cuss Nov 30, 2014
a2c4edc
Merge remote-tracking branch 'upstream/CORE15' into CORE15
cuss Nov 30, 2014
af7a846
3.dec
kolton Dec 3, 2014
f7ec689
Merge pull request #103 from cuss/CORE15
kolton Dec 3, 2014
1b1fc27
14.dec
kolton Dec 14, 2014
15249d9
Merge branch 'CORE15' of https://github.com/kolton/d2bot-with-kolbot …
kolton Dec 14, 2014
8e4e745
17.dec
kolton Dec 17, 2014
dc15b0e
barb stuff
kolton Dec 17, 2014
e02e387
event mixup fix
kolton Dec 18, 2014
769f6f6
typos in Attack.txt
cuss Dec 29, 2014
f9b5835
Merge remote-tracking branch 'upstream/CORE15' into CORE15
cuss Dec 29, 2014
cc45943
typo in kolton.nip
cuss Dec 29, 2014
cc8491f
Merge pull request #110 from cuss/CORE15
kolton Jan 17, 2015
66705dd
Jan 17.
kolton Jan 17, 2015
147cf5b
1. Feb
kolton Feb 1, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified D2Bot.exe
Binary file not shown.
Binary file modified D2Bot.pdb
Binary file not shown.
Binary file removed Meebey.SmartIrc4net.dll
Binary file not shown.
Binary file removed Newtonsoft.Json.dll
Binary file not shown.
Binary file removed ObjectListView.dll
Binary file not shown.
Binary file removed ObjectListView.pdb
Binary file not shown.
4 changes: 3 additions & 1 deletion Readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
This is the MASTER (also known as TRUNK) branch.
This is the CORE15 branch.
It will contain most recent D2BS 1.5 core changes.
The rest will be the same as in MASTER branch.

The package contains 3 distinct components:
D2BS - core
Expand Down
Binary file modified d2bs/D2BS.dll
Binary file not shown.
Binary file modified d2bs/D2BS.pdb
Binary file not shown.
Binary file modified d2bs/D2M.dll
Binary file not shown.
Binary file removed d2bs/js32.dll
Binary file not shown.
167 changes: 124 additions & 43 deletions d2bs/kolbot/D2BotChannel.dbj
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ var gameStart, handle, ingame, firstLogin, useChat,
channelTick = getTickCount(),
lastGameStatus = "ready",
fListTick = 0,
loginFail = 0,
retry = 0,
badGames = [],
joinInfo = {
gameName: "",
gamePass: "",
Expand Down Expand Up @@ -177,7 +177,9 @@ function ScriptMsgEvent(msg) {

break;
case "getMuleMode":
if (AutoMule.torchCheck) {
if (AutoMule.torchAnniCheck === 2) {
scriptBroadcast("2");
} else if (AutoMule.torchAnniCheck === 1) {
scriptBroadcast("1");
} else if (AutoMule.check) {
scriptBroadcast("0");
Expand Down Expand Up @@ -226,20 +228,29 @@ function main() {
delay(500);
}

if (gameInfo.error === "@error") {
timeoutDelay("Crash Delay", StarterConfig.CrashDelay * 1e3);
if (gameInfo.error) {
if (!!DataFile.getStats().debugInfo) {
gameInfo.crashInfo = DataFile.getStats().debugInfo;

D2Bot.printToConsole("Crash Info: Script: " + JSON.parse(gameInfo.crashInfo).currScript + " Area: " + JSON.parse(gameInfo.crashInfo).area, 10);
}

ControlAction.timeoutDelay("Crash Delay", StarterConfig.CrashDelay * 1e3);
D2Bot.updateRuns();
}

DataFile.updateStats("debugInfo", JSON.stringify({currScript: "none", area: "out of game"}));

while (true) {
while (me.ingame) { // returns true before actually in game so we can't only use this check
if (me.gameReady) { // returns false when switching acts so we can't use while
joinInfo.inGame = true;

if (!ingame) {
print("Updating Status");
D2Bot.updateStatus("Game: " + me.gamename);
//D2Bot.updateStatus("Game: " + me.gamename);

badGames.push(joinInfo.gameName);
joinInfo.oldGame = me.gamename;
lastGameStatus = "ingame";
ingame = true;
Expand All @@ -248,6 +259,7 @@ function main() {
DataFile.updateStats("runs", gameCount);
}

D2Bot.updateStatus("Game: " + me.gamename + timer(gameStart));
}

delay(1000);
Expand All @@ -270,7 +282,9 @@ MainSwitch:
case 1: // Lobby
D2Bot.updateStatus("Lobby");

loginFail = 0;
if (!firstLogin) {
firstLogin = true;
}

ControlAction.click(6, 27, 480, 120, 20);

Expand Down Expand Up @@ -359,6 +373,28 @@ MainSwitch:

switch (lastGameStatus) {
case "pending": // Most likely FTJ (can't detect it directly)
string = "";
text = ControlAction.getText(4, 438, 300, 326, 150);

if (text) {
for (i = 0; i < text.length; i += 1) {
string += text[i];

if (i !== text.length - 1) {
string += " ";
}
}

// Didn't meet level restriction
if (string === getLocaleString(5162)) {
print(string);

retry = 3;

break;
}
}

retry += 1;

D2Bot.updateRuns();
Expand All @@ -382,7 +418,8 @@ MainSwitch:

if (retry >= 3) {
//print("reset game");
D2Bot.printToConsole("Failed to join 3 times. Aborting.");
D2Bot.printToConsole("Failed to join " + joinInfo.gameName + ". Aborting.");
badGames.push(joinInfo.gameName);

lastGameStatus = "ready";
joinInfo.oldGame = joinInfo.gameName;
Expand All @@ -407,7 +444,7 @@ MainLoop:
joinInfo.gameName = joinInfo.gameName[joinInfo.gameName.length - 1].toString().replace(/^\W*/, ""); // use last match and trim it
joinInfo.gamePass = StarterConfig.Passwords[n] || "";

if (joinInfo.gameName !== joinInfo.oldGame) {
if (joinInfo.gameName && joinInfo.gameName !== joinInfo.oldGame && badGames.indexOf(joinInfo.gameName) === -1) {
ControlAction.click(6, 652, 469, 120, 20);

break MainLoop;
Expand All @@ -419,14 +456,16 @@ MainLoop:
case 4: // Create Game
break;
case 5: // Join Game
if (joinInfo.oldGame === joinInfo.gameName) {
if (joinInfo.oldGame === joinInfo.gameName || badGames.indexOf(joinInfo.gameName) > -1) {
ControlAction.click(6, 433, 433, 96, 32);
}

D2Bot.updateStatus("Join Game");

if (joinInfo.gameName !== "") {
print("�c2Joining �c0" + joinInfo.gameName);
print("�c2Joining �c0" + joinInfo.gameName);
ControlAction.setText(1, 606, 148, 155, 20, joinInfo.gamePass);
ControlAction.setText(1, 432, 148, 155, 20, joinInfo.gameName);

if (typeof AdvancedConfig[me.profile] === "object" && typeof AdvancedConfig[me.profile].AnnounceGame === "boolean" && typeof AdvancedConfig[me.profile].AnnounceMessage === "string") {
sayMsg(AdvancedConfig[me.profile].AnnounceMessage + " " + joinInfo.gameName);
Expand All @@ -442,11 +481,7 @@ MainLoop:

me.blockmouse = true;

try {
joinGame(joinInfo.gameName, joinInfo.gamePass);
} catch (joinErr) {

}
ControlAction.click(6, 594, 433, 172, 32);

me.blockmouse = false;
lastGameStatus = "pending";
Expand Down Expand Up @@ -474,10 +509,6 @@ MainLoop:
ControlAction.click(6, 33, 572, 128, 35);
}

if (!firstLogin) {
firstLogin = true;
}

D2Bot.updateStatus("Logging In");

try {
Expand Down Expand Up @@ -507,26 +538,44 @@ MainLoop:

break;
case getLocaleString(5208):
loginFail += 1;
D2Bot.updateStatus("Invalid Account");
D2Bot.printToConsole("Invalid Account");

if (loginFail < 2) {
timeoutDelay("Login retry", 3000);
ControlAction.click(6, 335, 412, 128, 35);
break;
case getLocaleString(5202): // cd key intended for another product
case getLocaleString(10915): // lod key intended for another product
D2Bot.updateStatus("Invalid CDKey");
D2Bot.printToConsole("Invalid CDKey: " + gameInfo.mpq, 6);
D2Bot.CDKeyDisabled();

break MainSwitch;
if (gameInfo.switchKeys) {
ControlAction.timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
D2Bot.restart(true);
} else {
D2Bot.stop();
}

D2Bot.updateStatus("Invalid Account");
D2Bot.printToConsole("Invalid Account");

break;
case getLocaleString(5199):
D2Bot.updateStatus("Disabled CDKey");
D2Bot.printToConsole("Disabled CDKey");
D2Bot.printToConsole("Disabled CDKey: " + gameInfo.mpq, 6);
D2Bot.CDKeyDisabled();

if (gameInfo.switchKeys) {
timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
ControlAction.timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
D2Bot.restart(true);
} else {
D2Bot.stop();
}

break;
case getLocaleString(10913):
D2Bot.updateStatus("Disabled LoD CDKey");
D2Bot.printToConsole("Disabled LoD CDKey: " + gameInfo.mpq, 6);
D2Bot.CDKeyDisabled();

if (gameInfo.switchKeys) {
ControlAction.timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
D2Bot.restart(true);
} else {
D2Bot.stop();
Expand All @@ -543,6 +592,13 @@ MainLoop:
D2Bot.updateStatus("Login Error");
D2Bot.printToConsole("Login Error - " + string);

if (gameInfo.switchKeys) {
ControlAction.timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
D2Bot.restart(true);
} else {
D2Bot.stop();
}

break;
}
}
Expand Down Expand Up @@ -605,15 +661,15 @@ MainLoop:
ControlAction.click(6, 351, 337, 96, 32);
break;
case 19: // Login - Cdkey In Use
D2Bot.printToConsole("CD-Key in use by " + ControlAction.getText(4, 158, 310, 485, 40));
D2Bot.printToConsole(gameInfo.mpq + " is in use by " + ControlAction.getText(4, 158, 310, 485, 40), 6);
D2Bot.CDKeyInUse();

if (gameInfo.switchKeys) {
timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
ControlAction.timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
D2Bot.restart(true);
} else {
timeoutDelay("CD-Key in use", StarterConfig.CDKeyInUseDelay * 6e4);
ControlAction.click(6, 335, 450, 128, 35);
ControlAction.timeoutDelay("CD-Key in use", StarterConfig.CDKeyInUseDelay * 6e4);
}

break;
Expand Down Expand Up @@ -641,26 +697,26 @@ MainLoop:

switch (string) {
case getLocaleString(10914):
D2Bot.printToConsole("LoD key in use by " + ControlAction.getText(4, 158, 310, 485, 40));
D2Bot.printToConsole(gameInfo.mpq + " LoD key in use by " + ControlAction.getText(4, 158, 310, 485, 40), 6);
D2Bot.CDKeyInUse();

if (gameInfo.switchKeys) {
timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
ControlAction.timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
D2Bot.restart(true);
} else {
ControlAction.click(6, 335, 450, 128, 35);
timeoutDelay("LoD key in use", StarterConfig.CDKeyInUseDelay * 6e4);
ControlAction.timeoutDelay("LoD key in use", StarterConfig.CDKeyInUseDelay * 6e4);
}

break;
default:
if (gameInfo.switchKeys) {
D2Bot.printToConsole("Invalid CD-Key");
timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
ControlAction.timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
D2Bot.restart(true);
} else {
ControlAction.click(6, 335, 450, 128, 35);
timeoutDelay("Invalid CD-Key", StarterConfig.CDKeyInUseDelay * 6e4);
ControlAction.timeoutDelay("Invalid CD-Key", StarterConfig.CDKeyInUseDelay * 6e4);
}

break;
Expand All @@ -669,13 +725,38 @@ MainLoop:
break;
case 23: // Character Select - Connecting
case 42: // Empty character screen
string = "";
text = ControlAction.getText(4, 45, 318, 531, 140);

if (text) {
for (i = 0; i < text.length; i += 1) {
string += text[i];

if (i !== text.length - 1) {
string += " ";
}
}

if (string === getLocaleString(11161)) { // CDKey disabled from realm play
D2Bot.updateStatus("Realm Disabled CDKey");
D2Bot.printToConsole("Realm Disabled CDKey: " + gameInfo.mpq, 6);
D2Bot.CDKeyDisabled();

if (gameInfo.switchKeys) {
ControlAction.timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
D2Bot.restart(true);
} else {
D2Bot.stop();
}
}
}

if (!locationTimeout(StarterConfig.ConnectingTimeout * 1e3, location)) {
//print("QQQ");
ControlAction.click(6, 33, 572, 128, 35);
}

if (gameInfo.rdBlocker) {
D2Bot.restart();
if (gameInfo.rdBlocker) {
D2Bot.restart();
}
}

break;
Expand Down Expand Up @@ -703,7 +784,7 @@ MainLoop:

break;
case 38: // Game is full
//D2Bot.printToConsole("Game is full");
badGames.push(joinInfo.gameName);
ControlAction.click(6, 652, 469, 120, 20);
ControlAction.click(6, 433, 433, 96, 32);

Expand All @@ -719,4 +800,4 @@ MainLoop:

break;
}
}
}
Loading