kolton / d2bot-with-kolbot

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

Error #802

Closed tgats closed 5 years ago

tgats commented 5 years ago

I keep getting this error on autobuild "(162) File(kolbot\libs\common\autostat.js:614) reference to undefined property this.statBuildOrder(i)[0]"

and also this "(162) File(kolbot\libs\common\autoskill.js:52) reference to undefined property inputArray(i)[1]" any ideas?

iamacow commented 5 years ago

I might be wrong, but this reads to me like you have autostat and autoskill set to true but you aren't using the arrays of arrays format for defining the build. "reference to undefined property this.statBuildOrder[i][0]" would mean that there isn't an array within an array to pull a value from.

Does your build look like the example given in the example build? Config.AutoStat.Build = [ ["strength", 55], // spend points in strength until it reaches 35 ["dexterity", 150], // spend points in dexterity until it reaches 150 ["vitality", "all"] // spend all remaining points in vitality ]; it's important to include the outer brackets and the brackets on each line.

If this isn't it, please post the skill/stat builds you have defined in your character config.

tgats commented 5 years ago

Config.AutoSkill.Enabled = true; // Enable or disable AutoSkill system Config.AutoSkill.Save = 0; // Number of skill points that will not be spent and saved Config.AutoSkill.Build = [120, 20, false], [115, 20, true];;

/* AutoStat builds character based on array defined by the user and this will replace AutoBuild's stat system.
 * AutoStat will stat Build array order. You may want to stat strength or dexterity first to meet item requirements.
 *
 * Format: Config.AutoStat.Build = [[statType, stat], [statType, stat], ... [statType, stat]];
 *  statType - defined as string, or as corresponding stat integer. "strength" or 0, "dexterity" or 2, "vitality" or 3, "energy" or 1
 *  stat - set to an integer value, and it will spend stat points until it reaches desired *hard stat value (*+stats from items are ignored).
 *  You can also set stat to string value "all", and it will spend all the remaining points.
 *  Dexterity can be set to "block" and it will stat dexterity up the the desired block value specified in arguemnt (ignored in classic).
 *
 *  See libs/config/Templates/AutoStatExampleBuilds.txt for Config.AutoStat.Build examples. 
 */
Config.AutoStat.Enabled = true; // Enable or disable AutoStat system
Config.AutoStat.Save = 0; // Number stat points that will not be spent and saved.
Config.AutoStat.BlockChance = 0; // An integer value set to desired block chance. This is ignored in classic.
Config.AutoStat.UseBulk = true; // Set true to spend multiple stat points at once (up to 100), or false to spend singe point at a time.
Config.AutoStat.Build = ["vitality", 200];

// AutoBuild System ( See /d2bs/kolbot/libs/config/Builds/README.txt for instructions )
Config.AutoBuild.Enabled = true;            //  This will enable or disable the AutoBuild system

Config.AutoBuild.Template = "Spin_Hammers"; //  The name of the build associated with an existing
                                            //  template filename located in libs/config/Builds/

Config.AutoBuild.Verbose = true;            //  Allows script to print messages in console
Config.AutoBuild.DebugMode = true;          //  Debug mode prints a little more information to console and
                                            //  logs activity to /logs/AutoBuild.CharacterName._MM_DD_YYYY.log
                                            //  It automatically enables Config.AutoBuild.Verbose

}

iamacow commented 5 years ago

Thanks for posting that, it looks like it is an array of arrays problem.

Config.AutoSkill.Build = [120, 20, false], [115, 20, true];; should be Config.AutoSkill.Build = [[120, 20, false], [115, 20, true]];;

and likewise

Config.AutoStat.Build = ["vitality", 200]; should be Config.AutoStat.Build = [["vitality", 200]];

tgats commented 5 years ago

thank you so much