Platforms:
Twitch.
YouTube.
Written by: TerrierDarts.
Last update: Dec 18 2023.
Product Version: 4.
Streamer.Bot Version Required: 0.2.0+.
Set-Up Difficulty: 1/5.
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 reccommend 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 5 Actions, 1 Command and a Queue.
Actions
This game has 1 admin action. This should not be edited and you do so at your own risk!
[Currency Admin] - [Gamble] - 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 !gamble then you can use !gamble <betAmount> for example !gamble 500. You can also use k for 1000s, m for millions, all and a %.
Push is the neither win nor loss, it just returns the bet, like in blackjack when your hand matches the dealers hand. Push is part of the logic in which if the random roll is equal to the win percent then you are refunded. If this is this isnt enabled then a match will result in a loss.
Triggers Avaliable
10 New Triggers can be found under Custom >> Currency >> Gamble
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.
All In Push
Triggered when a user goes all-in and pushes.
Any Win
Triggered on any win.
Any Loss
Triggered on any loss.
Any Push
Triggered on any push.
Win
Triggered when a user wins but not an all-in win.
Loss
Triggered when a user loses but not an all-in loss.
Push
Triggered when a user pushes but not an all-in push.
Bet Fail
Triggered when your bet fails
Arguments Populated
Each Trigger will populate it’s own arguments.
Argument
Description
%gameName%
This is the name of the current game.
%betSize%
This is the amount that has been bet.
%allIn%
This is tells us if the user has gone all in or not
%gambleResult%
This tells us if its a win or loss.
%oldPoints%
This is the users Old amount of Points before the bet.
%newPoints%
This is the users New amount of Points after the bet.
%result%
This returns the result of the game.
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
The main admin action [Currency Admin] - [Gamble] - Spin has some setting that can be adjusted to make the game run differently these are explained below. With this game having different triggers it means that you can control what happens when certian events occur.
Setting
Purpose
defaultBet
This is the bet amount if one hasn’t been given.
defaultPoints
This controls the amount of points a user will have if they don’t have enough to bet.
winPercent
This is a percentage of chance to win, the higher you set this the more likely users are to win.
pushEnabled
This controls if Push is enabled. If set to false then a push will be handled as a loss. See more above about Push.
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
Its important to note that defaultBet must be within the range of minBet and maxBet.
Also defaultPoints must be either 0 or also within that range. Not setting this correctly could cause issues.
Changelog
Version 5
Points Updated Trigger added
Version 4
Added Min and Max bet
Error code 1 reworded.
Generic Fail Event added.
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’