It's doable, but your examples don't make sense. 8+8+9=25, not 28. And 8+9+9=26, not 29...event.value = Math.floor(+this.getField("Total Health").value/3);
And this this code for the third one:
var total = +this.getField("Total Health").value; event.value = total-(Math.floor(total/3)*2);
This will result in 9,9,10 for 28 and 9,9,11 for 29.
Thanks mate. Yeah you're right, my maths is totally out on those! Yeech.
That formula works just as you said! So that's awesome!!
I may be pushing my luck, but is there any way to make it so those totals end up more like 9,10,10 for 29?
How about 10, 10, 9? That's easier to implement.
Yeah I guess that I could work. I'm easy on that front.
Then replace Math.floor with Math.round in the code above.
Hey mate, well that certainly was a step in the right direction! You sure know your coding.
For a moment I had an intense air pump moment! haha. And then there was just one little fly in the ointment... which is surprising, as it works so well on everything, up to this one little bit... which is weird.
I replaced the .floor with .round on all those 3 equations, and then I simply reversed the boxes, and it worked as I had needed it to, which is fabulous! What I found happens now is that on, say, 19 Total Health, it will go 7, 6, 6. And then at 20 it will go 6, 7, 7. Bahahaa. So random. I tried it with having the boxes 7, 7, 6, and when I put the total to 19 it still went 6, 6, 7, so it's the same either way.
Curly, but still way better, so thanks heaps already! If you have any ideas for this one, let me know, and I will be most appreciative
I'm not sure what you "reversed", exactly... For me the result for 19 is 6,6,7 and for 20 it's 7,7,6. Why is that random? It follows the pattern that the first two are the same and the last is what's left. If you want it to work differently then a more complex script is required.
Ah, I see what you mean. The first two are always the same. Gotcha! That is exactly what it does.