kolton / d2bot-with-kolbot

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

Need better field ID script #1781

Open Hairydingle opened 5 years ago

Hairydingle commented 5 years ago

So my issue is that with FieldID, I'm finding that my bot is waiting until my inventory is full to start Identifying stuff. The problem I keep running into is in public games when there is an item on the ground, but my fastpickit can't pick it up before someone else does due to a full inventory. This is especially prevalent with bosses. With Diablo I can't pick up the drops until AFTER he id's and drops gear. By then the gear is gone. Same with Baal. I'm trying to find a way to have him ID right before boss so that my inventory is clear to pick up loot. Either that or have him id each item as soon as he picks them up. I looked in d2bs/kolbot/libs/common/town.js and I found this script for fieldID, but I can't seem to find a function to change this setting. Any help is appreciated.

fieldID: function () { // not exactly a town function but whateva var list, tome, item, result;

    list = this.getUnids();

    if (!list) {
        return false;
    }

    tome = me.findItem(519, 0, 3);

    if (!tome || tome.getStat(70) < list.length) {
        return false;
    }

    while (list.length > 0) {
        item = list.shift();
        result = Pickit.checkItem(item);

        // Force ID for unid items matching autoEquip criteria
        if (result.result === 1 && !item.getFlag(0x10) && Item.hasTier(item)) {
            result.result = -1;
        }

        if (result.result === -1) { // unid item that should be identified
            this.identifyItem(item, tome);
            delay(me.ping + 1);

            result = Pickit.checkItem(item);

            if (!Item.autoEquipCheck(item)) {
                result.result = 0;
            }

            switch (result.result) {
            case 0:
                Misc.itemLogger("Dropped", item, "fieldID");

                if (Config.DroppedItemsAnnounce.Enable && Config.DroppedItemsAnnounce.Quality.indexOf(item.quality) > -1) {
                    say("Dropped: [" + Pickit.itemQualityToName(item.quality).charAt(0).toUpperCase() + Pickit.itemQualityToName(item.quality).slice(1) + "] " + item.fname.split("\n").reverse().join(" ").replace(/ÿc[0-9!"+<;.*]/, "").trim());

                    if (Config.DroppedItemsAnnounce.LogToOOG && Config.DroppedItemsAnnounce.OOGQuality.indexOf(item.quality) > -1) {
                        Misc.logItem("Field Dropped", item, result.line);
                    }
                }
DarkHorseDre commented 5 years ago

yeah needs fixing. I havent looked properly yet but I'm thinkng the simplified sequence is: pick item fieldid

problem is fieldid is a town function IIRC..

looking at pickit.js

// Item can fit - pick it up
if (canFit) {
    this.pickItem(pickList[0], status.result, status.line);
        //fieldid here?
}

I'm thinking you fieldid where I added a comment? give it a try

M3RK4B4H commented 3 years ago

yeah needs fixing. I havent looked properly yet but I'm thinkng the simplified sequence is: pick item fieldid

problem is fieldid is a town function IIRC..

looking at pickit.js

// Item can fit - pick it up
if (canFit) {
  this.pickItem(pickList[0], status.result, status.line);
        //fieldid here?
}

I'm thinking you fieldid where I added a comment? give it a try

This doesn't works :(