SlotsA Slots Game using a Point System like the one from VRFlad
About:
Platforms:
Twitch.
YouTube.
Written by: TerrierDarts.
Last update: Dec 18 2023.
Product Version: 4.
Streamer.Bot Version Required: 0.2.0+.
Import Codes
Import Codes are the way we can share our extensions with you and how you can share
your creations with other people. You can choose if you want to copy the import
to your clipboard or you can download a .txt file to import that.
To Import into Streamer.bot what you need to do is press on Import from the top bar and either Paste in the string or Drag and Drop the file depending
on which method you used to get the Import string.
Once imported, you will notice like all of my chat games it includes an Action called [Currency] - [Set Triggers]. This Action will create a .json file in your data folder. It will only update when there is an update to be pulled from the site, also note it could create triggers for games or extensions you do not have, this is nothing to worry about.
If you already have this Action I would reccomend you choose to replace it as it might change, but I am taking every effort it doesn’t change.
You should then restart Streamer.bot so it can create the Triggers you need as the Triggers will create themselves every time you start Streamer.bot. If done correctly you should receieve a Toast Notification confirming this.
This import will contain 4 Actions, 1 Command and a Queue.
Actions
This game has 1 main action. This should not be edited and you do so at your own risk!
[Currency Admin] - [Slots] - Spin this action handles all the logic for the spin, working out what is span, if the user has won and adjusting points acccordingly. To use this action the best way I found was to use a command called !spin then you can use !slot <betAmount> for example !slots 500. You can also use k for 1000s, m for millions, all and a %.
Triggers Avaliable
7 New Triggers can be found under Custom >> Currency >> Slots
Trigger Name
When Triggered
All In Win
Triggered when a user goes all-in and wins.
All In Loss
Triggered when a user goes all-in and loses.
Any Win
Triggered on any win.
Any Loss
Triggered on any Loss.
Win
Triggered when a user wins but not an all-in win.
Loss
Triggered when a user loses but not an all-in loss.
Slots Fail
Triggered when your bet fails
Arguments Populated
Each Trigger will populate the following Arguments.
Argument
Description
%gameName%
This is the name of the current game.
%rolledEmote1%
This is the value of the 1st rolled emote.
%rolledEmote2%
This is the value of the 2nd rolled emote.
%rolledEmote3%
This is the value of the 3rd rolled emote.
%slotResult%
This will populate the slots result like ||Slot1||Slot2||Slot3||.
%betAmount%
This is the amount that was bet, it will populate the actual value so if you did All, 10% or 5k it will be the number.
%allIn%
This is a bool based on if bet was all in or not.
%winnings%
This is how much the user has won\ (Does not populate on the Loss Triggers)
%multiplier%
This is how much your bet has been multiplied in your win.
%result%
This is if the result was a Win or a Loss.
%oldPoints%
This is the points the user had prior to the spin.
%newPoints%
This is the points the user now has following the spin.
Fail Codes
Fail Codes are a way to explain why something went wrong if something did go wrong, they will be populated from the Fail Trigger, and will be failCode and failReason. Using these you can create a single currency game fail action if you wish!
Code
Reason
1
User Can Not Afford to Make this Bet
Configuration
In [Currency Admin]-[Slot] - Spin you have several Arguments this will have an impact on how your game runs.
You will see there are Currently 6 Folders called Emote Slot X with X been numbers 1 to 6. It is possible to add more numbers and I will explain that later.
In each Folder there are 3 ArgumentsemoteX, percentX and payoutX. There is also an Additional SettingsFolder.
All Settings are explained below in the table.
Setting
Purpose
emote
This is the emote that you will use
percent
This is the value of frequency this emote will appear, the higher the more frequent
payout
This is how much it will payout based on bet size so a 100 bet at 5 will pay 500
defaultBet
This is the bet that will be taken if the user doesnt specify or puts an invalid input
match2On
This is if you want a win, if emote 1 and 2 are equal
match2Payout
This is the payout value if you have match2On set to true
percentTotal
This is the total of all the percentX you have, this been off could effect the game Ideally it will be set to 100
defaultPoints
This is the amount of points a person will be given if they have never had any points before in the past
maxBet
This is the max allowed to bet, set this to -1 to have no max
minBet
This is the minBet allowed to bet, set this to 0 to have no min
In Order to add more emotes you just need to follow these steps.
Duplicate one of the current emote Folders,
For ease rename it Emote Slot X and X been the next number.
Inside the Folder change the 3 Set Arguments so the number matches the Folder.
You can change the values as you see fit.
If you do add an emote ensure that all the PercentVariables when added up do equal to the percentTotal.
Changelog
Version 4
Min and Max Bet Added
Generic Fail Added
Error 1 Reworded
Version 3
Version Numbers Added
Logic now handles points as type long rather than int incase anyone goes over the ‘2,147,483,647’ mark. Points can now go upto ‘9,223,372,036,854,775,807’