Advertisement
kolton

Untitled

Dec 2nd, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.94 KB | None | 0 0
  1. var StarterConfig = {
  2. MinGameTime: 0, // Minimum game length in seconds. If a game is ended too soon, the rest of the time is waited in the lobby
  3. CreateGameDelay: 10, // Seconds to wait before creating a new game
  4. ResetCount: 0, // Reset game count back to 1 every X games.
  5. CharacterDifference: 99, // Character level difference. Set to false to disable character difference.
  6. ChatActionsDelay: 2, // Seconds to wait in lobby before entering a channel
  7.  
  8. SwitchKeyDelay: 0, // Seconds to wait before switching a used/banned key or after realm down
  9. CrashDelay: 0, // Seconds to wait after a d2 window crash
  10. FTJDelay: 5, // Seconds to wait after failing to create a game
  11. RealmDownDelay: 2, // Minutes to wait after getting Realm Down message
  12. UnableToConnectDelay: 5, // Minutes to wait after Unable To Connect message
  13. CDKeyInUseDelay: 5, // Minutes to wait before connecting again if CD-Key is in use.
  14. ConnectingTimeout: 20, // Seconds to wait before cancelling the 'Connecting...' screen
  15. PleaseWaitTimeout: 10, // Seconds to wait before cancelling the 'Please Wait...' screen
  16. WaitInLineTimeout: 60, // Seconds to wait before cancelling the 'Waiting in Line...' screen
  17. GameDoesNotExistTimeout: 30 // Seconds to wait before cancelling the 'Game does not exist.' screen
  18. };
  19.  
  20. var ChannelConfig = {
  21. // Now you can join separate channels for separate profiles, use separate join messages etc
  22. // Format 1 - single channel: "Profile Name": {JoinChannel: "channel", FirstJoinMessage: "login message", AnnounceGames: true}
  23. // Format 2 - multiple channels: "Profile Name": {JoinChannel: ["channel 1", "channel 2"], FirstJoinMessage: ["channel 1 login", "channel 2 login"], AnnounceGames: true}
  24. // Multiple entries are separated by a comma
  25.  
  26. //"Example": {JoinChannel: "my channel", FirstJoinMessage: ".login", AnnounceGames: true}
  27. };
  28.  
  29.  
  30.  
  31. // No touchy!
  32. include("json2.js");
  33. include("OOG.js");
  34. include("automule.js");
  35. include("gambling.js");
  36. include("torchsystem.js");
  37. include("common/misc.js");
  38. load("tools/heartbeat.js");
  39.  
  40. if (!FileTools.exists("data/" + me.profile + ".json")) {
  41. DataFile.create();
  42. }
  43.  
  44. var difficulty, error, keyswap, rdblocker, gameStart, ingame, muleTrigger, firstLogin, connectFail, chatActionsDone, torchTrigger, torchMuleTrigger,
  45. gamePass = "",
  46. gameName = "",
  47. nextGame = "",
  48. lastGameStatus = "ready",
  49. gameCount = DataFile.getStats().runs + 1,
  50. isUp = "no";
  51.  
  52. function ReceiveCopyData(msgID, msg) {
  53. switch (msgID) {
  54. case 2: // game info
  55. print("Recieved Game Info");
  56.  
  57. [gameName, gamePass, difficulty, error, keyswap, rdblocker] = msg.split('/');
  58. keyswap = parseInt(keyswap, 10);
  59. rdblocker = parseInt(rdblocker, 10);
  60.  
  61. break;
  62. case 1: // join
  63. [nextGame, gamePass, isUp] = msg.split('/');
  64.  
  65. break;
  66. case 3: // request game
  67. D2Bot.joinMe(msg, gameName, gameCount, gamePass, isUp);
  68.  
  69. break;
  70. }
  71. }
  72.  
  73. function timeoutDelay(text, time) {
  74. var endTime = getTickCount() + time;
  75.  
  76. while (getTickCount() < endTime) {
  77. D2Bot.updateStatus(text + " (" + Math.floor((endTime - getTickCount()) / 1000) + "s)");
  78. delay(500);
  79. }
  80. }
  81.  
  82. function locationTimeout(time, location) {
  83. var endtime = getTickCount() + time;
  84.  
  85. while (getLocation() === location && endtime > getTickCount()) {
  86. delay(500);
  87. }
  88.  
  89. return (getLocation() !== location);
  90. }
  91.  
  92. function updateCount() {
  93. D2Bot.updateCount();
  94. delay(1000);
  95. ControlAction.click(6, 264, 366, 272, 35);
  96.  
  97. try {
  98. login(me.profile);
  99. } catch (e) {
  100.  
  101. }
  102.  
  103. delay(1000);
  104. ControlAction.click(6, 33, 572, 128, 35);
  105. }
  106.  
  107. function ScriptMsgEvent(msg) {
  108. switch (msg) {
  109. case "mule":
  110. muleTrigger = true;
  111.  
  112. break;
  113. case "torch":
  114. torchTrigger = true;
  115.  
  116. break;
  117. case "muleTorch":
  118. torchMuleTrigger = true;
  119.  
  120. break;
  121. case "requestMuleMode":
  122. scriptBroadcast(torchMuleTrigger ? "torch" : "normal");
  123.  
  124. torchMuleTrigger = false;
  125.  
  126. break;
  127. }
  128. }
  129.  
  130. function timer(tick) {
  131. if (!tick) {
  132. return "";
  133. }
  134.  
  135. var min, sec;
  136.  
  137. min = Math.floor((getTickCount() - tick) / 60000).toString();
  138.  
  139. if (min <= 9) {
  140. min = "0" + min;
  141. }
  142.  
  143. sec = (Math.floor((getTickCount() - tick) / 1000) % 60).toString();
  144.  
  145. if (sec <= 9) {
  146. sec = "0" + sec;
  147. }
  148.  
  149. return " (" + min + ":" + sec + ")";
  150. }
  151.  
  152. function randomString(len) {
  153. var i,
  154. rval = "",
  155. letters = "abcdefghijklmnopqrstuvwxyz";
  156.  
  157. for (i = 0; i < len; i += 1) {
  158. rval += letters[Math.floor(Math.random() * 26)];
  159. }
  160.  
  161. return rval;
  162. }
  163.  
  164. function main() {
  165. addEventListener('copydata', ReceiveCopyData);
  166. addEventListener('scriptmsg', ScriptMsgEvent);
  167. delay(rand(1, 2) * 1000);
  168. D2Bot.requestGameInfo();
  169.  
  170. if (error === "@error") {
  171. timeoutDelay("Crash Delay", StarterConfig.CrashDelay * 1e3);
  172. D2Bot.updateRuns();
  173. }
  174.  
  175. while (true) {
  176. while (me.ingame) { // returns true before actually in game so we can't only use this check
  177. if (me.gameReady) { // returns false when switching acts so we can't use while
  178. isUp = "yes";
  179.  
  180. if (!ingame) {
  181. gameStart = getTickCount();
  182.  
  183. if (me.gamepassword.toLowerCase() !== gamePass.toLowerCase()) {
  184. print("leaving game");
  185. quit();
  186. }
  187.  
  188. print("Updating Status");
  189. //D2Bot.updateStatus("Game: " + me.gamename);
  190.  
  191. lastGameStatus = "ingame";
  192. ingame = true;
  193.  
  194. DataFile.updateStats("runs", gameCount);
  195. }
  196.  
  197. D2Bot.updateStatus("Game: " + me.gamename + timer(gameStart));
  198. }
  199.  
  200. delay(1000);
  201. }
  202.  
  203. isUp = "no";
  204.  
  205. locationAction(getLocation());
  206. delay(1000);
  207. }
  208. }
  209.  
  210. function locationAction(location) {
  211. var i, control, string, text, gambleGame;
  212.  
  213. MainSwitch:
  214. switch (location) {
  215. case 0:
  216. break;
  217. case 1: // Lobby
  218. D2Bot.updateStatus("Lobby");
  219.  
  220. if (ChannelConfig.hasOwnProperty(me.profile) && ChannelConfig[me.profile].JoinChannel !== "") {
  221. ControlAction.click(6, 27, 480, 120, 20);
  222.  
  223. break;
  224. }
  225.  
  226. // automule test lines
  227. //ingame = true;
  228. //muleTrigger = true;
  229. //torchMuleTrigger = true;
  230.  
  231. if (ingame) {
  232. if (getTickCount() - gameStart < StarterConfig.MinGameTime * 1e3) {
  233. timeoutDelay("Min game time wait", StarterConfig.MinGameTime * 1e3 + gameStart - getTickCount());
  234. }
  235.  
  236. // ### automule ###
  237. if (muleTrigger || torchMuleTrigger) {
  238. removeEventListener('copydata', ReceiveCopyData);
  239. AutoMule.outOfGameCheck(torchMuleTrigger ? 1 : 0);
  240. addEventListener('copydata', ReceiveCopyData);
  241.  
  242. muleTrigger = false;
  243. // torchMuleTrigger is set to false elsewhere because it would trigger normal mule if set to false here
  244.  
  245. break;
  246. }
  247. // ### automule end ###
  248.  
  249. // ### Torch System ###
  250. if (torchTrigger) {
  251. TorchSystem.outOfGameCheck();
  252.  
  253. torchTrigger = false;
  254.  
  255. break;
  256. }
  257. // ### Torch System end ###
  258.  
  259. print("updating runs");
  260. D2Bot.updateRuns();
  261.  
  262. gameCount += 1;
  263. lastGameStatus = "ready";
  264. ingame = false;
  265.  
  266. if (StarterConfig.ResetCount && gameCount >= StarterConfig.ResetCount) {
  267. gameCount = 1;
  268.  
  269. DataFile.updateStats("runs", gameCount);
  270. }
  271. }
  272.  
  273. // #### experimental gambling system start ####
  274. gambleGame = Gambling.checkGamblers();
  275.  
  276. if (gambleGame && DataFile.getStats().gold > Gambling.minGold) {
  277. delay(3000);
  278. joinGame(gambleGame[0], gambleGame[1]);
  279. delay(1000);
  280. locationTimeout(5000, location);
  281.  
  282. break;
  283. }
  284. // #### experimental gambling system end ####
  285.  
  286. if (!ControlAction.click(6, 533, 469, 120, 20)) { // Create
  287. break;
  288. }
  289.  
  290. if (!locationTimeout(5000, location)) { // in case create button gets bugged
  291. if (!ControlAction.click(6, 652, 469, 120, 20)) { // Join
  292. break;
  293. }
  294.  
  295. if (!ControlAction.click(6, 533, 469, 120, 20)) { // Create
  296. break;
  297. }
  298. }
  299.  
  300. break;
  301. case 2: // Waiting In Line
  302. D2Bot.updateStatus("Waiting...");
  303. locationTimeout(StarterConfig.WaitInLineTimeout * 1e3, location);
  304. ControlAction.click(6, 433, 433, 96, 32);
  305.  
  306. break;
  307. case 3: // Lobby Chat
  308. D2Bot.updateStatus("Lobby Chat");
  309.  
  310. if (ingame) {
  311. if (getTickCount() - gameStart < StarterConfig.MinGameTime * 1e3) {
  312. timeoutDelay("Min game time wait", StarterConfig.MinGameTime * 1e3 + gameStart - getTickCount());
  313. }
  314.  
  315. // ### automule ###
  316. if (muleTrigger || torchMuleTrigger) {
  317. removeEventListener('copydata', ReceiveCopyData);
  318. AutoMule.outOfGameCheck(torchMuleTrigger ? 1 : 0);
  319. addEventListener('copydata', ReceiveCopyData);
  320.  
  321. muleTrigger = false;
  322. // torchMuleTrigger is set to false elsewhere because it would trigger normal mule if set to false here
  323.  
  324. break;
  325. }
  326. // ### automule end ###
  327.  
  328. // ### Torch System ###
  329. if (torchTrigger) {
  330. TorchSystem.outOfGameCheck();
  331.  
  332. torchTrigger = false;
  333.  
  334. break;
  335. }
  336. // ### Torch System end ###
  337.  
  338. print("updating runs");
  339. D2Bot.updateRuns();
  340.  
  341. gameCount += 1;
  342. lastGameStatus = "ready";
  343. ingame = false;
  344.  
  345. if (StarterConfig.ResetCount && gameCount >= StarterConfig.ResetCount) {
  346. gameCount = 1;
  347.  
  348. DataFile.updateStats("runs", gameCount);
  349. }
  350. }
  351.  
  352. // #### experimental gambling system start ####
  353. gambleGame = Gambling.checkGamblers();
  354.  
  355. if (gambleGame && DataFile.getStats().gold > Gambling.minGold) {
  356. delay(3000);
  357. joinGame(gambleGame[0], gambleGame[1]);
  358. delay(1000);
  359. locationTimeout(5000, location);
  360.  
  361. break;
  362. }
  363. // #### experimental gambling system end ####
  364.  
  365. if (!chatActionsDone) {
  366. chatActionsDone = true;
  367.  
  368. // Single channel
  369. if (typeof ChannelConfig[me.profile].JoinChannel === "string") {
  370. timeoutDelay("Chat delay", StarterConfig.ChatActionsDelay * 1e3);
  371. say("/j " + ChannelConfig[me.profile].JoinChannel);
  372. delay(2000);
  373.  
  374. if (ChannelConfig[me.profile].FirstJoinMessage !== "") {
  375. say(ChannelConfig[me.profile].FirstJoinMessage);
  376. delay(500);
  377. }
  378. }
  379.  
  380. // Multiple channels
  381. if (typeof ChannelConfig[me.profile].JoinChannel === "object") {
  382. for (i = 0; i < ChannelConfig[me.profile].JoinChannel.length; i += 1) {
  383. timeoutDelay("Chat delay", StarterConfig.ChatActionsDelay * 1e3);
  384. say("/j " + ChannelConfig[me.profile].JoinChannel[i]);
  385. delay(2000);
  386.  
  387. if (ChannelConfig[me.profile].FirstJoinMessage[i] !== "") {
  388. say(ChannelConfig[me.profile].FirstJoinMessage[i]);
  389. delay(500);
  390. }
  391. }
  392. }
  393. }
  394.  
  395. if (!chatActionsDone) {
  396. chatActionsDone = true;
  397.  
  398. timeoutDelay("Chat delay", StarterConfig.ChatActionsDelay * 1e3);
  399. say("/j " + ChannelConfig[me.profile].JoinChannel);
  400. delay(1000);
  401.  
  402. if (ChannelConfig[me.profile].FirstJoinMessage !== "") {
  403. say(ChannelConfig[me.profile].FirstJoinMessage);
  404. delay(500);
  405. }
  406. }
  407.  
  408. if (ChannelConfig[me.profile].AnnounceGames) {
  409. delay(1000);
  410. say("Next game is " + gameName + gameCount + (gamePass === "" ? "" : "//" + gamePass));
  411. }
  412.  
  413. if (!ControlAction.click(6, 533, 469, 120, 20)) { // Create
  414. break;
  415. }
  416.  
  417. if (!locationTimeout(5000, location)) { // in case create button gets bugged
  418. if (!ControlAction.click(6, 652, 469, 120, 20)) { // Join
  419. break;
  420. }
  421.  
  422. if (!ControlAction.click(6, 533, 469, 120, 20)) { // Create
  423. break;
  424. }
  425. }
  426.  
  427. break;
  428. case 4: // Create Game
  429. D2Bot.updateStatus("Creating Game");
  430.  
  431. control = getControl(1, 657, 342, 27, 20);
  432.  
  433. if (typeof StarterConfig.CharacterDifference === "number") {
  434. if (control.disabled === 4) {
  435. ControlAction.click(6, 431, 341, 15, 16);
  436. }
  437.  
  438. ControlAction.setText(1, 657, 342, 27, 20, StarterConfig.CharacterDifference.toString());
  439. } else if (StarterConfig.CharacterDifference === false && control.disabled === 5) {
  440. ControlAction.click(6, 431, 341, 15, 16);
  441. }
  442.  
  443. while (!gameName) {
  444. D2Bot.requestGameInfo();
  445. delay(500);
  446. }
  447.  
  448. if (lastGameStatus === "pending") {
  449. D2Bot.printToConsole("Failed to create game");
  450. timeoutDelay("FTJ delay", StarterConfig.FTJDelay * 1e3);
  451. D2Bot.updateRuns();
  452.  
  453. gameCount += 1;
  454. }
  455.  
  456. me.blockMouse = true;
  457.  
  458. ControlAction.setText(1, 432, 162, 158, 20, gameName + gameCount);
  459. ControlAction.setText(1, 432, 217, 158, 20, gamePass);
  460.  
  461. switch (difficulty) {
  462. case "Normal":
  463. ControlAction.click(6, 430, 381, 16, 16);
  464.  
  465. break;
  466. case "Nightmare":
  467. ControlAction.click(6, 555, 381, 16, 16);
  468.  
  469. break;
  470. case "Hell":
  471. ControlAction.click(6, 698, 381, 16, 16);
  472.  
  473. break;
  474. }
  475.  
  476. if (lastGameStatus !== "pending") {
  477. timeoutDelay("Make Game Delay", StarterConfig.CreateGameDelay * 1e3);
  478. }
  479.  
  480. print("Creating Game: " + gameName + gameCount);
  481. ControlAction.click(6, 594, 433, 172, 32);
  482. //createGame(gameName + gameCount, gamePass, difficulty === "Hell" ? 2 : difficulty === "Nightmare" ? 1 : 0);
  483.  
  484. me.blockMouse = false;
  485. lastGameStatus = "pending";
  486.  
  487. locationTimeout(5000, location);
  488.  
  489. break;
  490. case 5: // Join Game
  491. break;
  492. case 6: // Ladder
  493. break;
  494. case 7: // Channel List
  495. break;
  496. case 8: // Main Menu
  497. case 9: // Login
  498. case 18: // D2 Splash
  499. if (firstLogin) { // multiple realm botting fix in case of R/D or disconnect
  500. ControlAction.click(6, 33, 572, 128, 35);
  501. }
  502.  
  503. if (!firstLogin) {
  504. firstLogin = true;
  505. }
  506.  
  507. D2Bot.updateStatus("Logging In");
  508.  
  509. try {
  510. login(me.profile);
  511. } catch (e) {
  512. print(e);
  513. }
  514.  
  515. break;
  516. case 10: // Login Error
  517. string = "";
  518. text = ControlAction.getText(4, 199, 377, 402, 140);
  519.  
  520. if (text) {
  521. for (i = 0; i < text.length; i += 1) {
  522. string += text[i];
  523.  
  524. if (i !== text.length - 1) {
  525. string += " ";
  526. }
  527. }
  528.  
  529. switch (string) {
  530. case getLocaleString(5207):
  531. D2Bot.updateStatus("Invalid Password");
  532. D2Bot.printToConsole("Invalid Password");
  533. break;
  534. case getLocaleString(5208):
  535. D2Bot.updateStatus("Invalid Account");
  536. D2Bot.printToConsole("Invalid Account");
  537. break;
  538. case getLocaleString(5199):
  539. D2Bot.updateStatus("Disabled CDKey");
  540. D2Bot.printToConsole("Disabled CDKey");
  541. D2Bot.CDKeyDisabled();
  542.  
  543. if (keyswap) {
  544. timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
  545. D2Bot.restart(true);
  546. } else {
  547. D2Bot.stop();
  548. }
  549.  
  550. break;
  551. case getLocaleString(5347):
  552. D2Bot.updateStatus("Disconnected");
  553. D2Bot.printToConsole("Disconnected");
  554. ControlAction.click(6, 335, 412, 128, 35);
  555. break MainSwitch;
  556. default:
  557. D2Bot.updateStatus("Login Error");
  558. D2Bot.printToConsole("Login Error - " + string);
  559. break;
  560. }
  561. }
  562.  
  563. ControlAction.click(6, 335, 412, 128, 35);
  564.  
  565. while (true) {
  566. delay(1000);
  567. }
  568.  
  569. break;
  570. case 11: // Unable To Connect
  571. D2Bot.updateStatus("Unable To Connect");
  572.  
  573. if (connectFail) {
  574. timeoutDelay("Unable to Connect", StarterConfig.UnableToConnectDelay * 6e4);
  575.  
  576. connectFail = false;
  577. }
  578.  
  579. if (!ControlAction.click(6, 335, 450, 128, 35)) {
  580. break;
  581. }
  582.  
  583. connectFail = true;
  584.  
  585. break;
  586. case 12: // Character Select
  587. try {
  588. login(me.profile);
  589. } catch (e2) {
  590.  
  591. }
  592.  
  593. break;
  594. case 13: // Realm Down - Character Select screen
  595. D2Bot.updateStatus("Realm Down");
  596. delay(1000);
  597.  
  598. if (!ControlAction.click(6, 33, 572, 128, 35)) {
  599. break;
  600. }
  601.  
  602. updateCount();
  603. timeoutDelay("Realm Down", StarterConfig.RealmDownDelay * 6e4);
  604. D2Bot.CDKeyRD();
  605.  
  606. if (keyswap && !rdblocker) {
  607. D2Bot.printToConsole("Realm Down - Changing CD-Key");
  608. timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
  609. D2Bot.restart(true);
  610. } else {
  611. D2Bot.printToConsole("Realm Down - Restart");
  612. D2Bot.restart();
  613. }
  614.  
  615. break;
  616. case 14: // Character Select / Main Menu - Disconnected
  617. D2Bot.updateStatus("Disconnected");
  618. delay(500);
  619. ControlAction.click(6, 351, 337, 96, 32);
  620.  
  621. break;
  622. case 15: // New Character
  623. break;
  624. case 16: // Character Select - Please Wait popup
  625. if (!locationTimeout(StarterConfig.PleaseWaitTimeout * 1e3, location)) {
  626. ControlAction.click(6, 351, 337, 96, 32);
  627. }
  628.  
  629. break;
  630. case 17: // Lobby - Lost Connection - just click okay, since we're toast anyway
  631. delay(1000);
  632. ControlAction.click(6, 351, 337, 96, 32);
  633.  
  634. break;
  635. case 19: // Login - Cdkey In Use
  636. D2Bot.printToConsole("CD-Key in use by " + ControlAction.getText(4, 158, 310, 485, 40));
  637. D2Bot.CDKeyInUse();
  638.  
  639. if (keyswap) {
  640. timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
  641. D2Bot.restart(true);
  642. } else {
  643. ControlAction.click(6, 335, 450, 128, 35);
  644. timeoutDelay("CD-Key in use", StarterConfig.CDKeyInUseDelay * 6e4);
  645. }
  646.  
  647. break;
  648. case 20: // Single Player - Select Difficulty
  649. break;
  650. case 21: // Main Menu - Connecting
  651. if (!locationTimeout(StarterConfig.ConnectingTimeout * 1e3, location)) {
  652. ControlAction.click(6, 330, 416, 128, 35);
  653. }
  654.  
  655. break;
  656. case 22: // Login - Invalid Cdkey (classic or xpac)
  657. text = ControlAction.getText(4, 162, 270, 477, 50);
  658. string = "";
  659.  
  660. if (text) {
  661. for (i = 0; i < text.length; i += 1) {
  662. string += text[i];
  663.  
  664. if (i !== text.length - 1) {
  665. string += " ";
  666. }
  667. }
  668. }
  669.  
  670. switch (string) {
  671. case getLocaleString(10914):
  672. D2Bot.printToConsole("LoD key in use by " + ControlAction.getText(4, 158, 310, 485, 40));
  673. D2Bot.CDKeyInUse();
  674.  
  675. if (keyswap) {
  676. timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
  677. D2Bot.restart(true);
  678. } else {
  679. ControlAction.click(6, 335, 450, 128, 35);
  680. timeoutDelay("LoD key in use", StarterConfig.CDKeyInUseDelay * 6e4);
  681. }
  682.  
  683. break;
  684. default:
  685. if (keyswap) {
  686. D2Bot.printToConsole("Invalid CD-Key");
  687. timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
  688. D2Bot.restart(true);
  689. } else {
  690. ControlAction.click(6, 335, 450, 128, 35);
  691. timeoutDelay("Invalid CD-Key", StarterConfig.CDKeyInUseDelay * 6e4);
  692. }
  693.  
  694. break;
  695. }
  696.  
  697. break;
  698. case 23: // Character Select - Connecting
  699. if (!locationTimeout(StarterConfig.ConnectingTimeout * 1e3, location)) {
  700. ControlAction.click(6, 33, 572, 128, 35);
  701. }
  702.  
  703. if (rdblocker) {
  704. D2Bot.restart();
  705. }
  706.  
  707. break;
  708. case 24: // Server Down - not much to do but wait..
  709. break;
  710. case 25: // Lobby - Please Wait
  711. if (!locationTimeout(StarterConfig.PleaseWaitTimeout * 1e3, location)) {
  712. ControlAction.click(6, 351, 337, 96, 32);
  713. }
  714.  
  715. break;
  716. case 26: // Lobby - Game Name Exists
  717. ControlAction.click(6, 533, 469, 120, 20);
  718.  
  719. gameCount += 1;
  720. lastGameStatus = "ready";
  721.  
  722. break;
  723. case 27: // Gateway Select
  724. ControlAction.click(6, 436, 538, 96, 32);
  725.  
  726. break;
  727. case 28: // Lobby - Game Does Not Exist
  728. D2Bot.printToConsole("Game doesn't exist");
  729.  
  730. if (rdblocker) {
  731. D2Bot.printToConsole("CDKey is probably flagged.");
  732.  
  733. if (keyswap) {
  734. timeoutDelay("Key switch delay", StarterConfig.SwitchKeyDelay * 1000);
  735. D2Bot.restart(true);
  736. }
  737. } else {
  738. locationTimeout(StarterConfig.GameDoesNotExistTimeout * 1e3, location);
  739. }
  740.  
  741. lastGameStatus = "ready";
  742.  
  743. break;
  744. case 38: // Game is full
  745. // doesn't happen when making
  746. break;
  747. case 42: // Empty character screen
  748. ControlAction.click(6, 33, 572, 128, 35);
  749.  
  750. break;
  751. default:
  752. if (location !== undefined) {
  753. D2Bot.printToConsole("Unhandled location " + location);
  754. delay(500);
  755. D2Bot.restart();
  756. }
  757.  
  758. break;
  759. }
  760. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement