Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 17.42 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. var CurScriptIndex = 0;
  2. var LastScript = false;
  3. var Rev = "1018.P";
  4.  
  5. // Provalone Edit //
  6. //Include("libs/common/NTExp.ntl");
  7. //NTE_InitializeStats();
  8. //
  9. var SoJNotify = false;
  10. var CloneDiabloString = GetLocaleString(11005);
  11. var SoJString = GetLocaleString(11004).substr(3);
  12. var CloneDiabloNotify = false;
  13. var SoJNotify = false;
  14. var SoJElapsedTime = 0;
  15. var InitLife;
  16. var Corpses = 0;
  17. var checkActOnce = false;
  18. function D2NTStatus(where, time, message) { return SendCopyData('D2NT Manager', null, where << 16 | time, message); }
  19. function NTMain()
  20. {
  21.         Delay(1000);
  22.  
  23.         InitLife = me.hp;
  24.        
  25.         //Print(COLOR_4 + "[+] NTBot 4.2 [+]");
  26.  
  27.         Include("libs/common/NTCommon.ntl");
  28.         NTC_IncludeLibs();
  29.         NTC_IncludeConfig("NTBot/char_configs");
  30.         Include("libs/common/NTExp.ntl");
  31.  
  32.         NT_LoadConfig();
  33.         NTE_InitializeStats();
  34.  
  35.         if(NTConfig_FreeSpace == 0)
  36.                 Print(COLOR_2 + "Please don't forget to set NTConfig_FreeSpace in your character config to avoid your inv filling");
  37.        
  38.         NT_ClearMessages(); // leech improvements
  39.        
  40.         //var _time1 = NTU_timeStamp();
  41.         //Print ("Begin Parse: "+_time1);
  42.         NTSI_LoadNIPFiles("NTBot/item_configs");
  43.         //var _time2 = NTU_timeStamp();
  44.         //Print ("End Parse: "+_time2);
  45.  
  46.         // ubi21 Enigma reset start
  47.         ////////////////////////////
  48.         NTU_LogExitStatus("F");
  49.  
  50.         // ubi21 Enigma reset end
  51.         ////////////////////////////   
  52.  
  53.         if(NTConfig_StartDelay > 0);
  54.                 NTC_Delay(NTConfig_StartDelay);
  55.  
  56.         GetPath(me.areaid, me.x, me.y, me.x, me.y, true);
  57.  
  58.         SetUIState(0x0A, true);
  59.  
  60.         // ubi21 Enigma reset start
  61.         ////////////////////////////   
  62.         if(!NTT_PutBackEnigma()) {
  63.                 NTC_Delay(240000); // Wait 4 mins to prevent r/d 240000
  64.                 ExitGame();
  65.         }
  66.         // ubi21 Enigma reset end
  67.         ////////////////////////////   
  68.  
  69.         if(NTConfig_CheckPassword && !me.gamepassword){
  70.                 Print(COLOR_1 + "1No password found exiting game");//s
  71.                 NTC_SendLogToOOG(NTC_LOG_COMMON, COLOR_1 + "Exiting Game- No Password");
  72.                 NTC_Delay(2000);               
  73.                 ExitGame();
  74.         }
  75.  
  76.         Corpses = NTT_GetCorpses();
  77.         if (Corpses > 0 || InitLife < 10)
  78.                 NTU_DeathLog(Corpses, InitLife);
  79.         if(NTConfig_Script.length > 0)
  80.         {
  81.                 NTCU_InitCubing();
  82.  
  83.                 NTT_ClearInventory();
  84.                 NTT_ClearBelt();
  85.  
  86.                 // ubi21 Enigma reset start
  87.                 ////////////////////////////           
  88.                 if(!NTT_LookForEnigma()) {
  89.                         if (GetUIState(0x01))
  90.                                 SetUIState(0x01, false);       
  91.                         NTC_Delay(240000); // Wait 4 mins to prevent r/d 240000
  92.                         ExitGame();            
  93.                 }
  94.                 // ubi21 Enigma reset end
  95.                 ////////////////////////////
  96.  
  97.                 if(NTConfig_GoWestFromLut){ // if bot starts in act 2 use warriv to go to act 1
  98.                         GoWestFromLutGholein();
  99.                 }
  100.  
  101.                 Load("NTBot/tools/NTToolsThread.ntj");
  102.  
  103.                 if(NTConfig_HostileHandler)
  104.                         Load("NTBot/tools/NTHostHandler.ntj");
  105.                 if(DPSMeter)
  106.                         Load("NTBot/tools/DPS.ntj");
  107.                        
  108.                        
  109.                 RegisterEvent(EVENT_GAMEMSG, NT_GameMsgEvents);
  110.                 RegisterEvent(EVENT_KEYDOWN, NT_KeyEvents);
  111.                 RegisterEvent(EVENT_SCRIPTMSG, NT_ScriptMsgEvents);
  112.  
  113.                 Load("NTBot/bots/" + NTConfig_Script[CurScriptIndex]);
  114.                 SetStatusText(Rev + " "+ NTConfig_Script[CurScriptIndex]);
  115.  
  116.                 Include("libs/common/NTSnagit.ntl");
  117.                 NTSI_ClearIgnoredItems();
  118.  
  119.                 NTC_LogCurScript(NTConfig_Script[CurScriptIndex]);//jinay item log
  120.  
  121.                 var leaderParty = false;
  122.  
  123.                 while(!LastScript || CloneDiabloNotify || SoJNotify || NTC_InMyParty(NTConfig_Leader)) // SoJNotify is a part of soj addon
  124.                 {
  125.                         NTC_Delay(1000);
  126.                        
  127.                         for(var i = 0 ; i < NTConfig_Script.length && !leaderParty ; i++)
  128.                         {
  129.                                 if(NTConfig_Script[i].toLowerCase().indexOf("leech") != -1)
  130.                                 {
  131.                                         for(var j = 0 ; j < NTConfig_PartyMaxTime && !NTC_InMyParty(NTConfig_Leader) ; j++)
  132.                                                 Delay(1000);
  133.                                        
  134.                                         if(NTC_InMyParty(NTConfig_Leader))
  135.                                         {
  136.                                                 leaderParty = true;
  137.                                         }
  138.                                         else
  139.                                         {
  140.                                                 NTC_PrintPossibleLeaders();
  141.                                                 Print(COLOR_1 + "Can't find leader!");
  142.                                                 Delay(500);
  143.                                                 Print(COLOR_1 + "You either have it spelled or cased wrong");
  144.                                                 Delay(500);
  145.                                                 Print(COLOR_1 + "Or leader is not in game");
  146.                                                 Delay(500);
  147.                                                 Print(COLOR_1 + "Check logs/namelog/" + me.charname + "-leaderName.txt for possible leader names from this game"); // this should print a list of all toons in game so people can C/P if they are having probs
  148.                                                 Delay(1500);
  149.                                                 ExitGame();
  150.                                         }
  151.                                         break;
  152.                                 }
  153.                         }
  154.                        
  155.                         if(LastScript && !checkActOnce && leaderParty && NTC_InMyParty(NTConfig_Leader)) {
  156.                                 NTTM_CheckAct();
  157.                                 checkActOnce = true; // this is added so if you need to go back in someplace the bot doesn't keep towning
  158.                         }
  159.                
  160.                         if(leaderParty && !NTC_InMyParty(NTConfig_Leader)){
  161.                                 if(!LastScript) {
  162.                                         NTE_ComputeStats(false);
  163.                                 }
  164.                                 Delay(350);
  165.                                 _Checkscript = GetScript();
  166.                                 if(_Checkscript){
  167.                                         NTC_StopScriptLeecher();
  168.                                         Delay(150);    
  169.                                 }                      
  170.                                 NTC_CancelMenus();
  171.                                 Delay(NTConfig_LeechExitDelay);                        
  172.                                 ExitGame();
  173.                         }
  174.  
  175.                         // soj addon by kolton
  176.                         if(SoJNotify)
  177.                         {
  178.                                 SoJElapsedTime += 1;
  179.                                
  180.                                 if(LastScript)
  181.                                 {
  182.                                         NTTM_CheckAct();
  183.                                         SetStatusText(COLOR_4 + "Waiting for SoJ sales... " + COLOR_0 + (NTConfig_SoJWaitTime*60-SoJElapsedTime));
  184.                                 }
  185.                                
  186.                                 if(SoJElapsedTime >= NTConfig_SoJWaitTime*60)
  187.                                         SoJNotify = false;
  188.                         }
  189.                         // soj addon end
  190.                 }
  191.         }
  192.  
  193.         // Provalone Edit
  194.         NTE_ComputeStats(false);
  195.         //
  196.         if(NTConfig_PublicMode && NTConfig_PropsForEtal > 0) {
  197.                 Include("NTBot/char_configs/EtalPR.ntl");
  198.                 for(var i = 0 ; i < NTConfig_PropsForEtal ; i++) {
  199.                         Say(NTC_RandomSelect(etalSpam));
  200.                         Delay(1500);
  201.                 }
  202.                 Say("Check out d2etal.com");
  203.                 Delay(1000); // change this to 1 second
  204.         }
  205.         ExitGame();
  206. }
  207.  
  208. function NT_GameMsgEvents(msg, type)
  209. {
  210.  
  211.         // ubi21 Enigma reset start
  212.         ////////////////////////////
  213.         var _holdPauseCheck = "";
  214.         // ubi21 Enigma reset end
  215.         ////////////////////////////
  216.  
  217.         _area = GetArea();     
  218.        
  219.         if(type == 4)
  220.         {
  221.                 if(msg.indexOf(CloneDiabloString) != -1)
  222.                 {
  223.                         CloneDiabloNotify = true;
  224.                         SoJNotify = false;
  225.  
  226.                         NTC_SendLogToOOG(NTC_LOG_COMMON, COLOR_4 + CloneDiabloString);
  227.                         SetStatusText(COLOR_1 + CloneDiabloString);
  228.                         D2NTStatus("Stop", 0, "Stop"); //This is a fake ID itll just interrupt the current status loop. Simple but effective.
  229.                         D2NTStatus(8, 0, CloneDiabloString);
  230.                         me.maxgametime = 0;
  231.  
  232.                         // ubi21 Enigma reset start
  233.                         ////////////////////////////
  234.  
  235.                         _holdPauseCheck = NTU_GetExitStatus();
  236.                         while(_holdPauseCheck == "T") {
  237.                                 NTC_Delay(500);
  238.                                 _holdPauseCheck = NTU_GetExitStatus();
  239.                         }
  240.                         // ubi21 Enigma reset end
  241.                         ////////////////////////////
  242.  
  243.                         NTC_StopScript(NTConfig_Script[CurScriptIndex]);
  244.                         NTC_Delay(500);
  245.  
  246.                         NTTM_CheckAct();
  247.                 }
  248.                 else if(msg.indexOf(SoJString) != -1 && !CloneDiabloNotify && NTConfig_SoJWaitTime > 0)
  249.                 { // part of soj addon. !CloneDiabloNotify was added to prevent timer start on oversales after Diablo walks.
  250.                         SoJNotify = true;
  251.                         SoJElapsedTime = 0;
  252.                        
  253.                         NTC_SendLogToOOG(NTC_LOG_COMMON, COLOR_4 + msg);
  254.                        
  255.                         me.maxgametime = 0;
  256.                 }
  257.         }
  258.  
  259.         else if(type == 1 && (msg.toLowerCase().indexOf("d2nt") != -1 || msg.toLowerCase().indexOf("error") != -1 || msg.toLowerCase().indexOf("fail") != -1))
  260.         {
  261.                 var date = new Date().toLocaleFormat("<%a, %b %d, %H:%M>");
  262.                 var logfile = FileOpen("logs/errorlog/"+me.charname+"-errorlog.txt", 2);
  263.                 if(!logfile)
  264.                         var logfile = FileOpen("logs/errorlog/"+me.charname+"-errorlog.txt", 1);
  265.  
  266.                 logfile.WriteLine(date + " - " + msg);
  267.                 logfile.Close();
  268.         }
  269.  
  270.         else if(type == 1 && (msg.toLowerCase().indexOf("skipped") != -1 ))
  271.         {
  272.                 var date = new Date().toLocaleFormat("<%a, %b %d, %H:%M>");
  273.                 var logfile = FileOpen("logs/skiplog/"+me.charname+"-skiplog.txt", 2);
  274.                 if(!logfile)
  275.                         var logfile = FileOpen("logs/skiplog/"+me.charname+"-skiplog.txt", 1);
  276.  
  277.                 logfile.WriteLine(date + " - " + msg + " ( " + _area.name + " ) ");
  278.                 logfile.Close();
  279.         }
  280.         else if(type == 0 && msg.indexOf(NTConfig_Leader) != -1){ // leech improvements
  281.                 NTC_CheckPlayer(NTConfig_Leader);
  282.                 //Print(COLOR_1 + "The leader is in " + _leaderareaid);
  283.                 if((_leaderareaid == 130 || _leaderareaid == 131) && msg.indexOf(NTConfig_TakeTpBaal) != -1){ // all baal leech scripts will use the same one
  284.                         //Print(COLOR_8 + "received take baal take tp message")                
  285.                         NT_File("logs/messagecomands/"+me.charname+"-baal.txt", 1, "takebtp")
  286.                 }
  287.                 else if((_leaderareaid == 130 || _leaderareaid == 131) && msg.indexOf(NTConfig_GrabShrine) != -1){ // so you can set the var for grabbing shrine different from the take tp one
  288.                         //Print(COLOR_8 + "received take shrine message")
  289.                         NT_File("logs/messagecomands/"+me.charname+"-baal.txt", 1, "grabshrine")
  290.                 }
  291.                 else if(_leaderareaid == 108 && msg.indexOf(NTConfig_TakeTpDiablo) != -1){ // all diablo leech scripts will use the same one
  292.                         //Print(COLOR_8 + "received take diablo tp message")                   
  293.                         NT_File("logs/messagecomands/"+me.charname+"-diablo.txt", 1, "takedtp")
  294.                 }
  295.                 else if(_leaderareaid == 83 && msg.indexOf(NTConfig_TakeTpTravincal) != -1){ // all diablo leech scripts will use the same one
  296.                         //Print(COLOR_8 + "received take travincal tp message")                                        
  297.                         NT_File("logs/messagecomands/"+me.charname+"-trav.txt", 1, "takettp")
  298.                 }
  299.                 // add in something here that if leader recieves a message indexOf("entered") it will send the join game message.  make sure it is something specific to entered battlenet message
  300.         }
  301.  
  302. }
  303. /*
  304. function NT_KeyEvents(keycode)
  305. {
  306.         var _script;
  307.  
  308.         switch(keycode)
  309.         {
  310.         case 19:        //Pause/Break
  311.                 _script = NTC_FindScript(NTConfig_Script[CurScriptIndex]);
  312.                 if(_script)
  313.                 {
  314.                         if(_script.running)
  315.                         {
  316.                                 _script.Stop();
  317.                                 NT_ClearMessages();
  318.                                 NTC_Delay(300);
  319.                                 ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
  320.  
  321.                                 SetStatusText(COLOR_1 + Rev + "    Paused " + NTConfig_Script[CurScriptIndex]);
  322.                         }
  323.                         else
  324.                         {
  325.                                 Load("NTBot/bots/" + NTConfig_Script[CurScriptIndex]);
  326.                                 SetStatusText(Rev + "  " + NTConfig_Script[CurScriptIndex]);
  327.                         }
  328.                 }
  329.                 break;
  330.  
  331.         case 33: //Page Up
  332.                 _script = NTC_FindScript(NTConfig_Script[CurScriptIndex]);
  333.  
  334.                 if(_script.running)
  335.                 {
  336.                         _script.Stop();
  337.                         NT_ClearMessages();
  338.                         NTC_Delay(300);
  339.                         ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
  340.  
  341.                         SetStatusText(COLOR_11 + Rev + "    Stopped " + NTConfig_Script[CurScriptIndex]);
  342.                         break;
  343.                 }
  344.                 else
  345.                 {
  346.                         for(i=0; i<NTConfig_Script.length-1; i++)
  347.                         {
  348.                                 if(CurScriptIndex < NTConfig_Script.length-1)
  349.                                         CurScriptIndex++;
  350.                                 else
  351.                                         CurScriptIndex = 0;
  352.                         }
  353.  
  354.                         SetStatusText(COLOR_14 + Rev + "    Back to " + NTConfig_Script[CurScriptIndex]);
  355.                         break;
  356.                 }
  357.  
  358.         case 34:        //Page Down
  359.                 _script = NTC_FindScript(NTConfig_Script[CurScriptIndex]);
  360.        
  361.                 if(_script.running)
  362.                 {
  363.                         _script.Stop();
  364.                         NT_ClearMessages();
  365.                         SetStatusText(COLOR_11 + Rev + "    Stopped " + NTConfig_Script[CurScriptIndex]);
  366.                 }
  367.                         else if(++CurScriptIndex < NTConfig_Script.length)
  368.                                 SetStatusText(COLOR_14 + Rev + "    Skipped to " + NTConfig_Script[CurScriptIndex]);
  369.                         else if(++CurScriptIndex >= NTConfig_Script.length)
  370.                         {
  371.                                 CurScriptIndex = 0;
  372.                                 SetStatusText(COLOR_2 + Rev + "    Skipped to " + NTConfig_Script[CurScriptIndex]);
  373.                         }
  374.                         break;
  375.         case 97:        //1 (Num Lock)
  376.                 {
  377.                         NTU_DropItems();
  378.                 }
  379.                 break;
  380.         case 98:        //2 (Num Lock)
  381.                 {
  382.                         NTU_DevelopementTools();
  383.                 }
  384.                 break;
  385.         case 99:        //3 (Num Lock)
  386.                 {
  387.                         NTU_LogPrint("logs/testlog/"+me.charname+"-Coords.txt", " New Coord[" + me.x + ", " + me.y + "] " );
  388.                 }
  389.                 break;
  390.         case 100:       //4 (Num Lock)
  391.                 {
  392.                         //NTU_KeyPressList();
  393.                 }
  394.                 break;
  395.         case 101:       //5 (Num Lock)
  396.                 {
  397.                         NTU_TLInventory();
  398.                 }
  399.                 break;
  400.         case 102:       //6 (Num Lock)
  401.                 {
  402.                         NTU_CursorILvl();
  403.                 }
  404.                 break;
  405.         case 103:       //7 (Num Lock)
  406.                 {
  407.                         NTT_CheckFreeStashSpace(true);
  408.                         NTT_CheckFreeInventorySpace(true);
  409.                 }
  410.                 break; 
  411.         case 105:       //9 (Num Lock)
  412.                 {
  413.                         NTU_CheckMyStats();
  414.                 }
  415.                 break;
  416.         case 106:       //* (Num Lock)
  417.                 {
  418.                         NTU_CheckCoord();
  419.                 }
  420.                 break;
  421.         case 107:       //+ (Num Lock)
  422.                 {
  423.                         NTU_TLNipCheck();
  424.                 }
  425.                 break;
  426.  
  427.  
  428.         }
  429. }*/
  430.  
  431. function NT_KeyEvents(keycode)
  432. {
  433.         var _script;
  434.         switch(keycode) {
  435.                 case Do_PauseBot:
  436.                 _script = NTC_FindScript(NTConfig_Script[CurScriptIndex]);
  437.                         if(_script) {
  438.                                 if(_script.running) {
  439.                                         _script.Stop();
  440.                                         NT_ClearMessages();
  441.                                         NTC_Delay(300);
  442.                                         ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
  443.                                         SetStatusText(COLOR_1 + Rev + "    Paused " + NTConfig_Script[CurScriptIndex]);
  444.                                 }
  445.                                 else {
  446.                                         Load("NTBot/bots/" + NTConfig_Script[CurScriptIndex]);
  447.                                         SetStatusText(Rev + " " + NTConfig_Script[CurScriptIndex]);
  448.                                 }
  449.                         }
  450.                         break;
  451.                 case Do_PrevScript:
  452.                         _script = NTC_FindScript(NTConfig_Script[CurScriptIndex]);
  453.  
  454.                         if(_script.running) {
  455.                                 _script.Stop();
  456.                                 NT_ClearMessages();
  457.                                 NTC_Delay(300);
  458.                                 ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
  459.                                 SetStatusText(COLOR_11 + Rev + " Stopped " + NTConfig_Script[CurScriptIndex]);
  460.                                 break;
  461.                         }
  462.                         else {
  463.                                 for(i=0; i<NTConfig_Script.length-1; i++) {
  464.                                         if(CurScriptIndex < NTConfig_Script.length-1)
  465.                                                 CurScriptIndex++;
  466.                                         else
  467.                                                 CurScriptIndex = 0;
  468.                                 }
  469.                                 SetStatusText(COLOR_14 + Rev + " Back to " + NTConfig_Script[CurScriptIndex]);
  470.                         }
  471.                         break;
  472.                 case Do_NextScript:
  473.                         _script = NTC_FindScript(NTConfig_Script[CurScriptIndex]);
  474.                        
  475.                         if(_script.running) {
  476.                                 _script.Stop();
  477.                                 NT_ClearMessages();
  478.                                 SetStatusText(COLOR_11 + Rev + " Stopped " + NTConfig_Script[CurScriptIndex]);
  479.                         }
  480.                         else if(++CurScriptIndex < NTConfig_Script.length)
  481.                                 SetStatusText(COLOR_14 + Rev + " Skipped to " + NTConfig_Script[CurScriptIndex]);
  482.                         else if(++CurScriptIndex >= NTConfig_Script.length) {
  483.                                 CurScriptIndex = 0;
  484.                                 SetStatusText(COLOR_2 + Rev + " Skipped to " + NTConfig_Script[CurScriptIndex]);
  485.                         }
  486.                         break;
  487.                 case Do_DropItems:
  488.                         NTU_DropItems();
  489.                         break;
  490.                 case Do_DevTools:
  491.                         NTU_DevelopementTools();
  492.                         break;
  493.                 case Do_CoordLog:
  494.                         NTU_LogPrint("logs/testlog/"+me.charname+"-Coords.txt", " New Coord[" + me.x + ", " + me.y + "] " );
  495.                         break;
  496.                 case Do_HotKeyList:
  497.                         Key_HotList();
  498.                         break;
  499.                 case Do_CursorILvL:
  500.                         NTU_CursorILvl();
  501.                         break;
  502.                 case Do_StatsLog:
  503.                         NTU_CheckMyStats();
  504.                         break;
  505.                 case Do_PrintCoord:
  506.                         NTU_CheckCoord();
  507.                         break;
  508.                 case Do_CheckSpace:
  509.                         if(CheckStashSpace)
  510.                                 NTT_CheckFreeStashSpace(true);
  511.                         if(CheckInvSpace)
  512.                                 NTT_CheckFreeInventorySpace(true);
  513.                         break;
  514.                 case Do_NipCheck:
  515.                         NTU_TLNipCheck();
  516.                         break;
  517.                 case Do_InvTxtLog:
  518.                         NTU_TLInventory();
  519.                         break;
  520.                 case Do_CheckBPs:
  521.                         T_BPsPrint();
  522.                         break;
  523.                 case Do_ExitGame:
  524.                         Print(COLOR_4 + "Calculating stats for game!");
  525.                         NTE_ComputeStats(false);
  526.                         ExitGame();
  527.                         break;
  528.         }
  529. }
  530.  
  531. function NT_ScriptMsgEvents(msg)
  532. {
  533.         var _area;
  534.  
  535.         switch(msg)
  536.         {
  537.         case "QuitGame":
  538.                 NTC_StopScript(NTConfig_Script[CurScriptIndex]);
  539.                 NTC_CancelMenus();
  540.                 LastScript = true;
  541.                 break;
  542.         case "HOSTILE":
  543.                 NTC_SendMsgToScript(NTConfig_Script[CurScriptIndex], "pause");
  544.                 break;
  545.         case "SCRIPT_END":
  546.                 if(++CurScriptIndex < NTConfig_Script.length)
  547.                 {
  548.                         NTTM_CheckAct();
  549.                         Load("NTBot/bots/" + NTConfig_Script[CurScriptIndex]);
  550.                         SetStatusText(Rev + "   " + NTConfig_Script[CurScriptIndex]);
  551.                         NTC_LogCurScript(NTConfig_Script[CurScriptIndex]);
  552.                 }
  553.                 else{
  554.                         LastScript = true;
  555.  
  556.  
  557.                 }
  558.  
  559.                 break;
  560.         default:
  561.                 Print(COLOR_1 + NTConfig_Script[CurScriptIndex] + " : " + msg + " failed");
  562.  
  563.                 _area = GetArea();
  564.  
  565.                 if(_area)
  566.                         NTC_SendLogToOOG(NTC_LOG_COMMON, COLOR_1 + NTConfig_Script[CurScriptIndex] + " : " + msg + " failed (" + _area.name + ")");
  567.                 else
  568.                         NTC_SendLogToOOG(NTC_LOG_COMMON, COLOR_1 + NTConfig_Script[CurScriptIndex] + " : " + msg + " failed (unknown area)");
  569.  
  570.                 if(++CurScriptIndex < NTConfig_Script.length)
  571.                 {
  572.                         NTTM_CheckAct();
  573.                         Load("NTBot/bots/" + NTConfig_Script[CurScriptIndex]);
  574.                         SetStatusText(Rev + "  "  + NTConfig_Script[CurScriptIndex]);
  575.                         NTC_LogCurScript(NTConfig_Script[CurScriptIndex]);
  576.                 }
  577.                 else
  578.                         LastScript = true;
  579.                 break;
  580.         }
  581. }
  582.  
  583. function NT_ClearMessages(){ // leech improvemetst
  584.         for(var i = 0 ; i < NTConfig_Script.length ; i++){
  585.                 if(NTConfig_Script[i].toLowerCase().indexOf("leech") != -1){
  586.                         if(NTConfig_Script[i].toLowerCase().indexOf("baal") != -1){
  587.                                 NT_File("logs/messagecomands/"+me.charname+"-baal.txt", 1, " ");
  588.                         }
  589.                         if(NTConfig_Script[i].toLowerCase().indexOf("diablo") != -1){
  590.                                 NT_File("logs/messagecomands/"+me.charname+"-diablo.txt", 1, " ");
  591.                         }
  592.                         if(NTConfig_Script[i].toLowerCase().indexOf("trav") != -1){
  593.                                 NT_File("logs/messagecomands/"+me.charname+"-trav.txt", 1, " ");
  594.                         }
  595.                 }
  596.         }
  597. }
  598.  
  599. function NTC_CancelMenus() { // more koreans
  600.         while (GetUIState(0x01) || GetUIState(0x08) || GetUIState(0x0C) || GetUIState(0x0F) || GetUIState(0x14) ||
  601.                 GetUIState(0x17) || GetUIState(0x19) ||   GetUIState(0x1A) || GetUIState(0x24)){    
  602.                
  603.                 for (var i = 0; i < 40; i++){
  604.                         if ((i % 20) == 0){
  605.                                 me.Cancel(1);
  606.                         }
  607.                         Delay(100);
  608.                         if (!GetUIState(0x01) && !GetUIState(0x08) && !GetUIState(0x0C) && !GetUIState(0x0F) && !GetUIState(0x14) &&
  609.                                         !GetUIState(0x17) && !GetUIState(0x19) &&  !GetUIState(0x1A) && !GetUIState(0x24)){
  610.                                
  611.                                 NTC_PingDelay(300);
  612.                                 break;
  613.                         }
  614.                 }
  615.         }
  616. }
  617.  
  618. function NTC_StopScriptLeecher(){              
  619.         _script = NTC_FindScript(NTConfig_Script[CurScriptIndex]);
  620.         if(_script){
  621.                 if(_script.running){
  622.                         _script.Stop();
  623.                         NTC_Delay(150);
  624.                         ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
  625.                 }
  626.         }
  627.         return;
  628. }
  629.  
  630. function NTC_PrintPossibleLeaders()
  631. {
  632.         var _player;
  633.         var _myPartyId;
  634.  
  635.         _player = GetPlayerUnit();
  636.  
  637.         if(_player)
  638.         {
  639.                 do
  640.                 {
  641.                         if( _player.name == me.name)
  642.                                 continue;
  643.                         NTC_LogPrintSimple("logs/namelog/"+me.charname+"-leaderName.txt", _player.name);                       
  644.                 } while(_player.GetNext());
  645.         }
  646.         return false;
  647. }