Alright, fuck it. Feel free, as an apology for being wrong about our intentions this entire time, to crowdsource for someone to fix the bugs that have existed as long as the commands have existed so we don't have to lose time on other projects to have it fixed!
I know that in the beta the issue seems to be fixed where the Ace isn't properly counted, but I had a look before I read that message so I thought I'd share anyways.
I have never used java only Python so if the code is wrong that'll be why but the issues is in the addCards function, as (p+11 <= 12) will run for the first ace if the value of p in the moment is 10, which then adds the final ace on as 1 - leading to a total of 22.
Im pretty sure if you were to use the currentIndex parameter in the reduce action, and create a variable to account for the different between the current index and the length of the array you can make sure it never runs p+11 if there's still another Ace left in the array.
function addCards (type) { return cards[type].sort((a, b) => getValue(b).value - getValue(a).value).reduce((p, c, currentIndex) => { let newCard = getValue(c).value; if (newCard === 1) { var difference = currentIndex - (cards[user].length -1); if (p + 11 <= (21-difference)) { newCard = 11; } } return p + newCard; }, 0); }
Something like that. The -1 from the length is to make sure the integer value returned becomes the final index value, and now if 1 or two aces are left, the code will make sure the other Aces can always be added on top without busting. Again this is the first time I've looked into java so could be completely wrong - I also don't know how to code so the lines may be wrong or miss syntax.
https://hastebin.com/ufiwoqajun.js
The code is also in here^^ idk how to format code on reddit lol
It does. It's two weeks if you haven't run any commands for that period of time.
Dank Memer Discord Message Link.
https://discord.com/channels/470337009886429194/502215543915413504/710214678302818346
about 142k per time