kolton / d2bot-with-kolbot

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

Bot fails to pick up items #1744

Open tc85 opened 5 years ago

tc85 commented 5 years ago

Just had a run where the bot posted Picked up Ohm Rune ... in the drop-down log, but didn't pick the rune up. I only noticed it because the log popped up because of a Error in ClearAnyArea (misc.js line 1349): unit.fname is undefined error message and I didn't see the rune in the D2Bot item log. Went back to where the bot was farming and the Ohm rune was still on the ground.

The pickit file seems to be correct, because the bot TRIED to pick up the rune (and maybe thought it did so). So this seems to be caused by some other error, maybe related to the error in ClearAnyArea?

Somewhat scary to think it might not have picked up other valuable things while farming 😕

DarkHorseDre commented 5 years ago

not sure but seeing this posted in a few places.

was stash and inv full/almost full?

tc85 commented 5 years ago

I can't say for certain that it wasn't full, but in those cases it always logged a message that it goes to town to make space. I've also got automule configured, so the inv/stash shouldn't have been full. My guess would be, that the bot got stuck somewhere (Pala sadly has no Enigma yet) while trying to reach the rune, failed, logged the error and canceled the run

DarkHorseDre commented 5 years ago

ive seen people have issues with automule triggering and you need to narrow it down for the future.

in pickit js:

// Can't make room - trigger automule
                        Misc.itemLogger("No room for", pickList[0]);
                        print("ÿc7Not enough room for " + this.itemColor(pickList[0]) + pickList[0].name);

                        needMule = true;

so it finds out there's no room THEN flags for needMule. I Assume the muling happens sometime after that. The question is the time between dropping the rune, space in inv, and what it does after muling if it couldnt fit the item.
That said, I Assume automule would trigger before inv capacity reaches 9x%? I mean a 1x1 spot for rune should fit, but then when u have only 2x4 columns free its easy to be full and not fit a rune..

tc85 commented 5 years ago

OK, took another look into the code. I highly doubt that it's a automule problem (also automule works flawless for me).

Either it goes into the if (!canFit) condition and sets flag needMule OR into if (canFit) { this.pickItem .... If it logs "Picked up xxx", it must be inside pickItem, which means it didn't flag for muling.

DarkHorseDre commented 5 years ago

Wait, I re-read your OP.

What do you mean by 'drop-down log'? 1) d2manager console window? 2) in-game console log (via ALT+HOME)?

if its 2) then that's something I've seen before. cant remember fully but there may be a few causes.

I've seen log mention an item I just don't find.. maybe for good reason..

I would enable item log and highrune logging in char config. (I also added a few lines to misc.js to create a separate kept log for items which are... kept/gambled/shopped - smaller file size and easy to remove monitor)

I'd also consider writing a few facts to a file/manager window so you can troubleshoot later.

as I said - if you had a rune in console window but it never got stashed it could be due to it being on cursor before a crash, or weird inv. space issues, cube issues..

try and test it on mid runes so you get more hits - ensure you log the state of stash and inv and what bot is doing at each stage of finding the rune. get that console message to the manager window - you never know, we all could be losing stuff xD

tc85 commented 5 years ago

Sorry, I meant the in-game console. I have highrune logging enabled, but am not sure if it was in the d2manager console (too long ago). Are items logged to d2magager console on pick-up or when they are stashed (or "kept")?

I've seen log mention an item I just don't find.. maybe for good reason..

What do you mean by this?

To logging: is there a nice way to log to file (or even better to a log aggregator like Logstash/Graylog)? That way I wouldn't mind having a very verbose log, I'd just grep/parse through it. I'm not very confident in JavaScript and don't know the codebase well enough to know where to start looking (or where to add them if they don't exist), but I'd rather start with a well formatted log instead of writing an overly complicated parser for the d2bs.log.

DarkHorseDre commented 5 years ago

I meant that Ive had the same issue once or twice.

to answer, yes: thats what I told you to enable!

// Additional item info log settings. All info goes to \logs\ItemLog.txt
    Config.ItemInfo = true; // Log stashed, skipped (due to no space) or sold items.
    Config.ItemInfoQuality = [5,6,7,8]; // The quality of sold items to log. See NTItemAlias.dbl for values. Example: Config.ItemInfoQuality = [6, 7, 8];

every dropped, kept, gambled etc item is logged, as per the itemInfoQuality. I created a separate log for items I keep as the filesize got large, even with 5,6,7,8 - but it depends on how many items your bot picks, which is defined by how many items your pickit is searching for.