Advertisement
kolton

Untitled

Oct 17th, 2011
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Universal baal leecher by Kolton with Autoleader by Ethic
  2.  
  3. // Editable variables
  4.  
  5. var _safeMessages = [": safe", ": tp safe", "tp is safe", "throne clear"]; // casing doesn't matter
  6. var _baalMessages = ["baal", "channel:", "kill this noob", "check out"]; // casing doesn't matter
  7.  
  8. // Internal variables
  9.  
  10. var towncheck, thronecheck, waited;
  11. var _leader = null;
  12.  
  13. function NTMain()
  14. {
  15.     RegisterEvent(EVENT_GAMEMSG, Chat);
  16.     Include("libs/common/NTCommon.ntl");
  17.     NTC_IncludeLibs();
  18.     NTC_IncludeConfig("NTBot/char_configs");
  19.  
  20.     NT_LoadConfig();
  21.     NTSI_LoadNIPFiles("NTBot/item_configs");
  22.  
  23.     NTA_Initialize();
  24.    
  25.     if (!NTTM_CheckAct(5)) {
  26.         NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
  27.         return;
  28.     }
  29.  
  30.     NTTMGR_TownManager();
  31.     NTTM_TownMove("portalspot");
  32.    
  33.     if (AutoLeaderDetect(131)) {
  34.         while (NTC_InMyParty(_leader)) {
  35.             if (towncheck && me.areaid === 109) {
  36.                 Print("ÿc4AutoBaalÿc0: Trying to take TP to throne.");
  37.                 NTM_UsePortal(null, 131, null);
  38.                 Delay(500);
  39.                
  40.                 if (!thronecheck) {
  41.                     NTM_MoveTo(me.areaid, 15113, 5050);
  42.                     NTP_DoPrecast(true);
  43.                     NTT_GetCorpses();
  44.                 }
  45.             }
  46.            
  47.             if (thronecheck && me.areaid === 131) {
  48.                 NTM_MoveTo(me.areaid, 15092, 5010);
  49.                 NTP_DoPrecast(true);
  50.                
  51.                 while (NTC_FindUnit(NTC_UNIT_MONSTER, 543)) {
  52.                     NTC_Delay(500);
  53.                 }
  54.                
  55.                 var _portal = NTC_FindUnit(NTC_UNIT_OBJECT, 563, 5);
  56.                
  57.                 if (!waited) {
  58.                     NTC_Delay(5000);
  59.                     waited = true;
  60.                 }
  61.                
  62.                 if (NTM_TakeUnit(NTC_UNIT_OBJECT, 563)) {
  63.                     NTM_MoveTo(me.areaid, 15166, 5903);
  64.                 }
  65.                
  66.                 NTT_GetCorpses();
  67.             }
  68.            
  69.             if (me.mode === 0 || me.mode === 17) {
  70.                 me.Cancel(0);
  71.             }
  72.            
  73.             Delay(500);
  74.         }
  75.     }
  76.    
  77.     NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  78. }
  79.  
  80. function Chat (msg, type) {
  81.     if (type === 0 && _leader !== null && msg.indexOf(_leader) > -1) {
  82.         for (var i = 0; i < _safeMessages.length; i += 1) {
  83.             if (msg.toLowerCase().indexOf(_safeMessages[i].toLowerCase()) > -1 && msg.indexOf(_leader) > -1) {
  84.                 towncheck = true;
  85.                 break;
  86.             }
  87.         }
  88.        
  89.         for (var i = 0; i < _baalMessages.length; i += 1) {
  90.             if (msg.toLowerCase().indexOf(_baalMessages[i].toLowerCase()) > -1 && me.areaid == 131 && msg.indexOf(_leader) > -1) {
  91.                 thronecheck = true;
  92.                 break;
  93.             }
  94.         }
  95.     }
  96. }
  97.  
  98. //Autoleader by Ethic
  99.  
  100. function AutoLeaderDetect(destination)
  101. {
  102.     var _suspect, _solofail;
  103.    
  104.     do {
  105.         _solofail = 0;
  106.         _suspect = GetPlayerUnit();
  107.         do {
  108.             if (_suspect.name !== me.name) {
  109.                 _solofail++;
  110.             }
  111.            
  112.             if (_suspect.areaid === destination) {
  113.                 _leader = _suspect.name;
  114.                
  115.                 Print("ÿc4AutoBaalÿc0: Autodetected " + _leader);
  116.                 return true;
  117.             }
  118.            
  119.             Delay(100);
  120.         } while (_suspect.GetNext());
  121.  
  122.         if(_solofail === 0) {
  123.             Print("ÿc4AutoBaalÿc0: Empty Game - Leaving");
  124.             Delay(1000);
  125.             return false;
  126.         }
  127.     }while(_leader == null);
  128. }
  129.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement