Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.48 KB | None | 0 0
  1. // ====================================================================================================
  2. // v THIS IS THE JUNK YOU'LL WANT TO EDIT v
  3. // Frendless leech starter setting (set to run with op gotv channel bot by default there will be no help on changing this)
  4. // ====================================================================================================
  5. var gamenames = ["Gvbaal-"]; // Game name to search for (CASE-SENSITIVE)
  6.  
  7. var gamepasswords = ["Gv"]; // Password for that game.
  8.  
  9. var maxRetriesPerGame = 10; // The # of times to try rejoining a *unique* game
  10. var maxRetries = 3; // The # of *different* games to try joining, if all attempts fail, bot will exit to character selection screen and rejoin lobby
  11.  
  12. // ====================================================================================================
  13.  
  14. var gameMinLength = 180000; // time in milliseconds, minimum game length, 180 seconds default (1 game/3 minutes)
  15. var unableToConnectRetry = 5; // time in minutes to retry connecting on connection fail (real value is +/- 1 min)
  16. var realmDownRetry = 260; // time in minutes to retry connecting on a realm down (default is 120 minutes)
  17. var disconnectedRetry = 5; // time in minutes to retry on a disconnection (usually ip ban related)
  18. var cdkeyInUseRetry = 1; // time in minutes to retry on a cdkey in use error message (set to 0 to stop)
  19. var connectingToBnetTimeout = 20000; // time in milliseconds to wait for a login to time out and click cancel and retry
  20. var characterScreenTimeout = 5000; // time in milliseconds to wait for character screen to appear
  21. var pleaseWaitTimeout = 2000; // time in milliseconds to wait for a please wait popup
  22. var createGameThreshold = 2000; // time in milliseconds to wait between making games
  23. var createGameThresholdRandom = 500; // time in milliseconds to randomly add +/- to the game create time
  24. var createGameTimeout = 15000; // time in milliseconds to register a failed to create game
  25. var waitInLineTimeout = 60000; // time in milliseconds to wait in lines for a create game (60 second default)
  26. var characterSelectDelay = 1000; // time in milliseconds to wait before selecting a character on the char screen
  27. var loginDelay = 1000; // time in milliseconds to wait before submitting login information
  28. var clickDelay = 500; // wait X milliseconds before next action after a click event
  29. var textDelay = 500; // wait X milliseconds before next action after inserting text into a textbox
  30. var clickDelayRandom = 500; // random amount of time to add to a click
  31. var textDelayRandom = 500; // random amount of time to add to a text set
  32. var gameDoesNotExistDelayMin = 1000; // how long to wait when a Game Does Not Exist occurs - minimum - default 10 minutes
  33. var gameDoesNotExistDelayMax = 2000; // how long to wait when a Game Does Not Exist occurs - maximum - default 15 minutes
  34. var gameDoesNotExistTimeout = 50; // how long to wait for the dialog to disappear (default 30 seconds, don't change this)
  35. var waitBeforeEnterChatMin = 1000; // min how long to wait before entering chat
  36. var waitBeforeEnterChatMax = 2000; // max how long to wait before entering chat
  37. var waitInChatBeforeActionsMin = 1000; // min how long to wait before joining channel
  38. var waitInChatBeforeActionsMax = 2000; // max how long to wait before joining channel
  39.  
  40. // DONT EDIT ANYTHING BELOW THIS
  41. var extrafilters = ["New game ", " started by"]; // The 2nd filter should be whatever the bot manager says right after the game name
  42. // If the 2nd filter is empty, the rest of the line is used as the game name
  43. var joinChannelInChat = "op gotv"; // leave blank to not join a private channel
  44.  
  45. // D2NT Manager Command
  46. const D2NT_MGR_LOADING = 1;
  47. const D2NT_MGR_READY = 2;
  48. const D2NT_MGR_LOGIN = 3;
  49. const D2NT_MGR_CREATE_GAME = 4;
  50. const D2NT_MGR_INGAME = 5;
  51. const D2NT_MGR_RESTART = 6;
  52. const D2NT_MGR_CHICKEN = 7;
  53. const D2NT_MGR_PRINT_STATUS = 8;
  54. const D2NT_MGR_PRINT_LOG = 9;
  55.  
  56. var lastGameMade = GetTickCount();
  57. var nextGameMake = 0;
  58. var inGameAt = 0;
  59. var chatActionsDone = false;
  60. var lastGameStatus = 0; // 0 = OK, 1 = Processing, 2 = Ready for retry
  61. var game = "";
  62. var gamepassword = "";
  63. var retry = 0;
  64. var fullretry = maxRetries;
  65. var samegame = new Array(gamenames.length); // Empty array for however many runs you might be following (default 6)
  66.  
  67. Include("libs/controlInfo.ntl");
  68.  
  69. var controlData = new controlInfo();
  70.  
  71. function NTMain()
  72. {
  73. Delay(1000);
  74.  
  75. var _ingame = false;
  76.  
  77. controlData.clickDelay = clickDelay;
  78. controlData.textDelay = textDelay;
  79. controlData.clickDelayRandom = clickDelayRandom;
  80. controlData.textDelayRandom = textDelayRandom;
  81.  
  82. while (1)
  83. {
  84. if (me.ingame)
  85. {
  86. if (!inGameAt)
  87. inGameAt = GetTickCount();
  88.  
  89. if (!_ingame)
  90. {
  91. RunGC(); // run garbage collector between each game
  92.  
  93. if (Load("NTBot/NTBotGame.ntj"))
  94. {
  95. _ingame = true;
  96.  
  97. if (me.playtype > 0)
  98. sendEventToOOG(D2NT_MGR_INGAME, "In Game.. [IP:" + me.gameserverip.split(".")[3] + "]", 0);
  99. else
  100. sendEventToOOG(D2NT_MGR_INGAME, "In Game..", 0);
  101.  
  102. fullretry = maxRetries;
  103. lastGameStatus = 0;
  104. game = "";
  105. }
  106. }
  107.  
  108. Delay(1000);
  109. }
  110. else
  111. {
  112. Delay(500);
  113. if (_ingame)
  114. {
  115. _ingame = false;
  116.  
  117. // --------------------------
  118. // Prevent NT from closing D2
  119. // --------------------------
  120.  
  121. // Wait for lobby or lobby chat
  122. var _location;
  123. do
  124. {
  125. _location = controlData.getLocation();
  126. Delay(50);
  127. }
  128. while (_location.id != 3 && _location.id != 1);
  129.  
  130. if (_location.id == 3) // Lobby Chat
  131. {
  132. // We need to go somewhere besides the lobby chat so NT can type crap and think its creating a game
  133. Delay(100);
  134. Say("/join " + getRandomString(Random(3,10)));
  135. Delay(1000);
  136. }
  137. sendEventToOOG(D2NT_MGR_CREATE_GAME, _location.name, 0);
  138. outputGameLength();
  139. setNextGameMake();
  140. // --------------------------
  141.  
  142. sendEventToOOG(D2NT_MGR_READY, "", 0);
  143. }
  144.  
  145. locationAction(controlData.getLocation());
  146.  
  147. Delay(500);
  148. }
  149. }
  150. }
  151.  
  152. function locationAction(location)
  153. {
  154. switch (location.id)
  155. {
  156. case 3: // Lobby Chat
  157.  
  158. // Not retrying anymore, clear the game name so that if user tries to do it themself, bot won't fill in with old game
  159. if (lastGameStatus == 0 || retry == 0)
  160. {
  161. // Clear these flags just in case
  162. retry = 0;
  163. game = "";
  164. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement