Advertisement
Guest User

NTChaosLeecher.ntj

a guest
Jul 13th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.37 KB | None | 0 0
  1. // Chaos Leech Script Modified
  2. // by ChX-David
  3. // for Clan ChX and friends
  4.  
  5. // Modifications:
  6. // Customizable Commands
  7. // Passive Leech Added for use with NTChaosSanctuary.ntj (modified by sav)
  8. // you can find that script here. http://pastebin.com/iFpEg0Du
  9.  
  10. // New Vars
  11. // NTConfig_IsPassiveLeecher - If true Passive leech will be used. If false LeechFighter will be used.
  12. // NTConfig_ReverseCSLeech - Reverse leech? (Fect, Des, Viz) (Must match leaders setting: NTConfig_CS_ReverseCS)
  13.  
  14. // Example of Character Config Entry
  15.  
  16. // NTConfig_Script.push("NTChaosLeecher.ntj"); // (NTConfig_Leader must be configured above).
  17. // NTConfig_IsPassiveLeecher = false; // Use passive leech settings. (Wont Fight)
  18. // NTConfig_ReverseCSLeech = false; //Complete run reversed
  19. // NTConfig_LeechFrom = "S"; // (E)ntrance | (S)tar (Must match leader's setting).
  20. // NTConfig_TakeTpDiablo = "config me"; // Message from leader signifying you to take portal. (Must be different than Baal & Trav tp messages.)
  21. // NTConfig_UseChatCommandPortal = false; // Use portal after TakeTpDiablo message? (False will attempt taking first TP made by leader, ignores TakeTpDiablo.)
  22.  
  23. RegisterEvent(EVENT_SCRIPTMSG, HostileHandler);
  24.  
  25. var _hostilepause = false;
  26. var Diablo_PreMessage = "I will eat your flesh for dinner Diablo!";
  27. var _CSSealsOnly = false;
  28. var _PublicMode = true;
  29.  
  30. function NTMain(){
  31. Include("libs/common/NTCommon.ntl");
  32. NTC_IncludeLibs();
  33.  
  34. NTC_IncludeConfig("NTBot/char_configs");
  35. NT_LoadConfig();
  36.  
  37. NTSI_LoadNIPFiles("NTBot/item_configs");
  38.  
  39. NTA_Initialize();
  40.  
  41. if(!NTTM_CheckAct()){
  42. NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
  43. return;
  44. }
  45. if(me.areaid != 103){
  46. if(!NTTM_TownMove("waypoint")) {
  47. NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
  48. return;
  49. }
  50. if(!NTM_TakeWaypoint(103)) {
  51. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
  52. return;
  53. }
  54. }
  55. NTTMGR_TownManager();
  56. NTTM_TownMove("portalspot");
  57.  
  58. if(NTConfig_IsPassiveLeecher)
  59. {
  60. RegisterEvent(EVENT_GAMEMSG, chat);
  61.  
  62. while(1)
  63. {
  64. if(me.mode == 17 || me.mode == 0 || me.hp < 1)
  65. me.Cancel(0);
  66. NTC_Delay(250);
  67. }
  68. }
  69. else
  70. {
  71. if(NTConfig_UseChatCommandPortal)
  72. {
  73. while(!NT_DiabloLeechMessageHandler())
  74. {
  75. Delay(500);
  76. }
  77. for(var i = 0 ; i < 100 && me.areaid == 103 ; i++)
  78. {
  79. NTM_UsePortal("BluePortal", 108, NTConfig_Leader);
  80. Delay(500);
  81. }
  82. }
  83. else
  84. {
  85. myStartArea = me.areaid;
  86. while(1)
  87. {
  88. NTM_UsePortal("BluePortal", 108, NTConfig_Leader);
  89. if (myStartArea != me.areaid)
  90. {
  91. break;
  92. }
  93.  
  94. Delay(500);
  95. }
  96. }
  97. }
  98.  
  99. while(me.areaid == 0)
  100. {
  101. NTC_Delay(200);
  102. }
  103.  
  104. NTP_DoPrecast(true, NTConfig_LeechBo);
  105. NTCS_ClearEntrance();
  106. NTCS_OpenSealsInt();
  107. NTCS_KillDiablo();
  108. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  109. }
  110.  
  111. function NTCS_Say(msg){
  112. if (NTConfig_PublicMode && msg && msg.length > 0){
  113. Say (msg);
  114. NTC_Delay(50);
  115. }
  116. }
  117.  
  118. function NTCS_GetRandomText(){
  119. var s = "";
  120. var i = 0;
  121. while ((i++ < 5) || (s.length == 0))
  122. s = GetLocaleString(Random(1069, 1295));
  123. return s.length > 0 ? s : "Aww.";
  124. }
  125.  
  126. function NTCS_KillSealBoss(monsterName){
  127. for(var i = 0 ; i < 10 ; i++){
  128. NTC_Delay(100);
  129. if(NTA_KillMonster(monsterName)){
  130. if (!_CSSealsOnly) NTA_ClearPosition(20, true, 2);
  131. return true;
  132. }
  133. }
  134. return false;
  135. }
  136.  
  137. function NTCS_ClearEntrance(){
  138. var pos;
  139. if ((_CSSealsOnly == true) || (NTConfig_LeechFrom == "S")){
  140. pos = new Array();
  141. }
  142. else if (CheckCollision(me.areaid, 7784, 5447, 1)){
  143. pos = [
  144. 7794, 5540, 7794, 5515
  145. , 7770, 5499, 7794, 5480, 7803, 5499, 7818, 5499, 7818, 5480, 7818, 5447, 7818, 5428
  146. , 7803, 5421, 7794, 5403, 7784, 5421, 7770, 5428, 7770, 5447, 7770, 5480
  147. , 7770, 5480, 7770, 5447, 7784, 5421
  148. , 7770, 5414, 7770, 5392, 7770, 5363, 7770, 5341
  149. , 7794, 5341
  150. , 7818, 5341, 7818, 5392, 7818, 5363
  151. , 7794, 5363
  152. ];
  153. }
  154. else{
  155. pos = [
  156. 7794, 5540, 7794, 5515
  157. , 7818, 5499, 7794, 5480, 7784, 5499, 7770, 5499, 7770, 5480, 7770, 5447, 7770, 5428
  158. , 7784, 5421, 7794, 5403, 7803, 5421, 7818, 5428, 7818, 5447, 7818, 5480
  159. , 7818, 5447, 7803, 5421
  160. , 7818, 5414, 7818, 5392, 7818, 5363, 7818, 5341
  161. , 7794, 5341
  162. , 7770, 5341, 7770, 5392, 7770, 5363
  163. , 7794, 5363
  164. ];
  165. }
  166. if(_PublicMode)
  167. pos = pos.concat([7794, 5363, 7770, 5363, 7770, 5341, 7818, 5363, 7818, 5341]);
  168.  
  169. while (pos.length > 0){
  170. NTM_MoveTo(me.areaid, pos.shift(), pos.shift());
  171. NTA_ClearPosition(20, true, 2);
  172. }
  173. NTM_MoveTo(me.areaid, 7794, 5341);
  174. if(_PublicMode){
  175. NTM_MoveTo(me.areaid, 7794, 5341);
  176. NTA_ClearPosition(20, true, 2);
  177. }
  178. else if ((_CSSealsOnly == true) || (NTConfig_LeechFrom == "S")){
  179. NTM_MoveTo(me.areaid, 7792, 5292);
  180. NTM_MoveTo(me.areaid, 7858, 5294);
  181. }
  182. }
  183.  
  184. function NTCS_KillDiablo(){
  185. NTM_MoveTo(me.areaid, 7792, 5292);
  186. NTP_DoPrecast(true, NTConfig_LeechBo);
  187. if(NTConfig_IdInField){
  188. NT_FieldID();
  189. }
  190. if(me.classid == NTC_CHAR_CLASS_ASSASSIN) {
  191. if(NTConfig_UseTraps) {
  192. var _attackPos2 = [7784,5290,7793,5284,7801,5289,7797,5299,7787,5299];
  193. for(var i=0;i<5;i++) {
  194. if(i == 0 || i == 2 || i == 3) // Added delays to prevent trap miscast
  195. NTC_Delay(25);
  196. if(NTConfig_ActBossTrapSet[i] > 0)
  197. NTC_CastSkill(NTConfig_ActBossTrapSet[i], NTC_HAND_RIGHT, _attackPos2[i*2],_attackPos2[(i*2)+1]);
  198. }
  199. }
  200. }
  201. var count = 0;
  202. while(!NTA_KillMonster(243)){
  203. NTC_Delay(200);
  204. if (count++ >= 30) // hmm 6 seconds ?
  205. break;
  206. }
  207. NTSI_PickItems();
  208. NTM_MoveTo(me.areaid, 7792, 5292);
  209. }
  210.  
  211. function NTCS_OpenSealError(id){
  212. NTC_SendMsgToScript("NTBotGame.ntj", "NTCS_OpenSealsInt(" + id + ")");
  213.  
  214. var msg = "Unable to find seal : ";
  215. switch (id){
  216. case 392 : msg += GetLocaleString(2853); break;
  217. case 394 : msg += GetLocaleString(2852); break;
  218. case 396 : msg += GetLocaleString(2851); break;
  219. default : break;
  220. }
  221. msg += ". Aborting ...";
  222. NTTM_CheckAct();
  223. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  224. }
  225.  
  226. function NTCS_OpenSealsInt(){
  227. //[0,1,2] //0=Venom(First) 1=DeSeis(Second) 2=Vizer(Third)
  228. //[1,0,2] //1=DeSeis(First) 0=Venom(Second) 2=Vizer(Third)
  229.  
  230. if(NTConfig_ReverseCSLeech)
  231. {
  232. var _order = [0,1,2];
  233. }
  234. else
  235. {
  236. var _order = [2,1,0];
  237. }
  238.  
  239. var _RandomSeals = false; //Do Random Seals if your bored.
  240. var unit, count = 0, i = 0;
  241. if (_RandomSeals){
  242. rand1 = Math.floor(Math.random()*_order.length);
  243. rand2 = Math.floor(Math.random()*_order.length);
  244. rand3 = Math.floor(Math.random()*_order.length);
  245. var _n=0, _n2=0, _n3=0;
  246. for (e = 0; e < _order.length; e++){
  247. switch(e){
  248. case 0: var _n = rand1;
  249. case 1: rand2 = Math.floor(Math.random()*_order.length); if (rand2 != _n) _n2 = rand2;
  250. case 2: rand3 = Math.floor(Math.random()*_order.length); if (rand3 != _n && rand3 != _n2) _n3 = rand3;
  251. }
  252. }
  253. var _order = [_n,_n2,_n3];
  254. }
  255. for ( i = 0; i < _order.length; i++){
  256. switch(_order[i]){
  257. case 0:
  258. unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT, 392);
  259. if(!unit) NTCS_SealsError(392);
  260. if(unit[0].roomx*5 + unit[0].x == 7893)
  261. count += NTCS_OpenSealVenomInt(1);
  262. else
  263. count += NTCS_OpenSealVenomInt(2);
  264. break;
  265. case 1:
  266. unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT, 394);
  267. if(!unit) NTCS_SealsError(394);
  268. if(unit[0].roomx*5 + unit[0].x == 7773)
  269. count += NTCS_OpenSealDeSeisInt(1);
  270. else
  271. count += NTCS_OpenSealDeSeisInt(2);
  272. break;
  273. case 2:
  274. unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT, 396);
  275. if(!unit) NTCS_SealsError(396);
  276. if(unit[0].roomy*5 + unit[0].y == 5275)
  277. count += NTCS_OpenSealVizierInt(1);
  278. else
  279. count += NTCS_OpenSealVizierInt(2);
  280. break;
  281. }
  282. }
  283. return count;
  284. }
  285.  
  286. function NTCS_OpenSealInt(classid, x, y){
  287. var retry = 0;
  288. NTM_MoveTo(me.areaid, x, y);
  289. if (!_CSSealsOnly) NTA_ClearPosition(20, true, 2);
  290. var seal = NTC_FindUnit(NTC_UNIT_OBJECT, classid);
  291. if(!seal) NTCS_OpenSealError(classid);
  292. while ((retry++ < 100) && (seal.mode == 0)){
  293. if(GetDistance(me, seal) > 2)
  294. NTM_MoveTo(seal.areaid, seal.x + 4, seal.y);
  295. //NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, seal);
  296. NTC_Delay(50);
  297. if (seal && seal.mode != 0) break;
  298. NTC_Delay(500);
  299. NTM_MoveTo(seal.areaid, seal.x -6, seal.y - 4);
  300. }
  301. return seal.mode > 0 ? 1 : 0;
  302. }
  303.  
  304. function NTCS_OpenSealVizierInt(type){
  305. var pos;
  306. var count = 0;
  307. var monsterName = GetLocaleString(2851);
  308. if (_CSSealsOnly == false){
  309. if (type == 1)
  310. pos = [
  311. 7763, 5275, 7763, 5315, 7747, 5292, 7713, 5275, 7730, 5292, 7713, 5315, 7713, 5292
  312. , 7684, 5292, 7677, 5315, 7650, 5315, 7669, 5292, 7677, 5275, 7650, 5275
  313. ];
  314. else
  315. pos = [
  316. 7763, 5275, 7763, 5315, 7747, 5295, 7713, 5275, 7730, 5295, 7713, 5315
  317. , 7694, 5315, 7675, 5315, 7656, 5315
  318. ];
  319. while (pos.length > 0){
  320. NTM_MoveTo(me.areaid, pos.shift(), pos.shift());
  321. NTA_ClearPosition(20, true, 2);
  322. }
  323. }
  324. else{
  325. NTM_MoveTo(7747, 5293);
  326. NTM_MoveTo(7713, 5293);
  327. NTM_MoveTo(7669, 5315);
  328. //NTM_MoveToPresetUnit(me.areaid, NTC_UNIT_OBJECT, 396);
  329. }
  330. if (type == 1){
  331. if(NTConfig_IdInField){
  332. NT_FieldID();
  333. }
  334. count += NTCS_OpenSealInt(396, 7659, 5277);
  335. NTM_MoveTo(me.areaid, 7669, 5292);
  336. NTCS_KillSealBoss(monsterName);
  337. NTSI_PickItems();
  338. NTM_MoveTo(me.areaid, 7684, 5292);
  339. NTM_MoveTo(me.areaid, 7654, 5310);
  340. NTM_MoveTo(me.areaid, 7654, 5310);
  341. count += NTCS_OpenSealInt(395, 7654, 5310);
  342. NTA_ClearPosition(20, true, 2);
  343. NTM_MoveTo(7684, 5293);
  344. }
  345. else{
  346. if(NTConfig_IdInField){
  347. NT_FieldID();
  348. }
  349. count += NTCS_OpenSealInt(396, 7651, 5310);
  350. NTM_MoveTo(me.areaid, 7675, 5315);
  351. NTCS_KillSealBoss(monsterName);
  352. NTSI_PickItems();
  353. NTM_MoveTo(me.areaid, 7656, 5295);
  354. NTM_MoveTo(me.areaid, 7656, 5269);
  355. NTM_MoveTo(me.areaid, 7656, 5295);
  356. count += NTCS_OpenSealInt(395, 7650, 5276);
  357. NTA_ClearPosition(20, true, 2);
  358. NTM_MoveTo(7675, 5315);
  359. }
  360. NTM_MoveTo(7730, 5293);
  361. return count;
  362. }
  363.  
  364. function NTCS_OpenSealDeSeisInt(type){
  365. var pos;
  366. var count = 0;
  367. var monsterName = GetLocaleString(2852);
  368. if (_CSSealsOnly == false){
  369. if (type == 1)
  370. pos = [
  371. 7813, 5259, 7813, 5229, 7792, 5244, 7771, 5229
  372. , 7771, 5215, 7771, 5193, 7792, 5193, 7813, 5193
  373. , 7813, 5174, 7813, 5155, 7792, 5155, 7771, 5155
  374. , 7767, 5162
  375. ];
  376. else
  377. pos = [
  378. 7813, 5259, 7792, 5244, 7771, 5229, 7771, 5244, 7813, 5229
  379. , 7813, 5215, 7813, 5193, 7792, 5193, 7771, 5193
  380. , 7771, 5174, 7771, 5155, 7792, 5155, 7813, 5155
  381. ];
  382. while (pos.length > 0){
  383. NTM_MoveTo(me.areaid, pos.shift(), pos.shift());
  384. NTA_ClearPosition(20, true, 2);
  385. }
  386. }
  387. else{
  388. NTM_MoveTo(7792, 5229);
  389. NTM_MoveTo(7792, 5193);
  390. //NTM_MoveToPresetUnit(me.areaid, NTC_UNIT_OBJECT, 394);
  391. }
  392. if (type == 1){
  393. if(NTConfig_IdInField){
  394. NT_FieldID();
  395. }
  396. count += NTCS_OpenSealInt(394, 7769, 5158);
  397. NTM_MoveTo(me.areaid, 7768, 5162);
  398. NTM_MoveTo(me.areaid, 7771, 5188);
  399. NTM_MoveTo(me.areaid, 7780, 5215);
  400. NTCS_KillSealBoss(monsterName);
  401. NTSI_PickItems();
  402. }
  403. else{
  404. if(NTConfig_IdInField){
  405. NT_FieldID();
  406. }
  407. count += NTCS_OpenSealInt(394, 7810, 5156);
  408. NTM_MoveTo(me.areaid, 7771, 5155);
  409. NTM_MoveTo(me.areaid, 7780, 5174);
  410. NTCS_KillSealBoss(monsterName);
  411. NTSI_PickItems();
  412. }
  413. if (_CSSealsOnly == false){
  414. if (type == 1)
  415. pos = [7771, 5229, 7792, 5244, 7771, 5259];
  416. else
  417. pos = [7813, 5229, 7792, 5244, 7771, 5259];
  418. while (pos.length > 0){
  419. NTM_MoveTo(me.areaid, pos.shift(), pos.shift());
  420. NTA_ClearPosition(20, true, 2);
  421. }
  422. }
  423. else{
  424. NTM_MoveTo(7792, 5229);
  425. NTM_MoveTo(7771, 5259);
  426. }
  427. return count;
  428. }
  429.  
  430. function NTCS_OpenSealVenomInt(type){
  431. var pos;
  432. var count = 0;
  433. var monsterName = GetLocaleString(2853);
  434. if (_CSSealsOnly == false){
  435. if (type == 1)
  436. pos = [
  437. 7825, 5315, 7841, 5294, 7858, 5275, 7858, 5315, 7841, 5294, 7858, 5294
  438. , 7882, 5294, 7893, 5315, 7903, 5294, 7933, 5294, 7915, 5270, 7903, 5294
  439. , 7893, 5318
  440. ];
  441. else
  442. pos = [
  443. 7825, 5315, 7841, 5294, 7858, 5294, 7874, 5315, 7874, 5275
  444. , 7885, 5275, 7905, 5275, 7933, 5275, 7933, 5294, 7993, 5315
  445. , 7909, 5315
  446. ];
  447. while (pos.length > 0){
  448. NTM_MoveTo(me.areaid, pos.shift(), pos.shift());
  449. NTA_ClearPosition(20, true, 2);
  450. }
  451. }
  452. //else
  453. //NTM_MoveToPresetUnit(me.areaid, NTC_UNIT_OBJECT, 392);
  454. if (type == 1){
  455. if(NTConfig_IdInField){
  456. NT_FieldID();
  457. }
  458. count += NTCS_OpenSealInt(392, 7895, 5318);
  459. NTM_MoveTo(me.areaid, 7900, 5294);
  460. NTCS_KillSealBoss(monsterName);
  461. NTSI_PickItems();
  462. NTM_MoveTo(me.areaid, 7903, 5294);
  463. count += NTCS_OpenSealInt(393, 7915, 5280);
  464. }
  465. else{
  466. if(NTConfig_IdInField){
  467. NT_FieldID();
  468. }
  469. count += NTCS_OpenSealInt(392, 7916, 5310);
  470. NTM_MoveTo(me.areaid, 7933, 5294);
  471. NTCS_KillSealBoss(monsterName);
  472. NTSI_PickItems();
  473. NTM_MoveTo(me.areaid, 7933, 5294);
  474. count += NTCS_OpenSealInt(393, 7905, 5277);
  475. }
  476. if (_CSSealsOnly == false){
  477. if (type == 1)
  478. pos = [7858, 5294, 7841, 5294, 7825, 5275];
  479. else
  480. pos = [7874, 5275, 7858, 5294, 7825, 5275];
  481. while (pos.length > 0){
  482. NTM_MoveTo(me.areaid, pos.shift(), pos.shift());
  483. NTA_ClearPosition(20, true, 2);
  484. }
  485. }
  486. else
  487. NTM_MoveTo(7825, 5275);
  488. return count;
  489. }
  490.  
  491. function NT_KillMonster(classid, retry){
  492. if(arguments.length < 2)
  493. retry = 0;
  494. var _target;
  495. if(NTConfig_AttackSkill[1] < 1)
  496. return false;
  497. _target = NTC_FindUnit(NTC_UNIT_MONSTER, classid, retry);
  498. if(!_target)
  499. return false;
  500. if(_target.IsAttackable()){
  501. var _attackcount = 0;
  502. while(_attackcount < 300 && NTA_IsValidMonster(_target)){
  503. if(NTA_Attack(_target, (_attackcount%30) == 0) < 2)
  504. break;
  505. _attackcount++;
  506. }
  507. }
  508. return (_target.hp <= 0 || _target.mode == 0 || _target.mode == 12);
  509. }
  510.  
  511. function HostileHandler(msg){
  512. if(msg == "pause"){
  513. if(_hostilepause){
  514. Print("yc3Resuming...");
  515. _hostilepause = false;
  516. }
  517. else {
  518. Print("yc1Pausing to kill hostiles...");
  519. _hostilepause = true;
  520.  
  521. ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
  522. ClickMap(NTC_CLICK_RUP, NTC_SHIFT_NONE, null);
  523.  
  524. while(_hostilepause)
  525. NTC_Delay(250);
  526. }
  527. }
  528. }
  529.  
  530. function NT_DiabloLeechMessageHandler(){
  531. var _msg = NT_File("logs/messagecomands/"+me.charname+"-diablo.txt", 0);
  532. if (_msg && _msg != Diablo_PreMessage){
  533. Diablo_PreMessage = _msg;
  534. if(_msg.substring(_msg.indexOf("/") + 1) == "takedtp"){
  535. //Print(COLOR_2 + "retrieved take tp message diablo");
  536. return true;
  537. }
  538. }
  539. return false;
  540. }
  541.  
  542. function chat(msg, type)
  543. {
  544. if(type == 0) {
  545. var _split = msg.split(":");
  546. if(_split.length >= 1 && _split[1] != undefined) {
  547. var _sender = _split[0].substring(3, _split[0].length - 3);
  548. var _msg = _split[1].substring(1);
  549. if(_sender == NTConfig_Leader) {
  550. switch(_msg) {
  551. case NTConfig_LeechTPText:
  552. NTC_Delay(100);
  553. if(me.areaid == 103){
  554. CL_TakePortal();
  555. NTP_DoPrecast(true);
  556. }
  557. break;
  558. case NTConfig_LeechTownText:
  559. NTC_Delay(100);
  560. if(me.areaid == 108)
  561. CL_TakePortal();
  562. break;
  563. case NTConfig_LeechDiabloText:
  564. NTC_Delay(100);
  565. if(me.areaid == 103) {
  566. CL_TakePortal();
  567. Delay(500);
  568. ClickMap(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, 7763, 5268);
  569. ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
  570. //NTP_DoPrecast(true);
  571. }
  572. break;
  573. case NTConfig_LeechDiabloDeadText:
  574. if(!NTM_MoveTo(me.areaid, 7792, 5292)) {
  575. NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
  576. return;
  577. }
  578. NTSI_PickItems();
  579. Delay(Random(2000,4000));
  580. NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
  581. break;
  582. }
  583. }
  584. }
  585. }
  586. else if(type == 4 && (msg.indexOf("weaken") != -1) && (msg.indexOf(NTConfig_Leader) != -1)) {
  587. NTC_Delay(750);
  588. ExitGame();
  589. }
  590. }
  591.  
  592. function CL_TakePortal()
  593. {
  594. var _prearea = me.areaid;
  595. var _portal = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3226), 10);
  596. if(!_portal)
  597. return false;
  598.  
  599. do {
  600. if(GetDistance(me, _portal) < 15) {
  601. for(var i = 0 ; i < 20 ; i++) {
  602. if((i % 5) == 0) {
  603. if(i == 10)
  604. NTM_MoveTo(_prearea, me.x+6, me.y+6);
  605. NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _portal);
  606. }
  607. NTC_Delay(200);
  608. if(me.areaid != _prearea)
  609. break;
  610. }
  611. while(me.areaid == 0)
  612. NTC_Delay(200);
  613. if(me.areaid == _prearea)
  614. return false;
  615. NTC_PingDelay(NTConfig_AreaDelay);
  616. return true;
  617. }
  618. } while(_portal.GetNext());
  619. return false;
  620. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement