Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ====================================================================================================
- // v THIS IS THE JUNK YOU'LL WANT TO EDIT v
- // Frendless leech starter setting (set to run with op gotv channel bot by default there will be no help on changing this)
- // ====================================================================================================
- var gamenames = ["Gvbaal-"]; // Game name to search for (CASE-SENSITIVE)
- var gamepasswords = ["Gv"]; // Password for that game.
- var maxRetriesPerGame = 10; // The # of times to try rejoining a *unique* game
- var maxRetries = 3; // The # of *different* games to try joining, if all attempts fail, bot will exit to character selection screen and rejoin lobby
- // ====================================================================================================
- var gameMinLength = 180000; // time in milliseconds, minimum game length, 180 seconds default (1 game/3 minutes)
- var unableToConnectRetry = 5; // time in minutes to retry connecting on connection fail (real value is +/- 1 min)
- var realmDownRetry = 260; // time in minutes to retry connecting on a realm down (default is 120 minutes)
- var disconnectedRetry = 5; // time in minutes to retry on a disconnection (usually ip ban related)
- var cdkeyInUseRetry = 1; // time in minutes to retry on a cdkey in use error message (set to 0 to stop)
- var connectingToBnetTimeout = 20000; // time in milliseconds to wait for a login to time out and click cancel and retry
- var characterScreenTimeout = 5000; // time in milliseconds to wait for character screen to appear
- var pleaseWaitTimeout = 2000; // time in milliseconds to wait for a please wait popup
- var createGameThreshold = 2000; // time in milliseconds to wait between making games
- var createGameThresholdRandom = 500; // time in milliseconds to randomly add +/- to the game create time
- var createGameTimeout = 15000; // time in milliseconds to register a failed to create game
- var waitInLineTimeout = 60000; // time in milliseconds to wait in lines for a create game (60 second default)
- var characterSelectDelay = 1000; // time in milliseconds to wait before selecting a character on the char screen
- var loginDelay = 1000; // time in milliseconds to wait before submitting login information
- var clickDelay = 500; // wait X milliseconds before next action after a click event
- var textDelay = 500; // wait X milliseconds before next action after inserting text into a textbox
- var clickDelayRandom = 500; // random amount of time to add to a click
- var textDelayRandom = 500; // random amount of time to add to a text set
- var gameDoesNotExistDelayMin = 1000; // how long to wait when a Game Does Not Exist occurs - minimum - default 10 minutes
- var gameDoesNotExistDelayMax = 2000; // how long to wait when a Game Does Not Exist occurs - maximum - default 15 minutes
- var gameDoesNotExistTimeout = 50; // how long to wait for the dialog to disappear (default 30 seconds, don't change this)
- var waitBeforeEnterChatMin = 1000; // min how long to wait before entering chat
- var waitBeforeEnterChatMax = 2000; // max how long to wait before entering chat
- var waitInChatBeforeActionsMin = 1000; // min how long to wait before joining channel
- var waitInChatBeforeActionsMax = 2000; // max how long to wait before joining channel
- // DONT EDIT ANYTHING BELOW THIS
- var extrafilters = ["New game ", " started by"]; // The 2nd filter should be whatever the bot manager says right after the game name
- // If the 2nd filter is empty, the rest of the line is used as the game name
- var joinChannelInChat = "op gotv"; // leave blank to not join a private channel
- // D2NT Manager Command
- const D2NT_MGR_LOADING = 1;
- const D2NT_MGR_READY = 2;
- const D2NT_MGR_LOGIN = 3;
- const D2NT_MGR_CREATE_GAME = 4;
- const D2NT_MGR_INGAME = 5;
- const D2NT_MGR_RESTART = 6;
- const D2NT_MGR_CHICKEN = 7;
- const D2NT_MGR_PRINT_STATUS = 8;
- const D2NT_MGR_PRINT_LOG = 9;
- var lastGameMade = GetTickCount();
- var nextGameMake = 0;
- var inGameAt = 0;
- var chatActionsDone = false;
- var lastGameStatus = 0; // 0 = OK, 1 = Processing, 2 = Ready for retry
- var game = "";
- var gamepassword = "";
- var retry = 0;
- var fullretry = maxRetries;
- var samegame = new Array(gamenames.length); // Empty array for however many runs you might be following (default 6)
- Include("libs/controlInfo.ntl");
- var controlData = new controlInfo();
- function NTMain()
- {
- Delay(1000);
- var _ingame = false;
- controlData.clickDelay = clickDelay;
- controlData.textDelay = textDelay;
- controlData.clickDelayRandom = clickDelayRandom;
- controlData.textDelayRandom = textDelayRandom;
- while (1)
- {
- if (me.ingame)
- {
- if (!inGameAt)
- inGameAt = GetTickCount();
- if (!_ingame)
- {
- RunGC(); // run garbage collector between each game
- if (Load("NTBot/NTBotGame.ntj"))
- {
- _ingame = true;
- if (me.playtype > 0)
- sendEventToOOG(D2NT_MGR_INGAME, "In Game.. [IP:" + me.gameserverip.split(".")[3] + "]", 0);
- else
- sendEventToOOG(D2NT_MGR_INGAME, "In Game..", 0);
- fullretry = maxRetries;
- lastGameStatus = 0;
- game = "";
- }
- }
- Delay(1000);
- }
- else
- {
- Delay(500);
- if (_ingame)
- {
- _ingame = false;
- // --------------------------
- // Prevent NT from closing D2
- // --------------------------
- // Wait for lobby or lobby chat
- var _location;
- do
- {
- _location = controlData.getLocation();
- Delay(50);
- }
- while (_location.id != 3 && _location.id != 1);
- if (_location.id == 3) // Lobby Chat
- {
- // We need to go somewhere besides the lobby chat so NT can type crap and think its creating a game
- Delay(100);
- Say("/join " + getRandomString(Random(3,10)));
- Delay(1000);
- }
- sendEventToOOG(D2NT_MGR_CREATE_GAME, _location.name, 0);
- outputGameLength();
- setNextGameMake();
- // --------------------------
- sendEventToOOG(D2NT_MGR_READY, "", 0);
- }
- locationAction(controlData.getLocation());
- Delay(500);
- }
- }
- }
- function locationAction(location)
- {
- switch (location.id)
- {
- case 3: // Lobby Chat
- // Not retrying anymore, clear the game name so that if user tries to do it themself, bot won't fill in with old game
- if (lastGameStatus == 0 || retry == 0)
- {
- // Clear these flags just in case
- retry = 0;
- game = "";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement