Blizzhackers

Return of the Jedi

* Login   * Register    * FAQ    * Search

Join us on IRC: #bh@irc.synirc.net (or Mibbit Web IRC)


MuleFactory


It is currently Tue May 21, 2013 12:09 pm


All times are UTC [ DST ]





Post new topic Reply to topic  [ 139 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next
Author Message
 Post subject: My D2NT contribution: Pickit location logging - Updated 3
PostPosted: Sat Apr 10, 2010 1:45 am 
 
User
User

Joined: Sat Jan 22, 2005 8:11 pm
wish you knew which boss dropped that sweet ber rune? Here is the fix so that it will look like this in your D2NT Manager:

It will display everything it picks up other than potions/gold/gems/magical/rare, and give you location and item level.

Copy and paste this whole code into your libs/common/NTSnagIt.ntl
(delete everything inside it first)

NTSnagIt.ntl:
http://pastebin.com/CTfzGdz9


And TownManger:

NTTownManager.ntl:

http://pastebin.com/BvgJRZhY

Result:

Image


Last edited by doomknight on Wed Apr 14, 2010 8:37 pm, edited 24 times in total.
Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 1:47 am 
 
User
User

Joined: Sat Jan 22, 2005 8:11 pm
btw haven't tested yet. I don't know which language d2nt is written in so it might have bugs. Waiting for my bot to keep something so I can confirm

Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 1:48 am 
 
User
User

Joined: Sat Feb 13, 2010 7:13 pm
Testing now :) Hope it works, goodjob if it does :)

_________________
D2NT 3.0 Most frequently asked questions
D2NT 3.0 Evrams Early-ish Ladder Pickit
D2NT 3.0 Evrams script for FastDiablo

Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 1:49 am 
 
User
User

Joined: Sat Jan 22, 2005 8:11 pm
Evram wrote:
Testing now :) Hope it works, goodjob if it does :)



make sure you include that last } in there

for some reason the [code] didn't include i'll try to fix my post

Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 1:54 am 
 
User
User

Joined: Sat Jan 22, 2005 8:11 pm
didn't work, im trying to fix. not sure which file has the function GetArea()

Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 1:55 am 
 
User
User

Joined: Tue Apr 06, 2010 4:19 pm
doomknight wrote:
btw haven't tested yet. I don't know which language d2nt is written in so it might have bugs. Waiting for my bot to keep something so I can confirm

add in pickit some random unid item to keep, will be faster :P

Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 1:56 am 
 
User
User

Joined: Sat Jan 22, 2005 8:11 pm
Ok I got it right now.

Please use this one:

var _NTSI_IgnoredList = new Array(
526, // Arrows quiver
528, // Bolts quiver
543, // Keys
518, // Tome of Town Portal
519, // Tome of Identify
529, // Scroll of Town Portal
530, // Scroll of Identify
514, // Antidote potion
513, // Stamina potion
517, // Thawing potion
80, // Rancid Gas Pot
81, // Oil Potion
82, // Choking Gas Pot
83, // Exploding Pot
84, // Strangling Gas
85); // Fulminating Pot

var _NTSI_BeltSize;

function NTSI_LoadNIPFiles(filepath)
{
   for(var i = 0 ; i < NTConfig_NIPFilePath.length ; i++)
      NTIPOpenFile(filepath + "/" + NTConfig_NIPFilePath[i]);

   _NTSI_BeltSize = NTC_GetBeltSize();
}

function NTSI_PickItems()
{
   var i, _mode;

   for(i = 0 ; i < 25 ; i++)
   {
      _mode = me.mode;

      if((_mode >= 1 && _mode <= 3) || _mode == 5 || _mode == 6)
         break;

      NTC_Delay(NTC_DELAY_FRAME);
   }

   if(i < parseInt(NTConfig_SnagDelay/NTC_DELAY_FRAME))
      NTC_PingDelay(NTConfig_SnagDelay-(i*NTC_DELAY_FRAME));

   NTSI_SnagIt();
}

function NTSI_SnagIt()
{
   var i;
   var _item;
   var _checkeditem, _checkeditems;
   var _value;
   var _minindex, _mindistance;
   Include("libs/common/NTCommon.ntl");
   Include("libs/common/NTCubing.ntl");
   var _area;
   _area = GetArea();

   _item = NTC_FindUnit(NTC_UNIT_ITEM);

   if(!_item)
      return;

   _checkeditems = new Array();

   do
   {
      if(_item.mode == 3 || _item.mode == 5)
      {
         if(NTSI_IsIgnoredItemInt(_item.classid))
            continue;

         if(GetDistance(me, _item) <= NTConfig_SnagRange)
         {
            _value = NTSI_CheckItem(_item);

            if(_value)
               _checkeditems.push(new NTSI_ItemInt(_item, _value));
         }
      }
   } while(_item.GetNext());

   while(_checkeditems.length > 0)
   {
      _mindistance = 100000;

      for(i = 0 ; i < _checkeditems.length ; i++)
      {
         _value = GetDistance(me.x, me.y, _checkeditems[i].x, _checkeditems[i].y);

         if(_value < _mindistance)
         {
            _minindex = i;
            _mindistance = _value;
         }
      }

      _checkeditem = _checkeditems.splice(_minindex, 1)[0];

      _item = NTC_FindUnit(NTC_UNIT_ITEM, _checkeditem.GID);

      if(_item)
      {
         if(!NTSI_IsLimitedItemInt(_item))
         {
            if(NTT_CheckSpace(_item.xsize, _item.ysize))
            {
               if(NTSI_PickUpItemInt(_item))
               {
                  if(_checkeditem.ClassID == 523)
                     Print("Picked up " + GetLocaleString(2215));
                  else
                     if(_item != undefined && !(_item.itemtype == 76 || _item.itemtype == 77 || _item.itemtype == 78))
                     Print ("Picked up" + NTC_ItemQualityToD2Color [_item.quality] + _item.name.split ("\ n") [0])

                  if(_area != undefined && _item.quality < 4 && _checkeditem.Status < 2 && _item.itemtype != 4 && (_item.itemtype < 76 ||

_item.itemtype > 81))
                     NTC_SendLogToOOG(NTC_LOG_ITEM, "Location (" + _area.name + ")" + "Kept " + NTC_ItemQualityToMGRColor[_item.quality]

+ _item.name.split("\n")[0] + ";" + _item.itemdesc);
               }
            }
            else
            {
               if(!_checkeditem.Retry)
               {
                  _checkeditem.Retry = true;

                  if(!NTTMGR_VisitTown())
                     return;

                  _checkeditems.push(_checkeditem);
               }
            }
         }
      }
   }
}

function NTSI_CheckItem(item)
{
   var _result;

   switch(item.quality)
   {
   case 5:
   case 8:
      _result = NTIPCheckItem(item);
      break;
   default:
      _result = NTIPCheckItem(item);

      if(NTCU_CheckItem(item, _result))
         _result = 2;

      break;
   }

   return _result;
}

// Internal function
function NTSI_ItemInt(item, checkedstatus)
{
   this.ClassID = item.classid;
   this.GID = item.gid;
   this.x = item.x;
   this.y = item.y;
   this.Status = checkedstatus;
   this.Retry = false;
}

function NTSI_PickUpItemInt(snagitem)
{
   var i;
   var _classid;

   _classid = snagitem.classid;

   for(i = 0 ; i < 40 ; i++)
   {
      if((i % 10) == 0 && (snagitem.mode == 3 || snagitem.mode == 5))
      {
         if(GetDistance(me, snagitem) > 3)
            NTM_MoveTo(snagitem.areaid, snagitem.x, snagitem.y);

         if(NTC_ClearCursor())
            NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, snagitem);
      }

      NTC_Delay(NTC_DELAY_FRAME);

      if(_classid == 523 || (snagitem.mode != 3 && snagitem.mode != 5))
      {
         NTC_PingDelay(100);
         return true;
      }
   }

   return false;
}

function NTSI_IsIgnoredItemInt(classid)
{
   for(var i = 0 ; i < _NTSI_IgnoredList.length ; i++)
   {
      if(classid == _NTSI_IgnoredList[i])
         return true;
   }

   return false;
}

function NTSI_IsLimitedItemInt(item)
{
   var i;
   var _items;

   if(item.itemtype >= 76 && item.itemtype <= 78)
   {
      var _code, _type;
      var _potnum = 0;

      _code = item.code;
      _type = item.itemtype;

      for(i = 0 ; i < 4 ; i++)
      {
         if(_code.indexOf(NTConfig_BeltColType[i]) != -1)
            _potnum += _NTSI_BeltSize;
      }

      _items = me.GetItems();

      if(_items)
      {
         for(i = 0 ; i < _items.length ; i++)
         {
            if(_items[i].mode == 2 && _items[i].itemtype == _type)
               _potnum--;
         }

         if(_potnum < 1)
            return true;
      }
   }
   else if(item.quality == 7 && item.classid >= 603 && item.classid <= 605)
   {
      _items = me.GetItems(item.classid);

      if(_items)
      {
         for(i = 0 ; i < _items.length ; i++)
         {
            if(_items[i].quality == 7)
               return true;
         }
      }
   }

   return false;
}

}

Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 1:56 am 
 
User
User

Joined: Sat Feb 13, 2010 7:13 pm
Image

No luck

_________________
D2NT 3.0 Most frequently asked questions
D2NT 3.0 Evrams Early-ish Ladder Pickit
D2NT 3.0 Evrams script for FastDiablo

Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 1:57 am 
 
User
User

Joined: Sat Jan 22, 2005 8:11 pm
Evram wrote:
Image

No luck


try again it should work

Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 1:59 am 
 
User
User
User avatar

Joined: Sat Mar 07, 2009 5:46 pm
Sry mate it's the wrong script. You need the location when you next visit a vendor. So it's actually in NTTownManager.ntl. I might check this out later (if you don't got it until then).


Last edited by Jinnay on Sat Apr 10, 2010 2:02 am, edited 1 time in total.
Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 2:01 am 
 
User
User

Joined: Sat Jan 22, 2005 8:11 pm
the places I changed are:

function NTSI_SnagIt()
{
   var i;
   var _item;
   var _checkeditem, _checkeditems;
   var _value;
   var _minindex, _mindistance;
   Include("libs/common/NTCommon.ntl");
   Include("libs/common/NTCubing.ntl");
   var _area;
   _area = GetArea();


and then obviously the send to log part I added
if(_area != undefined && _item.quality < 4 && _checkeditem.Status < 2 && _item.itemtype != 4 && (_item.itemtype < 76 ||

_item.itemtype > 81))
                     NTC_SendLogToOOG(NTC_LOG_ITEM, "Location (" + _area.name + ")" + "Kept " + NTC_ItemQualityToMGRColor[_item.quality]

+ _item.name.split("\n")[0] + ";" + _item.itemdesc);


but right now I think it will say (Lut Gholein) Kept item,
instead of (Duriel) Kept item,

because the area.name function is being called when it decides whether to keep, not where the item dropped. I'll work on it some more but it's a start at least to tell you which act dropped it


Last edited by doomknight on Sat Apr 10, 2010 2:04 am, edited 1 time in total.
Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 2:02 am 
 
User
User

Joined: Sat Jan 22, 2005 8:11 pm
if anyone knows which file contains the GetArea(); function please let me know so I can look into that file

Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 2:04 am 
 
User
User
User avatar

Joined: Sat Mar 07, 2009 5:46 pm
doomknight wrote:
if anyone knows which file contains the GetArea(); function please let me know so I can look into that file


I checked filesearch in the whole ntbot dir but there's no declaration. internall function i guess.

Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 2:05 am 
 
User
User

Joined: Sat Feb 13, 2010 7:13 pm
doomknight wrote:
the places I changed are:

function NTSI_SnagIt()
{
   var i;
   var _item;
   var _checkeditem, _checkeditems;
   var _value;
   var _minindex, _mindistance;
   Include("libs/common/NTCommon.ntl");
   Include("libs/common/NTCubing.ntl");
   var _area;
   _area = GetArea();


and then obviously the send to log part I added
if(_area != undefined && _item.quality < 4 && _checkeditem.Status < 2 && _item.itemtype != 4 && (_item.itemtype < 76 ||

_item.itemtype > 81))
                     NTC_SendLogToOOG(NTC_LOG_ITEM, "Location (" + _area.name + ")" + "Kept " + NTC_ItemQualityToMGRColor[_item.quality]

+ _item.name.split("\n")[0] + ";" + _item.itemdesc);


but right now I think it will say (Lut Gholein) Kept item,
instead of (Duriel) Kept item,

because the area.name function is being called when it decides whether to keep, not where the item dropped. I'll work on it some more but it's a start at least to tell you which act dropped it


For people just doing bosses that is enough for them to know which boss it came from I guess.

_________________
D2NT 3.0 Most frequently asked questions
D2NT 3.0 Evrams Early-ish Ladder Pickit
D2NT 3.0 Evrams script for FastDiablo

Top
 Profile  
 Post subject:
PostPosted: Sat Apr 10, 2010 2:06 am 
 
User
User

Joined: Sat Jan 22, 2005 8:11 pm
edit: see original post


Last edited by doomknight on Sat Apr 10, 2010 2:33 am, edited 1 time in total.
Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 139 posts ]  Go to page 1, 2, 3, 4, 5 ... 10  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron