kolton / d2bot-with-kolbot

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

Error in BattleOrders #3065

Open Migdaddy opened 3 years ago

Migdaddy commented 3 years ago

Hello

Apologies if this has been resolved before but I checked history and could not come up with anything. I (like so many others) am running battle orders script on my helper barb and I'm getting my Main (Sorc) and other helper (Pally) to go to cata 2. My barb also goes to Cata 2 but I get an error messege and he leaves to RoF and casts B.O. and stays waiting in act 4 town. The error messege I receive is "Error in BattleOrders (battleorders.js line 117) Config.Battleorders.Getters is undefined" So I open the BattleOrders file and get to line 117 but I don't understand anything in that line. I'm wondering if anyone here can help. Would be appreciated greatly. The bolded is line 117. Thank you for your time.

        **for (i = 0; i < Config.BattleOrders.Getters.length; i += 0) {**
            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;
                }
gtoilet commented 3 years ago

try getting a new battleorders.js other than that make sure your toon names are case sensative

Migdaddy commented 3 years ago

try getting a new battleorders.js other than that make sure your toon names are case sensative

I went to the battleorders.js code, copied and pasted it to my file and the error code moved to line 55. Same error code tho. And yes everything is case sensitive on the names.

Bcubrich commented 3 years ago

Can you paste all the character configs battle orders lines? That is, in each char config there should be something like this

Getter

    // 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.

giver

    // 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 = false; // Idle until the player that received BO leaves.
        Config.BattleOrders.Getters = ["Fire-nIceBaal"]; // 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.Getters = ["Fire-nIceBaal","Lightn_Darkness","LichKingSaul"]; // List of players to wait for before casting Battle Orders (mode 0). All players must be in the same area as the BOer.

    // Team MF system
    Config.MFLeader = false; // Set to true if you have one or more MFHelpers. Opens TP and gives commands when doing normal MF runs.
Migdaddy commented 3 years ago

Barb // 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.Idle = false; // Idle until the player that received BO leaves. Config.BattleOrders.Getters = ["Daenerys_Stark"]["Aegon_Stark"]; // 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)

Main Runner // 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.Idle = 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. Config.BattleOrders.QuitOnFailure = false; // Quit the game if BO fails Config.BattleOrders.SkipIfTardy = false; // 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)

Helper // 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.Idle = 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. 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)

Thanks for help again!

Bcubrich commented 3 years ago

This is your problem line

Config.BattleOrders.Getters = ["Daenerys_Stark"]["Aegon_Stark"]; // List of players to wait for before casting Battle Orders (mode 0). 

should be this

Config.BattleOrders.Getters = ["Daenerys_Stark", "Aegon_Stark"]; // List of players to wait for before casting Battle Orders (mode 0). 

please read up on using arrays in javaScript

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array

Migdaddy commented 3 years ago

I'm still getting an error code at Cata 2. It reads "{Strict Warning (162)] File(kilbot/libs/bots/battleorders.js:117) reference to undefined property (intermediate value).Aegon_Stark" then it proceeds to give a BO timeout fail.

Bcubrich commented 3 years ago

Repaste those lines again now that you changed them please.

Migdaddy commented 3 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.Idle = false; // Idle until the player that received BO leaves. Config.BattleOrders.Getters = ["Daenerys_Stark", "Aegon_Stark"]; // 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)

Bcubrich commented 3 years ago

This is on your barb? Looks correct.

Migdaddy commented 3 years ago

Yessir. Still won't do battle orders for my other 2 characters. I'm at a dead end for what I can do to fix this.

texxxmex commented 3 years ago

Do the other characters join your party? And/or do the getters both travel to the proper area?

Migdaddy commented 3 years ago

Do the other characters join your party? And/or do the getters both travel to the proper area?

Yes they all wait in cata 2 until the script times out then they continue their run.

Migdaddy commented 3 years ago

Guess no one can help :(

texxxmex commented 3 years ago

Guess no one can help :(

in battleorders.js, add the following lines after line 57 and see what it prints when it fails:

print("ÿc<Getter: " + Config.BattleOrders.Getters[i]); print("ÿc<InParty: " + Misc.inMyParty(Config.BattleOrders.Getters[i])); print("ÿc<InArea: " +getUnit(0, Config.BattleOrders.Getters[i]));

This should tell you which character it's failing on and for what reason.