items von mule -> *.txt

01/25/2013 19:12 fluxboy#1
hi, gab hier mal ein (ich glaube d2nt script) welches alle items die auf einem account waren in eine *.txt datei exportiert hat.

leider finde ich das nicht mehr und das von muddy ist nicht das richtige.

was benutzt man dafür am besten?
03/25/2013 06:28 chrisignm#2
push, gibts sowas für d2bs?
03/25/2013 13:22 Stibi#3
würd den d2bs itemlogger drüber laufen lassen und dann im itemviewer anschaun

für d2nt hab ich hier noch etwas gefunden

Code:
var log_type = 0; // 0: write to file, 1: log in OOG

var _filename = "NTBot/MyData/Custom/listItems_"+me.charname+".txt"; // relative path, starting from the /scripts/ directory

function NTMain()
{
    Include("libs/common/NTCommon.ntl");
    Include("NTBot/char_configs/NTConfig.ntl");
	NTC_IncludeLibs();
	

    var _items = me.GetItems();
    var _locations = new Array(4);
    for (var i =0; i < _items.length; i++)
    {
          var location = "equ";
          switch (_items[i].itemloc)
          {
               case 4:
                   if(_items[i].mode == 0)
                        location = "stash";
                   break;
               case 0:
                   if(_items[i].mode == 0)
                        location = "inv";
                   break;
               case 3:
                   if(_items[i].mode == 0)
                        location = "cube";
                   break;
               default:
                   break;
          }
          if (_locations[location] == undefined)
               _locations[location] = new Array();
          _locations[location].push(_items[i]);
    }

    switch(log_type)
    {
          default: // if log_type isn't 0 or 1, we consider it is 0
          case 0:
             var filehandle = FileOpen(_filename, 1);
             if (filehandle)
             {
                  filehandle.WriteLine("=== "+me.charname+"'s items ===");
                  filehandle.WriteLine("");
                  filehandle.WriteLine("");
                  for (loc in _locations)
                  {
                       filehandle.WriteLine(" *** "+loc);
                       filehandle.WriteLine("");
                       for (var k = 0; k < _locations[loc].length; k++)
                       {
                             var _item = _locations[loc][k];
	                         filehandle.WriteLine(" -- "+NTC_ItemQualityToName[_item.quality]+" item, iLvl "+ _item.itemlevel+" --");
                             var _desc_split = _item.itemdesc.substring(3).split("\n");
                             var _final_desc = "";
                             for(var line = 0; line < _desc_split.length; line++)
                             {
                                  if(_desc_split[line].lastIndexOf("˙c") >= 0)
                                       _final_desc += _desc_split[line].substring(0, _desc_split[line].lastIndexOf("˙c")) + "\n";
                                 else
                                       _final_desc += _desc_split[line] + "\n";
                             }
                             filehandle.WriteLine(_final_desc);
                             filehandle.WriteLine("");
                       }
                       filehandle.WriteLine("");
                       filehandle.WriteLine("");
                  }
                  filehandle.Close();
             }
             else
             {
                  Print("˙c1Couldn't open file "+_filename+" ! => abort");
             }
             break;

          case 1:
             NTC_SendLogToOOG(NTC_LOG_ITEM, "*** "+me.charname+"'s items ***");
             for (loc in _locations)
             {
                  for (var k = 0; k < _locations[loc].length; k++)
                  {
                       var _item = _locations[loc][k];
                       NTC_SendLogToOOG(NTC_LOG_ITEM, loc+": " + NTC_ItemQualityToMGRColor[_item.quality] + _item.itemdesc.split("\n")[0].substring(3) + " ˙c6iLvl aaa " + _item.itemlevel + ";" + _item.itemdesc);
                  }
             }
             break;
    }
	Print("Done!");
	Print("NTBot/MyData/Custom/listItems_"+me.charname+".txt");
}