Gamble feature needs a fix. (Nightly- 2.3.7.1)


#1

Please fill out the following so that we might better serve your request. Please attach logs and console messages as well.

PhantomBot Version: Nightly- 2.3.7.1

OS Version: Windows 10

Java Version: 1.8.0_131

Browser and Version (for Panel Support): G Chrome Version 58.0.3029.110 (64-bit)

Stock PhantomBot: Yes/No ? (idk)

Any Recent Changes to Your System: No

Description of Issue:
The “!gamblesetgainpercent” command doesn’t seem to be working as intended (see image).


#2

If you gamble the same amount of points multiple times, on the same gain percentage, you’ll get a different amount of points back each time.


#3

That is expected based on the logic. It takes into account what the bot rolls and provides a different amount. This is not just a static win value.

range = $.randRange(1, 100);
winRange = $.getIniDbNumber('gambling', 'winRange');  // !gamblesetwinningrange
winSpot = (range - winRange + 1);
winnings = Math.floor(amount + ((amount + winSpot) * gain));

This way, depending upon the luck of the user, if the random number is higher, they will have more winnings.

When this was originally designed, we were asked to not provide yet another static win module but rather something a little bit more dynamic.


#4

Thanks. I’ll just tweak the win rate till I find what i need. I do like this dynamic something a bit better.


#5

However, I did find this.

It does not refer to the alternate point name I set when telling a user that they do not have enough to perform an action. I’d assume this was the case for multiple features, such as redeeming points for various custom commands or even other games. (and yes, I do have the plural form set as “sp0oks”)


#6

I just looked at the code and it is handling it correctly, do you have any custom edits to the language files? If not, try setting your points name multiple again.


#7

A lot of people keep getting confused by the math logic behind the gambling system. So, I will be changing it to only give back the amount they gambled plus the percent you choose on the amount they gambled.

(amount_user_gambled + (amount_user_gambled * gain_percent_set))


#8

Fix is here if anyone wants it: https://github.com/PhantomBot/PhantomBot/pull/1539


#9

This topic was automatically closed after 30 days. New replies are no longer allowed.