kolton / d2bot-with-kolbot

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

Bot killed cow king during run #2241

Open aochalkov opened 4 years ago

aochalkov commented 4 years ago

As described. Did some one have that problem? Game name + password are absolutly random in game. It was ipossible some one joined the game.

ARkaine2 commented 4 years ago

Same here. And i saw one more topic recently.

And one more caution: If you wish to save Red Portal to Pindleskin you shouldn't run Nihlathak script, because even if WP in Halls of Pain wasn't taken, bot in Nihlathak script will do run from Red Portal to WP in Halls of Pain and then will do usual Nihlathak run, but after that we won't have Red Portal.

InterestingIndeed commented 4 years ago

which char did you use?

aochalkov commented 4 years ago

Sorc

вс, 2 февр. 2020 г., 17:52 InterestingIndeed notifications@github.com:

which char did you use?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kolton/d2bot-with-kolbot/issues/2241?email_source=notifications&email_token=AGK7QWQA5HDHIBUEZGFXNOTRA3M2PA5CNFSM4KOTVVIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKRYS6Y#issuecomment-581142907, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGK7QWXWQOMRNYACEVN4CP3RA3M2PANCNFSM4KOTVVIA .

ARkaine2 commented 4 years ago

InterestingIndeed, Cow King was killed by Blizz sorc. Light sorc runs nicely.

WiZzMaN47 commented 4 years ago

Yeah.. As long as merc dont poke em... I used the custom attack in char config

Config.CustomAttack = {"TheCowKing" : [-1,-1]};

Not sure if the name is correct but that should work.

On Sun, Feb 2, 2020, 11:08 AM ARkaine2 notifications@github.com wrote:

InterestingIndeed, Cow King was killed by Blizz sorc. Light sorc runs nicely.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kolton/d2bot-with-kolbot/issues/2241?email_source=notifications&email_token=ACFN3UYUFOR6W3MUNQLXWWDRA4D3PA5CNFSM4KOTVVIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKR5B6Q#issuecomment-581161210, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFN3U4ZVVOQRQRXI2OOQVDRA4D3PANCNFSM4KOTVVIA .

eeonus commented 3 years ago

I ran into the problem on one of my chars so I looked into correcting it. For one, the CustomAttack checks against unit.name which is "The Cow King" through testing. Also, I made some additions.

I replaced clearCowLevel with the following:

    this.clearCowLevel = function () {
        if (Config.MFLeader) {
            Pather.makePortal();
            say("cows");
        }

        var room, result, myRoom,
            rooms = this.buildCowRooms();

        var king, target, i;

        function RoomSort(a, b) {
            return getDistance(myRoom[0], myRoom[1], a[0], a[1]) - getDistance(myRoom[0], myRoom[1], b[0], b[1]);
        }

        outer:
        while (rooms.length > 0) {
            // get the first room + initialize myRoom var
            if (!myRoom) {
                room = getRoom(me.x, me.y);
            }

            if (room) {
                if (room instanceof Array) { // use previous room to calculate distance
                    myRoom = [room[0], room[1]];
                } else { // create a new room to calculate distance (first room, done only once)
                    myRoom = [room.x * 5 + room.xsize / 2, room.y * 5 + room.ysize / 2];
                }
            }

            rooms.sort(RoomSort);
            room = rooms.shift();

            result = Pather.getNearestWalkable(room[0], room[1], 10, 2);

            if (result) {
                Pather.moveTo(result[0], result[1], 3);

                target = getUnit(1);

                if (target) {
                    do {
                        if (target.name === "The Cow King" && getDistance(target, me.x, me.y) <= 80) {
                            print("skipping king: " + target.x + " " + target.y);
                            continue outer;
                        }
                    } while (target.getNext());
                }

                if (!Attack.clear(30)) {
                    return false;
                }
            }
        }

        return true;
    };

The changes will, upon reaching each room position where it will start clearing, skip the room if the Cow King is within 80 range of the start.

A few notes:

I have not seen this instance hit outside of manual testing so what may be occasionally killing kings is a combination of dodging with a fast enchanted mob in which case this won't help since we'll be far from the room start location. The CustomAttacks config seems generally useless for skipping monsters with how its implemented since any AoE skill will pass a check on a target while still killing mobs within its radius who may be set to be skipped. Were I to ever implement this, I would probably add in another config entry specifically to skip mobs and add a range check in Attacks.js which may be a lot of extra processing for something probably only used for Cow runs.

Hope this info helps someone, I didn't see a solution posted.

mato89 commented 2 years ago

I'm running triple bot (hammer, blizz sorc, bone necro) and after 100 runs or so it managed to kill cow king. So now I can no longer make cows.