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

Update to D2BotMuleLog.dbj to check for existing game allowing for faster endless logging without RD #2965

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 21 additions & 29 deletions d2bs/kolbot/D2BotMuleLog.dbj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var StarterConfig = {
MinGameTime: rand(150, 180), // Minimum game length in seconds. If a game is ended too soon, the rest of the time is waited in the lobby
GameName: "yourgamename",
GamePass: "yourgamepass",
MinGameTime: rand(30, 60), // Minimum game length in seconds. If a game is ended too soon, the rest of the time is waited in the lobby
CreateGameDelay: rand(5, 15), // Seconds to wait before creating a new game

SwitchKeyDelay: 0, // Seconds to wait before switching a used/banned key or after realm down
Expand Down Expand Up @@ -200,9 +202,13 @@ MainSwitch:
break;
}

if (!ControlAction.click(6, 533, 469, 120, 20)) { // Create
break;
}
if (StarterConfig.GameName && !ControlAction.click(6, 652, 469, 120, 20)) { // Join
break;
}

// if (!ControlAction.click(6, 533, 469, 120, 20)) { // Create
// break;
// }

if (getControl(6, 533, 469, 120, 20) && getControl(6, 533, 469, 120, 20).disabled === 4) { // dead HC character
ControlAction.click(6, 693, 490, 80, 20); // Quit from Lobby
Expand All @@ -227,35 +233,21 @@ MainSwitch:

break;
case 4: // Create Game
D2Bot.updateStatus("Creating Game");

control = getControl(1, 657, 342, 27, 20);
if (StarterConfig.GameName) {
createGame(StarterConfig.GameName, StarterConfig.GamePass, 0);
} else {
createGame(MuleLogger.LogGame[0] + gameCount, MuleLogger.LogGame[1], 0);
}

if (control && control.disabled === 5) {
ControlAction.click(6, 431, 341, 15, 16); // remove level restriction
}

if (gameCount >= 99) {
gameCount = 1;

DataFile.updateStats("runs", gameCount);
}

if (lastGameStatus === "pending") {
D2Bot.printToConsole("Failed to create game");

gameCount += 1;
}
break;
case 5: // Join Game
D2Bot.updateStatus("Join Game");

timeoutDelay("Make Game Delay", StarterConfig.CreateGameDelay * 1e3);
createGame(MuleLogger.LogGame[0] + gameCount, MuleLogger.LogGame[1], 0);
locationTimeout(5000, location);
joinGame(StarterConfig.GameName, StarterConfig.GamePass);

lastGameStatus = "pending";
locationTimeout(5000, location);

break;
case 5: // Join Game
break;
break;
case 6: // Ladder
break;
case 7: // Channel List
Expand Down
4 changes: 2 additions & 2 deletions d2bs/kolbot/libs/MuleLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var MuleLogger = {
LogEquipped: false, // include equipped items
LogMerc: false, // include items merc has equipped (if alive)
SaveScreenShot: false, // Save pictures in jpg format (saved in 'Images' folder)
IngameTime: rand(180, 210), // (180, 210) to avoid RD, increase it to (7230, 7290) for mule perming
IngameTime: rand(30, 60), //Increase to (7230, 7290) for mule perming

// don't edit
getItemDesc: function (unit, logIlvl) {
Expand Down Expand Up @@ -403,4 +403,4 @@ var MuleLogger = {
FileTools.writeText("mules/" + realm + "/" + me.account + "/" + me.name + "." + ( me.playertype ? "h" : "s" ) + (me.gametype ? "e" : "c" ) + ( me.ladder > 0 ? "l" : "n" ) + ".txt", finalString);
print("Item logging done.");
}
};
};