dzik

Diablo 2 - ETAL - NTPermAndDrop.ntj

May 23rd, 2014
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Include('libs/common/NTCommon.ntl');
  2. NTC_IncludeLibs();
  3. var _skipPerming = false;
  4. var _endTime = null;
  5.  
  6. function NTMain() {
  7.     _endTime = GetTickCount() + 1000 * 60 * 5 + 1000 * 15; // 5:15 until we start
  8.     Delay(5000);
  9.     Include('NTBot/char_configs/NTConfig.ntl');
  10.     NTC_IncludeConfig("NTBot/char_configs");
  11.     NT_LoadConfig();
  12.     NTSI_LoadNIPFiles("NTBot/item_configs");
  13.     NT_File("AMS/MuleStatus/" + me.account + "_mulegame.txt", 1, me.gamename);
  14.    
  15.     Say("/f m Got myself into a perm and drop game!");
  16.    
  17.     // clear invo of unwanted items
  18.     NTConfig_IdentAtCain = false;
  19.     // NTConfig_Cubing = false;
  20.     NTConfig_Gamble = false;
  21.     NTTMGR_TownManager();
  22.     // end of acien's add
  23.    
  24.     while (!_skipPerming && GetTickCount() < _endTime) {
  25.         SetStatusText('Perming Game ' + parseInt((_endTime - GetTickCount())/1000)
  26.                 + ' seconds');
  27.         Delay(1000);
  28.     }
  29.     if(!_skipPerming) { SetStatusText (' Game Permed'); }
  30.     else if(_skipPerming) { SetStatusText('Game perming skipped'); }
  31.    
  32.     NTTM_CheckAct(1);
  33.     NTTM_TownMove('stash');
  34.     NTT_DoInteract(NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH, 40));
  35.     var _items = me.GetItems();
  36.    
  37.     var _script = NTC_FindScript("OrganFarmerPTandMule.ntj");
  38.     if(_script && _script.running && TorchMuling)
  39.     {
  40.         //Print(COLOR_1 + "Correct entry point");
  41.         var hellFireTorch2 = me.GetItems("cm2");
  42.             if(hellFireTorch2 && hellFireTorch2.length > 0)
  43.             {
  44.                 for(var i = 0 ; i < hellFireTorch2.length ; i++)
  45.                 {
  46.                     if(hellFireTorch2[i].quality == 7)
  47.                     {
  48.                         Print("dropping torch");
  49.                         NTT_DropItem(hellFireTorch2[i]);
  50.                        
  51.                     }
  52.                 }
  53.             }
  54.         me.Cancel(1);
  55.     }  
  56.     else
  57.     {
  58.         for(var i = 0 ; i < _items.length ; i++)
  59.         {
  60.             // 549 = Cube, 543 = Keys
  61.             if(_items[i].mode == 0 && NTSI_CheckItem(_items[i], false)[0] in [1, -1] &&
  62.             !NTSI_IsIgnoredItemInt(_items[i].classid) && _items[i].classid != 549 && _items[i].classid != 543 &&
  63.             !NTRW_CheckItem(_items[i], false) && !NTCU_CheckItem(_items[i]) && !cubeGem(_items[i].classid))
  64.             {
  65.                 if (_items[i].itemloc == 0 && NTConfig_Columns[_items[i].y][_items[i].x] != 0)
  66.                 {
  67.                     NTT_DropItem(_items[i]);
  68.                 }
  69.                 else if (_items[i].itemloc == 4)
  70.                     NTT_DropItem(_items[i]);
  71.             }
  72.         }
  73.         me.Cancel(1);
  74.         Organize();
  75.     }
  76.     stashShit();
  77.     NT_File("AMS/MuleStatus/" + me.account + "_charstatus.txt", 1, "Mule");
  78.     NTC_Delay(500);
  79.     NT_File("AMS/MuleStatus/" + me.account + "_mulingstatus.txt", 1, "true");
  80.     NTC_Delay(750);
  81.     ExitGame();
  82. }
  83.  
  84. function cubeGem(classid)
  85. {
  86.     gemId = [557, 558, 559, 560, 562, 563, 564, 565, 567, 568, 569, 570, 572, 573, 574, 575, 577, 578, 579, 580,
  87.         582, 583, 584, 585];
  88.         for(var i = 0; i < gemId.length; i++) {
  89.             if(classid === gemId[i]) {
  90.                 return true;
  91.             }
  92.         }
  93.     return false;
  94. }
  95.  
  96. function Organize()
  97. {
  98.     var _item;
  99.     var keepIds = new Array();
  100.     var _items = me.GetItems();
  101.    
  102.     if(!_items)
  103.         return false;  
  104.        
  105.     NTU_MoveToStash();
  106.    
  107.     for(var i = 0 ; i < _items.length ; i++) {     
  108.         if(_items[i].itemloc == 0  && !NTSI_IsIgnoredItemInt(_items[i].classid) && _items[i].classid != 543 && NTConfig_Columns[_items[i].y][_items[i].x] > 0 || _items[i].itemloc == 4 && _items[i].classid != 549 && _items[i].mode != 1) {
  109.             keepIds.push(_items[i].classid);
  110.             NTT_DropItem(_items[i]);       
  111.         }
  112.     }
  113.     me.Cancel(1);
  114.     NTC_Delay(1500);
  115.    
  116.     if(keepIds.length > 0) {
  117.         for(var j = 0; j < keepIds.length; j++) {
  118.             _item = NTC_FindUnit(NTC_UNIT_ITEM, keepIds[j]);
  119.             if(_item) {
  120.                 NTSI_PickUpItemInt(_item);
  121.             }
  122.         }
  123.     }
  124. }
  125.  
  126. function stashShit()
  127. {
  128.     var _stash;
  129.    
  130.     NTTM_TownMove("stash");
  131.  
  132.     _stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH, 5);
  133.    
  134.     if(NTT_DoInteract(_stash)) {
  135.         NTT_ManageStash();
  136.     }
  137.     me.Cancel(1);
  138. }
Advertisement
Add Comment
Please, Sign In to add comment