kolton / d2bot-with-kolbot

d2bot game manager by D3STROY3R with kolbot libs by kolton for d2bs
346 stars 332 forks source link

Feature request: Add date to itemlog.txt and d2bs manager #575

Open DarkHorseDre opened 6 years ago

DarkHorseDre commented 6 years ago

Hi guys, great bot :)

I've been using this for a couple months, and among other things, think it would be useful to have dates on each row of these two sources as it helps when trying to find info/troubleshoot.

Currently there are no dates so its hard to tell when events occur, especially when more than a few days in the past.

Also, the d2bs console is the only place where I can work out which location an item dropped. It would be great if this could be echoed into a file, or exported. As it stands we can only copy the description of 1 item - it would be great to have just the single line info (date, time, profile, itemshortdesc) for all lines in the clipboard or a file export.

FYI: I have d2bs.log enabled and it does support dates, but lacks other info, and is out of sync with the other 2 sources. Maybe some consolidation/redefinition could be done here?

If some of this is already possible/done - soz :)

DHD

Kongolan commented 6 years ago

I support that idea heavily!

DarkHorseDre commented 5 years ago

update - I assumed itemlog.txt was created by d2bs but lines seem to be written in misc.js. will test but seems simple to prefix existing time data with international date format (yyyymmdd).

Will update once I've tested.

DarkHorseDre commented 5 years ago

For itemlog.txt: In Misc.js find emboldened lines (not linking to full file as mine has been modified): I'm sure theres a more compact way of coding this but I'm no coder so....

var desc, date = new Date(), h = date.getHours(), m = date.getMinutes(), s = date.getSeconds(), yyyy = date.getFullYear(), mm = (date.getMonth() + 1), dd = date.getDate(), dateString = "[" + yyyy + (mm < 10 ? "0" + mm : mm) + (dd < 10 ? "0" + dd : dd) + " - " + (h < 10 ? "0" + h : h) + ":" + (m < 10 ? "0" + m : m) + ":" + (s < 10 ? "0" + s : s) + "]";

d2bs - beyond me :)