LosDaanos

NTBotgame

May 20th, 2011
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. var CurScriptIndex = 0;
  2. var LastScript = false;
  3.  
  4. var CloneDiabloString;
  5. var CloneDiabloNotify = false;
  6.  
  7. function NTMain()
  8. {
  9. Delay(1000);
  10.  
  11. //Print("ÿc4[+] NTBot 4.2 [+]");
  12.  
  13. Include("libs/common/NTCommon.ntl");
  14. NTC_IncludeLibs();
  15. NTC_IncludeConfig("NTBot/char_configs");
  16.  
  17. NT_LoadConfig();
  18. NTSI_LoadNIPFiles("NTBot/item_configs");
  19.  
  20. if(NTConfig_StartDelay > 0);
  21. NTC_Delay(NTConfig_StartDelay);
  22.  
  23. SetUIState(0x0A, true);
  24.  
  25. NTT_GetCorpses();
  26.  
  27. if(NTConfig_Script.length > 0)
  28. {
  29. NTCU_InitCubing();
  30.  
  31. NTT_ClearInventory();
  32. NTT_ClearBelt();
  33.  
  34. Load("NTBot/tools/NTToolsThread.ntj");
  35.  
  36. if(NTConfig_CheckCloneDiablo)
  37. {
  38. CloneDiabloString = GetLocaleString(11005);
  39. RegisterEvent(EVENT_GAMEMSG, NT_GameMsgEvents);
  40. }
  41.  
  42. RegisterEvent(EVENT_KEYDOWN, NT_KeyEvents);
  43. RegisterEvent(EVENT_SCRIPTMSG, NT_ScriptMsgEvents);
  44.  
  45. Load("NTBot/bots/" + NTConfig_Script[CurScriptIndex]);
  46. SetStatusText("Running " + NTConfig_Script[CurScriptIndex]);
  47.  
  48. while(!LastScript || CloneDiabloNotify)
  49. {
  50. NTC_Delay(500);
  51. }
  52. }
  53.  
  54. ExitGame();
  55. }
  56.  
  57. function NT_GameMsgEvents(msg, type)
  58. {
  59. if(type == 4 && msg.indexOf(CloneDiabloString) != -1)
  60. {
  61. CloneDiabloNotify = true;
  62.  
  63. NTC_SendLogToOOG(NTC_LOG_COMMON, "ÿc4" + CloneDiabloString);
  64. SetStatusText(CloneDiabloString);
  65.  
  66. me.maxgametime = 0;
  67.  
  68. NTC_StopScript(NTConfig_Script[CurScriptIndex]);
  69. NTC_Delay(500);
  70.  
  71. NTTM_CheckAct();
  72. }
  73. }
  74.  
  75. function NT_KeyEvents(keycode)
  76. {
  77. var _script;
  78.  
  79. switch(keycode)
  80. {
  81. case 19:
  82. _script = NTC_FindScript(NTConfig_Script[CurScriptIndex]);
  83. if(_script)
  84. {
  85. if(_script.running)
  86. {
  87. _script.Stop();
  88.  
  89. NTC_Delay(300);
  90. ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
  91.  
  92. SetStatusText("Stopped " + NTConfig_Script[CurScriptIndex]);
  93. }
  94. else
  95. {
  96. Load("NTBot/bots/" + NTConfig_Script[CurScriptIndex]);
  97. SetStatusText("Running " + NTConfig_Script[CurScriptIndex]);
  98. }
  99. }
  100. break;
  101. }
  102. }
  103.  
  104. function NT_ScriptMsgEvents(msg)
  105. {
  106. var _area;
  107.  
  108. switch(msg)
  109. {
  110. case "SCRIPT_END":
  111. if(++CurScriptIndex < NTConfig_Script.length)
  112. {
  113. NTTM_CheckAct();
  114. Load("NTBot/bots/" + NTConfig_Script[CurScriptIndex]);
  115. SetStatusText("Running " + NTConfig_Script[CurScriptIndex]);
  116. }
  117. else
  118. LastScript = true;
  119. break;
  120. default:
  121. Print("ÿc1" + NTConfig_Script[CurScriptIndex] + " : " + msg + " failed");
  122.  
  123. _area = GetArea();
  124.  
  125. if(_area)
  126. NTC_SendLogToOOG(NTC_LOG_COMMON, "ÿE00000" + NTConfig_Script[CurScriptIndex] + " : " + msg + " failed (" + _area.name + ")");
  127. else
  128. NTC_SendLogToOOG(NTC_LOG_COMMON, "ÿE00000" + NTConfig_Script[CurScriptIndex] + " : " + msg + " failed (unknown area)");
  129.  
  130. if(++CurScriptIndex < NTConfig_Script.length)
  131. {
  132. NTTM_CheckAct();
  133. Load("NTBot/bots/" + NTConfig_Script[CurScriptIndex]);
  134. SetStatusText("Running " + NTConfig_Script[CurScriptIndex]);
  135. }
  136. else
  137. LastScript = true;
  138. break;
  139. }
  140. }
Add Comment
Please, Sign In to add comment