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
#2
Hello, i've done everything you have said here and i continue to get the error

Quote:<D2NT Error> C:\users\me\desktop\d2nt\scripts\libs\common\NTItemlogger.ntl (65) : TypeError:_hfile is null

Please help.
Reply
#3
Try replacing your NTItemlogger with this [URL="http://pastebin.com/raw.php?i=6A9ixcY1"]RAW OUTPUT 6A9ixcY1
[/URL]
If u don't want the xml logging u don't have to use it. I don't use it on my bot
[SIGPIC]http://yfrog.com/mhskidudecopyg[/SIGPIC]
Reply
#4
awesome, that seems to have worked, i had the same error as elimaxwell
Reply
#5
Glad to hear that fixed the error.
[SIGPIC]http://yfrog.com/mhskidudecopyg[/SIGPIC]
Reply
#6
[COLOR="red"]<D2NT Error> E:\Program Files\Diablo II\MD\D2NT\scripts\libs\common\NTSnagIt.ntl (159) :referenceError: NTI_WriteLog is not defined.
[/COLOR]

had this error in snagit, town manager, and i cant figure out how to define it, help would be appreciated Smile
Reply
#7
well I'm not sure why, but after i completed this xml logging update, my bot will just sit there staring at whatever item it's just cubed/crafted.
Right now I have crafting disabled, but yeah. no errors or anything, just sits there until it's time for the next run lol
Makes no sense considering none of the things required for the xml are directly realted to crafting scripts, but whatever. it's a complicated program!
Reply
#8
tanic Wrote:<D2NT Error> E:\Program Files\Diablo II\MD\D2NT\scripts\libs\common\NTSnagIt.ntl (159) :referenceError: NTI_WriteLog is not defined.


had this error in snagit, town manager, and i cant figure out how to define it, help would be appreciated Smile
You left out part of the snagit or deleted part that was needed, go back and recheck it

commhunt Wrote:well I'm not sure why, but after i completed this xml logging update, my bot will just sit there staring at whatever item it's just cubed/crafted.
Right now I have crafting disabled, but yeah. no errors or anything, just sits there until it's time for the next run lol
Makes no sense considering none of the things required for the xml are directly realted to crafting scripts, but whatever. it's a complicated program!
Check step 8,

Topic is updated to match the maker's updates
[SIGPIC]http://yfrog.com/mhskidudecopyg[/SIGPIC]
Reply
#9
ok yeah, I skiped steps 1-8 via /* */ ing the original code and pasting in your updated files, so i kinda forgot that the cube file was edited as well ^.^ makes sense now lol.
part A of step 8 was present, however part B was not. here's to calling functions that exist! xD

thanks skidude!
Reply
#10
skidude Wrote:Try replacing your NTItemlogger with this [URL="http://pastebin.com/raw.php?i=6A9ixcY1"]RAW OUTPUT 6A9ixcY1
[/URL]
If u don't want the xml logging u don't have to use it. I don't use it on my bot

Thank you this fixed my problem. But now in my item log i want to it show me literally every item that i sell/keep not just uniques. How do i do this.
Also what is the fourth picture of? I want it to look like the first, second, or fourth picture. How do i open/get that?
Reply
#11
EliMaxwell Wrote:Thank you this fixed my problem. But now in my item log i want to it show me literally every item that i sell/keep not just uniques. How do i do this.
Also what is the fourth picture of? I want it to look like the first, second, or fourth picture. How do i open/get that?

Go into D2NT\scripts\logs find the .xml file with the date you would like to look at. Open it in FireFox. You can open it with Chrome but the hover function won't work. Internet explorer won't work.

From there you can click the button "Show All" and you will see every item the bot sold and kept.
Reply
#12
lordrylen Wrote:Go into D2NT\scripts\logs find the .xml file with the date you would like to look at. Open it in FireFox. You can open it with Chrome but the hover function won't work. Internet explorer won't work.

From there you can click the button "Show All" and you will see every item the bot sold and kept.

Okay thanks for answering that question. But how can i make my d2nt manager item log show everything like the first two pictures.
Reply
#13
I am going to guess this line in your NTConfig for your character.

NTConfig_LogSoldQuality = 7; // item quality to log for sold (7 = unique, this is only for d2nt manager, xml logs magic,rare,etc)

Change the 7 to something else...not sure what though.
Reply
#14
Yeah thats what i thought also, i changed it to 1 thinking 1 would be the lowest and it didnt work so i decided to ask here Smile
Reply
#15
4 just showed me a charm the bot sold...

It would seem that setting it to 4 shows magic items...
Reply
#16
is it possible to put multiple numbers for magic/rare/unique?
Reply
#17
I've tried adding multiple NTConfig_LogSoldQuality lines.
I've tried NTConfig_LogSoldQuality = (4 || 6 || 7);

But no luck.

There has got to be a way.
Reply
#18
Guess we just have to wait for the guy that started this thread. He may know.
Reply
#19
figured I'd help :
bigapple90 Wrote:i rewrote guide and am planning to add this part: To change the number/quality of items to log sold in the d2nt manager:

Open NTTown, change :
Code:
if(_newitem.quality == NTConfig_LogSoldItems)
to this:

Code:
for(var r = 0; r < NTConfig_LogSoldItems.length; r++)
                        if(_newitem.quality == NTConfig_LogSoldItems[r])
Now open NTTownManager, do this twice, change:
Code:
if(_items[i].quality == NTConfig_LogSoldItems)
to this:
Code:
for(var r = 0; r < NTConfig_LogSoldItems.length; r++)
                     if(_items[i].quality == NTConfig_LogSoldItems[r])
Now open your char configs and change
Quote: NTConfig_LogSoldItems = X;
to an array, like so:
Quote: NTConfig_LogSoldItems = [4,5,6,7]; // 4= magic, 5 = set, 6 = rare, 7 = unique
4,5,6,7 will log magic,set,rare and unique, you can change it to something like 6,7 to only log rare and unique
(this is to show what sold items are logged in the d2nt manager, the xml already logs magic+)

--
i also plan to update to add xml logging for cubed items
Note: the lines might be
Quote:NTConfig_LogSoldItems
or something like
Quote:NTConfig_LogSoldQuality
Reply
#20
whoot glad u joined up bigapple ^.^
[SIGPIC]http://yfrog.com/mhskidudecopyg[/SIGPIC]
Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)