Description
This is a simple dice roll game where viewers can challenge each other in chat to roll a 20 sided die each and whoever gets the bigger number wins…
Import Code
TlM0RR+LCAAAAAAABADlXG1v27iW/r7A/gdNgWKBu8MuSZESeYHFbu02jpM2M0kaO/F2P/DVViO/XMtO6l7c/76HkpM4jtOxnKQzc7dA4liUKJ2Hh+c85yHVv//rv0TRqys3LbLx6NVfI/JzeWCkhg6+vXqXGRedjPM8aqjZLHdRKzRU5ygzg2sKOO1/wvco+nv1AU2ZDRcnQss0UQxpnHLEnNBIizRFltiUUO+9Eqbqq7zob3M3DzcdzfP87qgbKZ270N9sOnd3x2+esHqulW760/F8srFF5ddqUZzMg51e5cVKb1M1suPh29Kih61mPDLz6dSNZg/bHqBwD4nylCs1zYIRR8tHhudyI6tGZuXhlifm8wr2v36GfzNXzD5kxezN7Ots7cwKYGp8IlJGkCQpBYBtioRlGKUx99zFKU5MvHbhtcv6g2AGfoPvt8wWk3BvQuP7x2/wvDcs1UOMrPsaLrk7+o+fHwPhZrzOCjeNfp26AtCMmgNnLtee0LrCTLPJciRelacUUeaj2cBF83D1tSqiwrlRlI3Kg7kqZhGPhhkMw/2+Lp2bvM2zK/dg3KpRd97BqBq3NnxlYxPGoAsmjq+Lz58/ZmY6LsZ+9ubo/afPn/emYM31eHr5+fMVe4PfxDgm8vPnYWHG0zzTb2yev1rt7n/v31cvZq45tiUe9vxoooemfxbn32yrM/vlGh+uH/twmf8ajr87nlzb7kGhuh/7F/TrwMQf+8ek0T7tcjjGc2hP3x2P++3m277Z72S6lX9ptw6uNL3un5wP8ou4g3un/cnNOQ76DJ/Ln6sPiwbXcWfRbpGB6jK4h7zsnTZGmna+tVuD3AzPjpp9eL7h3qK93/nWO2/3fz1tDMzQfusuDiZ61CD23dvs/JSfaXKEzTCf9xb9SfXs46NmJq5OuhyH6yz0195vDGyrD3+LvutKYrJGx1C4//uvExMfF+39g1x3O7OLIRzbP7mC84ltNi7hGcG2s/55s5H1zk/iXrczb7d6V7p1kpvRx6Pm6Obej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pN5UA7FeSCF9QIlCKQLK1C1IciSDiBhIo5Sq13MBkhZJsdaGJdsH9/YcAon0CyiiEOyfBmhk6Q4DH8clykivNYkvVFjecviLda+3lZXYDwlBhIV4YSAJNYqIk940hiSy2waer0y8PwI4sGpphyPoYI7HlYGuAOaecoEowAscSCc/EDNtCv1o1b1AxP2v2TYJVwbYGbUAxDDEYiGbbKA1tOWWwtYfHT/3OGd0vs/wTbf24p87x8s2egirBtLLyVMhtA7C2qjWVVMT7J1SIygyy3WTGI+mBsUYbxO/ElaFLVmywAz65B2TIX60SAKyoFQZkwoI8miRFV3OnEYsN3ETNehB68aFDWqWUcqxjFunzziVCkBS8LfOsBFSlE/TfCXz43PXdQhmJWAVOEHE3KF1I5VMypTQCQOE5o4oUiLy/WbiVt/am30iXeMSK4QF74oJhJyP6pDglQJ6nVSusUP9vWlyfKwf8sG+moFCnMCIpSlgDXp2GXl7YcOcGc8mkMWVk825aOxzDf5c3Gcv2hYhiBoC9XIkL6s997Ty3xMrGpFIib8AIwSWT4jx8USmLhiJZacr+DPPKUzcYvTbBw7FTqOEaxSEOBAXWupCIFi9OUWKoSltRmlE97Q/HZCFb4qM6sWNJN4z/+D1XlGzxcSwAA
Installation
In Streamer.bot in select Import
from the top left.
Copy the Import Code
and paste it into the Import String
.
Import code will be provided but it may need some tweaking once installed as it relies on specific commands so these may need to be created and re-linked after install.
It should create 5 actions:
Battle
, Accept Battle
, Decline Battle
, Challenger Wins
& Attendance Register
Once imported you must then create a blank text file in a folder of your choice, this will get automatically populated with all users currently present in chat every 5 minutes.
You can reuse this same file for other actions if you wish, this file will serve as your whitelist for valid targets.
In my example I am using the file D:\testList.txt
but any file name and path can be used.
Open the Attendance Register
Action and Double-Click the Set Argument
subaction.
You will need to set the path of the text file as the value of the attendance
variable.
You will need to use double backslashes between folders
e.g d:\\somefolder\\textfile.txt
Repeat the same for the Battle
Action
Go to the Command
Tab and create the following 3 commands:
!battle
, !accept
, !decline
Attach !battle
to the Battle
Action
Attach !accept
to the Accept Battle
Action
Attach !decline
to the Decline Battle
Action
Set the !accept
and !decline
commands to Disabled
Go back to the Actions
tab and double check that the subactions for enabling the !accept and !decline commands in the Battle
Action are pointing to the correct targets
Similar for the Accept Battle
, Decline Battle
and Challenger Wins
Actions, they each have subactions to disable the same commands, ensure these are correctly linked.
Finally, go to the Settings
tab and navigate through Events
→ General
Attach the Attendance Register
Action to the Present Viewers
event. This will begin the process of populating the file you created with all the users currently in your channel. Attendance will refresh every 5 minutes
UPDATE : in testing it was found that typing user names in anything other than all lower case would cause the user protection to not find the user
To correct this, open the Battle
Action, and open the C# Code subaction.
On Line 10 delete the ; from the end of the line and add .ToLower();
Example Use
To play the game simply type in chat !battle
followed by the name of the viewer you wish to challenge.
If the viewer is still in the channel it will message them asking to type !accept
or !decline
and the game will proceed accordingly.
If the viewer has left the channel (or at least has not been detected by the most recent attendance check) the game will tell you they are not found and exit the action.
Only the named target can use the !accept
& !decline
commands, all other users will be ignored.
There is no timeout on when they accept or decline, it wil even persist across streams, but if another !battle
command is issued it will cancel the existing one and start fresh
Extending Functionality
The game is currently configured to only put a win/lose message into chat based on the outcome of the rolls, but it can easily be adapted to add a prize action to the winner.
The way I would suggest doing this is create a Prize
action and then add it to the bottom of the Battle
Action and also to the bottom of the Challenger Wins
action.
Actions called in this way have access to all the same argument variables so you can easily pull the details you need
The game can be configured to randomise its reponces for winning and losing too to maintain interest. The easiest way to do this is to create a subaction group that contains each of your response messages and setting the group to Random
.