kolton / d2bot-with-kolbot

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

Please help with setting up Bot sorc + Bo barb #2414

Open Booobek opened 4 years ago

Booobek commented 4 years ago

im complletly lost... Please help, i cant get my bo barb to work with my mf sorc... So my sorc going to andy wp and wait there for a while, follower barb profile wont even turn on, if i press start manually on follower (bo profile) it will join sorc game, take invite, go to her on andy wp and leave sec after without giving bo..

my sorc is working on leader profile, bo barb on follower this is my part from d2botfollow.dbj i change

var JoinSettings = { "Bot": ["bo"] where Bot is my bot profile and bo is my bo barb profile on kolbot

this is the part from my mf bot:

var ip = Number(me.gameserverip.split(".")[3]); print(ip);

// Battle orders script - Use this for 2+ characters (for example BO barb + sorc)
Scripts.BattleOrders = true;
    Config.BattleOrders.Mode = 1; // 0 = give BO, 1 = get BO
    Config.BattleOrders.Wait = false; // Idle until the player that received BO leaves.
    Config.BattleOrders.Getters = []; // List of players to wait for before casting Battle Orders (mode 0). All players must be in the same area as the BOer.

my bo barb part // Battle orders script - Use this for 2+ characters (for example BO barb + sorc) Scripts.BattleOrders = true; Config.BattleOrders.Mode = 0; // 0 = give BO, 1 = get BO Config.BattleOrders.Wait = true; // Idle until the player that received BO leaves. Config.BattleOrders.Getters = []; // List of players to wait for before casting Battle Orders (mode 0). All players must be in the same area as the BOer.

now if i put my leader character in game name in here Config.BattleOrders.Getters = [mf sorc in game name]; // List of players to wait for before casting Battle Orders (mode 0). All players must be in the same area as the BOer.****

bo barb wont even join my sorc and i get message, line 23 character in game name is not defined

thanks for help

hdikiglb commented 4 years ago

post entire barb script

Booobek commented 4 years ago

post entire barb script

// Barbarian config file

/* Brief instructions:

function LoadConfig() { /* Sequence config

falconergithub commented 4 years ago

now if i put my leader character in game name in here Config.BattleOrders.Getters = [mf sorc in game name]; // List of players to wait for before casting Battle Orders (mode 0). All players must be in the same area as the BOer.****

bo barb wont even join my sorc and i get message, line 23 character in game name is not defined

thanks for help

Try

Config.BattleOrders.Getters = ["SorcCharacterName"];

Booobek commented 4 years ago

now if i put my leader character in game name in here Config.BattleOrders.Getters = [mf sorc in game name]; // List of players to wait for before casting Battle Orders (mode 0). All players must be in the same area as the BOer.**** bo barb wont even join my sorc and i get message, line 23 character in game name is not defined thanks for help

Try

Config.BattleOrders.Getters = ["SorcCharacterName"];

ok thanks it help a bit :) adding "" help, now there is no ,,line 23 character in game name is not defined'' and barb join my sorc and stay with her on andy wp, but still dont give be, and bo profile is not autotriggered, i need start it myself , also after a while of not reciving bo my sorc leave game and create new one waiting at andy wp and barb stay where it is, unless i leave game then he autojoin my sorc and all again, i need missing something

falconergithub commented 4 years ago

Oh, now that I am actually looking at your config, I found your problem.

Config.BattleOrders.Wait = true; // Idle until the player that received BO leaves. That's not a true/false, it should be a number.

What you're thinking of is

Config.BattleOrders.Idle = false; // Idle until the player that received BO leaves.

Config.BattleOrders.Wait in the default configuration, is:

Config.BattleOrders.Wait = 10; // Duration to wait for players to join game in seconds (default: 10)

Booobek commented 4 years ago

Oh, now that I am actually looking at your config, I found your problem.

Config.BattleOrders.Wait = true; // Idle until the player that received BO leaves. That's not a true/false, it should be a number.

What you're thinking of is

Config.BattleOrders.Idle = false; // Idle until the player that received BO leaves.

Config.BattleOrders.Wait in the default configuration, is:

Config.BattleOrders.Wait = 10; // Duration to wait for players to join game in seconds (default: 10)

thanks for looking in to this much appreciate :), no, did not help unfortunately , also did the follower profile should trigger them self like auto mule setting?

Booobek commented 4 years ago

there is only 3 parts in kolbot where this should be set? d2botfollow.dbj file with my leader and follower profile and battleorder script part on sorc and barb profile config?

falconergithub commented 4 years ago

Post your BattleOrders script again.

I use this script every single day for every single run.

Here is mine for reference.

Scripts.BattleOrders = true;
        Config.BattleOrders.Mode = 0; // 0 = give BO, 1 = get BO
        Config.BattleOrders.Idle = false; // Idle until the player that received BO leaves.
        Config.BattleOrders.Getters = ["eagaeg", "ppeeerrr"]; // List of players to wait for before casting Battle Orders (mode 0). All players must be in the same area as the BOer.
        Config.BattleOrders.QuitOnFailure = false; // Quit the game if BO fails
        Config.BattleOrders.SkipIfTardy = true; // Proceed with scripts if other players already moved on from BO spot
        Config.BattleOrders.Wait = 10; // Duration to wait for players to join game in seconds (default: 10)

I can confirm this is 100% working for me, I just have 2 characters my barb is waiting for rather than 1.

Also, no, followers will not auto-trigger by default. You have to start the profile and then provided that your leader is running and follower is set up correctly, it will continue to run from thre.

Booobek commented 4 years ago

one thing to add, if i bo on barb now myself, sorc start mf like should, and barb leaving to loby and all is working fine, so only barb need give be

Booobek commented 4 years ago

// Battle orders script - Use this for 2+ characters (for example BO barb + sorc) Scripts.BattleOrders = true; Config.BattleOrders.Mode = 0; // 0 = give BO, 1 = get BO Config.BattleOrders.Wait = 10; // Idle until the player that received BO leaves. Config.BattleOrders.Getters = ["my char in game name"]; // List of players to wait for before casting Battle Orders (mode 0). All players must be in the same area as the BOer.

Booobek commented 4 years ago

Post your BattleOrders script again.

I use this script every single day for every single run.

Here is mine for reference.

Scripts.BattleOrders = true;
      Config.BattleOrders.Mode = 0; // 0 = give BO, 1 = get BO
      Config.BattleOrders.Idle = false; // Idle until the player that received BO leaves.
      Config.BattleOrders.Getters = ["eagaeg", "ppeeerrr"]; // List of players to wait for before casting Battle Orders (mode 0). All players must be in the same area as the BOer.
      Config.BattleOrders.QuitOnFailure = false; // Quit the game if BO fails
      Config.BattleOrders.SkipIfTardy = true; // Proceed with scripts if other players already moved on from BO spot
      Config.BattleOrders.Wait = 10; // Duration to wait for players to join game in seconds (default: 10)

I can confirm this is 100% working for me, I just have 2 characters my barb is waiting for rather than 1.

Also, no, followers will not auto-trigger by default. You have to start the profile and then provided that your leader is running and follower is set up correctly, it will continue to run from thre.

i did copy completely your part and rename my char, it act the same

falconergithub commented 4 years ago

I would take a look at your kolbot\libs\bots\BattleOrders.js and make sure you have one that matches the most recent repo

Booobek commented 4 years ago

I would take a look at your kolbot\libs\bots\BattleOrders.js and make sure you have one that matches the most recent repo

i never change anything here : function BattleOrders() { this.giveBO = function (list) { var i, unit, failTimer = 60, tick = getTickCount();

    for (i = 0; i < list.length; i += 1) {
        unit = getUnit(0, list[i]);

        if (unit) {
            while (!unit.getState(32) && copyUnit(unit).x) {
                if (getTickCount() - tick >= failTimer * 1000) {
                    showConsole();
                    print("ÿc1BO timeout fail.");
                    quit();
                }

                Precast.doPrecast(true);
                delay(1000);
            }
        }
    }

    return true;
};

Town.doChores();

try {
    Pather.useWaypoint(35, true); // catacombs
} catch (wperror) {
    showConsole();
    print("ÿc1Failed to take waypoint.");
    quit();
}

Pather.moveTo(me.x + 6, me.y + 6);

var i,
    tick = getTickCount(),
    failTimer = 60;

MainLoop: while (true) { switch (Config.BattleOrders.Mode) { case 0: // Give BO for (i = 0; i < Config.BattleOrders.Getters.length; i += 1) { while (!Misc.inMyParty(Config.BattleOrders.Getters[i]) || !getUnit(0, Config.BattleOrders.Getters[i])) { if (getTickCount() - tick >= failTimer * 1000) { showConsole(); print("ÿc1BO timeout fail."); quit(); }

                delay(500);
            }
        }

        if (this.giveBO(Config.BattleOrders.Getters)) {
            break MainLoop;
        }

        break;
    case 1: // Get BO
        if (me.getState(32)) {
            delay(1000);

            break MainLoop;
        }

        if (getTickCount() - tick >= failTimer * 1000) {
            showConsole();
            print("ÿc1BO timeout fail.");
            quit();
        }

        break;
    }

    delay(500);
}

Pather.useWaypoint(1);

if (Config.BattleOrders.Mode === 0 && Config.BattleOrders.Wait) {
    for (i = 0; i < Config.BattleOrders.Getters.length; i += 1) {
        while (Misc.inMyParty(Config.BattleOrders.Getters[i])) {
            delay(500);
        }
    }
}

return true;

}

falconergithub commented 4 years ago

Yes, you're using a long outdated version of BattleOrders.js

The main repository is at https://github.com/blizzhackers/kolbot now - I highly recommend updating right away because I am sure several scripts are broken, you just probably haven't encountered them yet.

Because this is relatively short, I'll give you the updated battleorders.js here, but yeah, you need to update.

If you're using this git as your repo, you're about 5 months behind on everything, and you will run into problems like this again.

/**
*   @filename   BattleOrders.js
*   @author     kolton, jmichelsen
*   @desc       give or receive Battle Orders buff
*/

function BattleOrders () {
    this.checkForPlayers = function () {
        if (Misc.getPlayerCount() <= 1) {
            throw new Error("Empty game"); // Alone in game
        }
    };

    this.amTardy = function () {
        let party = getParty();

        AreaInfoLoop:
        while (true) {
            try {
                this.checkForPlayers();
            } catch (e) {
                if (Config.BattleOrders.Wait) {
                    print("Waiting " + Config.BattleOrders.Wait + " seconds for other players...");

                    while (getTickCount() - tick < Config.BattleOrders.Wait * 1000) {
                        me.overhead("Waiting " + Math.round(((tick + (Config.BattleOrders.Wait * 1000)) - getTickCount()) / 1000) + " Seconds for other players");
                        delay(1000);
                    }

                    this.checkForPlayers();
                }
            }

            if (party) {
                do {
                    if (party.name !== me.name && party.area) {
                        break AreaInfoLoop; // Can read player area
                    }
                } while (party.getNext());
            }
        }

        if (party) {
            do {
                if (party.area === 131 || party.area === 132 || party.area === 108 || party.area === 39) {
                    // Player is in Throne of Destruction, Worldstone Chamber, Chaos Sanctuary, or Cows
                    print("ÿc1I'm late to BOs. Moving on...");

                    return true;
                }
            } while (party.getNext());
        }

        return false; // Not late; wait.
    };

    this.giveBO = function (list) {
        let i,
            unit,
            failTimer = 60,
            tick = getTickCount();

        for (i = 0; i < list.length; i += 1) {
            unit = getUnit(0, list[i]);

            if (unit) {
                while (!unit.getState(32) && copyUnit(unit).x) {
                    if (getTickCount() - tick >= failTimer * 1000) {
                        showConsole();
                        print("ÿc1BO timeout fail.");

                        if (Config.BattleOrders.QuitOnFailure) {
                            quit();
                        }

                        break;
                    }

                    Precast.doPrecast(true);
                    delay(1000);
                }
            }
        }

        return true;
    };

    Town.doChores();

    try {
        Pather.useWaypoint(35, true); // catacombs
    } catch (wperror) {
        showConsole();
        print("ÿc1Failed to take waypoint.");

        if (Config.BattleOrders.QuitOnFailure) {
            quit();
        }

        return false;
    }

    Pather.moveTo(me.x + 6, me.y + 6);

    let i,
        tick = getTickCount(),
        failTimer = 60;

    MainLoop:
    while (true) {
        if (Config.BattleOrders.SkipIfTardy && this.amTardy()) {
            break;
        }

        switch (Config.BattleOrders.Mode) {
        case 0: // Give BO
            for (i = 0; i < Config.BattleOrders.Getters.length; i += 1) {
                while (!Misc.inMyParty(Config.BattleOrders.Getters[i]) || !getUnit(0, Config.BattleOrders.Getters[i])) {
                    if (getTickCount() - tick >= failTimer * 1000) {
                        showConsole();
                        print("ÿc1BO timeout fail.");

                        if (Config.BattleOrders.QuitOnFailure) {
                            quit();
                        }

                        break MainLoop;
                    }

                    delay(500);
                }
            }

            if (this.giveBO(Config.BattleOrders.Getters)) {
                break MainLoop;
            }

            break;
        case 1: // Get BO
            if (me.getState(32)) {
                delay(1000);

                break MainLoop;
            }

            if (getTickCount() - tick >= failTimer * 1000) {
                showConsole();
                print("ÿc1BO timeout fail.");

                if (Config.BattleOrders.QuitOnFailure) {
                    quit();
                }

                break MainLoop;
            }

            break;
        }

        delay(500);
    }

    Pather.useWaypoint(1);

    if (Config.BattleOrders.Mode === 0 && Config.BattleOrders.Idle) {
        for (i = 0; i < Config.BattleOrders.Getters.length; i += 1) {
            while (Misc.inMyParty(Config.BattleOrders.Getters[i])) {
                delay(500);
            }
        }
    }

    return true;
}
Booobek commented 4 years ago

thanks falconergithub for you time, unfortunately did not help, i think i will run it without bo, or maby wait when new updated version of of program come up and try again, im not the greatest at scripts :)

Booobek commented 4 years ago

i found problem : in d2botfollow.dbj

/* Join game settings Format: "leader's profile": ["leecher 1 profile", "leecher 2 profile", ...] If you want everyone to join the same leader, use "leader's profile": ["all"] NOTE: Use PROFILE names (profile matches window title), NOT character/account names leader:leecher groups need to be divided by a comma example: var JoinSettings = { **** "Bot": ["bo"],*** "lead2": ["follow3", "follow4"] }; */

var JoinSettings = { "Bot": ["bo"] };

i did not put Bot,bo in he first section marked with stars, topic closed :)