# AutoStat won't work

**URL:** <https://blizzhackers.discourse.group/t/autostat-wont-work/637>\
**Category:** Support\
**Created:** [April 10, 2020, 12:32am UTC](https://blizzhackers.discourse.group/t/autostat-wont-work/637 "2020-04-10T00:32:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike1234](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@mike1234](https://blizzhackers.discourse.group/u/mike1234)\
**Post date:** [April 10, 2020, 12:32am UTC](https://blizzhackers.discourse.group/t/autostat-wont-work/637/1 "2020-04-10T00:32:26Z")

</div>

I keep getting an error getting an error on line 614 Which is

switch (this.statBuildOrder[i][0]) {

```
this.addStatPoint = function () {
	var i, hardStats;

	this.remaining = me.getStat(4);

	for (i = 0; i < this.statBuildOrder.length; i += 1) {
		switch (this.statBuildOrder[i][0]) {
		case 0:
		case "s":
		case "str":
		case "strength":
			if (typeof this.statBuildOrder[i][1] === "string") {
				switch (this.statBuildOrder[i][1]) {
				case "all":
					return this.useStats(0);
				default:
					break;
				}
			} else {
				hardStats = this.getHardStats(0);

				if (hardStats < this.statBuildOrder[i][1]) {
					return this.useStats(0, this.statBuildOrder[i][1] - hardStats);
				}
			}

			break;
		case 1:
		case "e":
		case "enr":
		case "energy":
			if (typeof this.statBuildOrder[i][1] === "string") {
				switch (this.statBuildOrder[i][1]) {
				case "all":
					return this.useStats(1);
				default:
					break;
				}
			} else {
				hardStats = this.getHardStats(1);

				if (hardStats < this.statBuildOrder[i][1]) {
					return this.useStats(1, this.statBuildOrder[i][1] - hardStats);
				}
			}

			break;
		case 2:
		case "d":
		case "dex":
		case "dexterity":
			if (typeof this.statBuildOrder[i][1] === "string") {
				switch (this.statBuildOrder[i][1]) {
				case "block":
					if (me.gametype === 1) {
						if (this.getBlock() < this.block) {
							return this.useStats(2, this.requiredDex());
						}
					}

					break;
				case "all":
					return this.useStats(2);
				default:
					break;
				}
			} else {
				hardStats = this.getHardStats(2);

				if (hardStats < this.statBuildOrder[i][1]) {
					return this.useStats(2, this.statBuildOrder[i][1] - hardStats);
				}
			}

			break;
```

---

<div class="post-metadata">

**Author:** ![mike1234](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@mike1234](https://blizzhackers.discourse.group/u/mike1234)\
**Post date:** [April 14, 2020, 8:15pm UTC](https://blizzhackers.discourse.group/t/autostat-wont-work/637/3 "2020-04-14T20:15:20Z")

</div>

It won’t let me edit this… but it is all working now.
