Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[D2NT Release]Item Logging with XML 3.0+
#1
Credits to bigapple90, Jinnay, doomknight, bajazzle, and agor. probably more too
[Image: itemlogcopy.jpg]

[Image: gambled.jpg]
[Image: crafted.jpg]
[Image: xmloutput.jpg]

**If you have no edits to your current files you can just replace them using the links below: You must do steps 9-13 if you want xml logging, otherwise do step 13**
NTCommon
NTTownManager
NTSnagIt
NTTown
NTCubing

Or do it yourself
Step [1][A]: Open NTCommon. Find this line:
Quote:var NTC_ItemQualityToD2Color = new Array(9);
Change it to:
Code:
var NTC_ItemQualityToD2Color = new Array(11);
[B.]: Now copy this code:

Code:
NTC_ItemQualityToD2Color[9] = "ÿc;"; //purple
NTC_ItemQualityToD2Color[10] = "ÿc1";//red
[C]: And paste it under this line:
Quote:NTC_ItemQualityToD2Color[8] = "ÿc8";
Step [2]: Add the red:
Quote:function NTC_IncludeLibs()
{
Include("libs/common/NTAttack.ntl");
Include("libs/common/NTCubing.ntl");
Include("libs/common/NTItemParser.ntl");
Include("libs/common/NTMove.ntl");
Include("libs/common/NTPrecast.ntl");
Include("libs/common/NTSnagIt.ntl");
Include("libs/common/NTTown.ntl");
Include("libs/common/NTTownManager.ntl");
Include("libs/common/NTTownMove.ntl");
Include("libs/common/NTItemlogger.ntl");
}
Step[3]: Copy this code and paste it at the end of NTCommon:

Code:
//--From Jinnay--
function NTC_LogLocation(script)
{
  
   var _hfile = FileOpen("logs/loc/" + me.charname + "_LocInfo.txt", 1);

   if(!_hfile)
      return false;
    
   _hfile.WriteLine(script);
   _hfile.Close();

}

function NTC_GetLocation(index)
{
   var _script;

   if(arguments.length < 1)
      index = false;

   var _hfile = FileOpen("logs/loc/" + me.charname + "_LocInfo.txt", 0);
   _script = _hfile.ReadLine();
   _hfile.Close();
    
   return _script;
}
Save and close NTCommon.

Step[4]: Open NTTownmanager; at the top add red
Quote:var _NTTMGR_BuyPots;
var _NTTMGR_BuyTP;
var _NTTMGR_BuyKey;
var _NTTMGR_DoHeal;
var _NTTMGR_DoID;
var _NTTMGR_DoRepair;
var _NTTMGR_DoRevive;
var _NTTMGR_RemoveCurse;
var _NTTMGR_Simple;

function NTTMGR_TownManager(simple)
{
var _cubing;

if(arguments.length < 1)
simple = false;

NTC_ClearCursor();
NTT_CleanPotions();

_NTTMGR_BuyPots = NTT_CheckBelt();
_NTTMGR_BuyTP = (NTTMGR_CheckScrolls(1) < 4);
_NTTMGR_BuyKey = (NTConfig_OpenChest && NTTMGR_CheckKeys() < 4);
_NTTMGR_DoHeal = NTT_CheckHeal();
_NTTMGR_DoID = NTT_CheckUnids();
_NTTMGR_DoRepair = NTT_CheckRepair(40);
_NTTMGR_DoRevive = NTT_CheckMerc();
_NTTMGR_RemoveCurse = NTTMGR_CheckCurse(NTConfig_CheckSelfSafe > 0x01 ? 0x7E : 0, NTConfig_CheckMercSafe > 0x01 ? 0x7E : 0);
_NTTMGR_Simple = simple;

NTCU_InitCubing();
...
...
etc
Step [5]: Find this function:

Quote:function NTTMGR_IDItems(npc)
{

...
...
etc

}
replace it with this one: function NTTMGR_IDItems(npc)
Save and close NTTownManager.

Step [6][A]: Open NTSnagIt. Find and add the red:

Quote: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));

Include("libs/common/NTItemlogger.ntl");
NTSI_SnagIt();
}
[B.] Replace your:

Quote:function NTSI_SnagIt()
{

var i;
...
...
etc

}
with this one: function SnagIt()

[C] Find and add the red:
Quote: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)
{
Print("Picked up " + NTC_ItemQualityToD2Color[6] + GetLocaleString(2215));

return false;
}
else if(snagitem.mode != 3 && snagitem.mode != 5)
{
var _parent;

NTC_PingDelay(100);

_parent = snagitem.GetParent();

return (_parent && _parent.gid == me.gid);
}
}

return false;
}
Save and Close NTSnagIt

Step [7]: Open NTTown. Replace your
Quote:function NTT_GambleIt(npc)
{

...
...
etc

}

with this one: function NTT_GambleIt(npc)

Save and Close NTTown

Step [8][a]: Open NTCubing, find this line
Quote:NTC_SendLogToOOG(NTC_LOG_COMMON, _NTCU_LogString);
Paste this code right under it:
Code:
var crafted_itm = NTCU_GetCubeContents();

          if(crafted_itm.length == 1)

      if(crafted_itm[0].quality == 8 ||  crafted_itm[0].itemflag&0x400000 || crafted_itm[0].quality == 7  && crafted_itm[0].class == 2)  
      {
         if(NTSI_CheckItem(crafted_itm[0]) != 0)

                             NTC_SendLogToOOG(NTC_LOG_ITEM,"ÿc2Kept: " +  NTC_ItemQualityToMGRColor[crafted_itm[0].quality] +  crafted_itm[0].name.split("\n")[0]+ ";" + crafted_itm[0].itemdesc + "\n  ÿc2iLvl: " + crafted_itm[0].itemlevel + "\n ÿc2Cubed");

                          else
            NTC_SendLogToOOG(NTC_LOG_ITEM,"ÿc1Sold: " +  NTC_ItemQualityToMGRColor[crafted_itm[0].quality] +  crafted_itm[0].name.split("\n")[0]+ ";" + crafted_itm[0].itemdesc + "\n  ÿc2iLvl: " + crafted_itm[0].itemlevel + "\n ÿc2Cubed");
            //^ doesnt actually sell the items ^
      }

[B.] Copy this code and paste it at the end of NTCubing:
Code:
function NTCU_GetCubeContents()
{
    var _items = me.GetItems();
   var _cube_items = new Array();

    for(i = 0 ; i < _items.length ; i++)
      if(_items[i].mode == 0 && _items[i].itemloc == 3)
         _cube_items.push(_items[i]);

        return _cube_items;    
}
Step [9]: Download this xmlstuff, you need it for XML logging


Step [10][A]: Open the txt file itemtoname.txt from xmlstuff

[B.] Copy everything in there (Ctrl + A then Ctrl + C) and close it.

[C] Now open your NTItemAlias and at the end paste the code that you just copied

Save and close NTItemAlias

Step [11]: Copy the logs folder from xmlstuff to your D2NT\scripts folder

Step [12]: Copy NTItemlogger.ntl from xmlstuff and paste it into your D2NT\scripts\libs\common folder

Step [13][A]: For each char you use, open their NTConfigs and add:
Quote:NTConfig_UseXMLItemlog = true; // Log kept and sold items as well in a XML log file
NTConfig_LogSoldItems = true; // Adds sold items to the manager's itemlog
NTConfig_LogSoldQuality = 7; // item quality to log for sold (7 = unique, this is only for d2nt manager, xml logs magic,rare,etc)
[B.] Also in the logs/loc folder make a txt file for each char to prevent first use errors. name it like so: (charNamehere)_LocInfo.txt

That should do it. Credits to their respective owners.
[SIGPIC]http://yfrog.com/mhskidudecopyg[/SIGPIC]
Reply


Messages In This Thread
[D2NT Release]Item Logging with XML 3.0+ - by skidude - 06-25-2010, 11:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [D2NT Release] Druid Script skidude 20 17,266 08-25-2012, 01:20 AM
Last Post: comper
  D2NT BoT Gh0sT17 52 2,056 07-31-2012, 11:10 PM
Last Post: comper
  D2nt need help on some stuff wishyq 3 171 07-22-2012, 12:44 PM
Last Post: comper
  Little Help Please? (D2NT) pnsmcgraw 12 271 07-16-2012, 02:46 PM
Last Post: Mythosis
  MasivB's D2NT Simple Unique PickIt masivb 1 118 07-03-2012, 05:03 AM
Last Post: comper
  D2nt - how do i stay in game when sojs sell? brianwalter86 5 354 07-01-2012, 02:02 PM
Last Post: comper
  Nooby D2NT Questions Kieran Wilson 0 129 06-25-2012, 04:35 PM
Last Post: Kieran Wilson
  D2nt Bot jewel pickit/godly item pickit Nightwish 3 232 06-23-2012, 04:18 AM
Last Post: comper
  someone please help my d2nt bot wont kill any bosses mcmullenp4 2 178 06-19-2012, 10:18 AM
Last Post: comper
  [D2NT Release] Amazon Jav/Bow Script v1.6 skidude 25 13,079 06-19-2012, 07:05 AM
Last Post: comper

Forum Jump:


Users browsing this thread: 1 Guest(s)