Spinning Prize Wheel Update

Description

This is an updated version of Lyfesaver74’s Spinning Prize Wheel. Changelogs can be found at the bottom.

The spinning wheel can be used for all sorts of things to choose costumes, games, people, prizes… literally anything! This import includes an easy method to import into OBS, and most configuration can be done by editing the URL parameters. The wheel can be populated either by an included text file or by utilizing Streamer.bot’s User Groups system, meaning this works multi-platform over Twitch, YouTube, and Kick.

The core of the extension is also a prime example of HTML/CSS/JS using:

  • Bi-directional WebSocket communication, including variables
  • URL parameters for variables
  • Read from local file
  • User Group management in Streamer.bot

Video Example

This video is from the original Spinning Prize Wheel for demonstration purposes, and does not reflect the current version.

Prerequisites

Import Code & Resources (Download)

spinningPrizeWheel-2.0.5.zip (85.2 KB)

Installation

  1. Download the file spinningPrizeWheel.zip and extract the folder spinningPrizeWheel
  2. Open File Explorer and navigate to where you extracted spinningPrizeWheel
  3. In Streamer.bot, click the Import button in the top menu
  4. Drag the .sb file found in the folder spinningPrizeWheel into the Import String field.
  5. Click Import

Updating

If you have already installed this extension, you can update by simply downloading the new zip under Resources back toward the top of this page and then overwriting the old files with the new by unzipping on top of them. Re-import the .sb file following the steps above

Configuration

Enable Streamer.bot WebSocket Server

In Streamer.bot, ensure the the WebSocket Server is running and and enable “Auto Start”. If you have changed the address port

Streamer.bot Configuration

Configuration is done by editing the action Spinning Prize Wheel 1. Settings

Variable Name Description Default Value
Variables for OBS Config - Easy Mode — —
wsHost Streamer.bot WebSocket Server host address 127.0.0.1
wsPort Streamer.bot WebSocket Server port 8080
wsEndpoint Streamer.bot WebSocket Server endpoint /
img Provide a URL to an image to add that image to the center of the wheel ./logo.png
User Group Names Create the following User Groups in Streamer.bot > Settings > Groups —
entriesGroupName User group name for entering users to be on the wheel Prize Wheel Entries
winningGroupName User group name for users that are selected by the wheel Prize Wheel Winner
Send Message to Chat — —
sendAsBot This determines if messages sent will be sent from the connected bot account True
sendFallback If bot fails to send message, send message as Broadcaster instead True
sendAllPlatforms True - Send messages to all platforms listed in %platforms%
False - only send messages to to origin platform
True
platforms Comma-separated list of which platforms to send chat messages to
Choices: twitch youtube kick
twitch
OBS Settings — —
obsConnection OBS Connection ID to connect to. Connection ID list is zero-indexed 0
spinningWheelSceneName Name of nested scene to add wheel to [NS] Spinning Prize Wheel
spinningWheelSpinnerSourceName Name of browser source for the wheel spinner to use Wheel Spinner
spinningWheelWinnerSourceName Name of browser source for announcing the wheel winner Wheel Winner

OBS Configuration - Easy Mode (recommended)

Easy install is done by configuring the action 2. OBS Import, then running the action ‘Spinning Prize Wheel 2. OBS Import’. It will ask you to point where the spinner index.html file is located, and then it will automatically import a scene using the OBS plugin Source Copy.

  1. Ensure you have the latest version of the OBS Plugin Source Copy installed (currently 0.3.0 as of this writing)
    • Restart OBS if needed
  2. Configure settings in the action Prize Wheel 1. Settings, variables are explained in the table above

    You only need to edit wsHost/wsPort/wsEndpoint if your Streamer.bot WebSocket Server settings are not the default values

  3. Ensure your OBS is connected in Streamer.bot > Stream Apps
  4. Go to the trigger Prize Wheel 2. Import, right-click the Core > Test, and click Test Trigger
  5. A dialog will open up and you will need to navigate to where you extracted the spinningWheelFolder, select the index.html file, and select Open
  6. A new scene will automatically be imported opened in OBS.

Example GIF

If a scene is created, but no sources are created, then run the action Prize Wheel 2. Import a second time.

OBS Configuration - Hard Mode - Manual Installation

Expand for manual instructions
  1. Populate Global Variables with default values
    a. Select the action Spinning Prize Wheel [Code]
    b. Under triggers, right-click the trigger Core - Test
    c. Click Test Trigger
  2. Copy the spinningPrizeWheel directory path
    a. Open File Explorer and navigate to where you extracted spinningPrizeWheel
    b. Click in the address bar and select the whole path
    c. Copy the directory path to your clipboard
  3. Set directory path to global variable
    a. In Streamer.bot, open the Global Variables window

    b. Edit the global variable spinningWheelFolderPath by double-clicking it
    c. Paste the directory path into the value
    d. Click OK
  4. In OBS, create a new scene and name it [NS] Spinning Prize Wheel
  5. Copy the file URL for the Wheel Spinner file
    a. Open File Explorer and navigate to your folder spinningPrizeWheel
    b. Open index.html in your web browser
    c. Select the whole address, including the starting from the "file:///.." to the ending "../index.html"
    d. Copy the URL to your clipboard
  6. In OBS and in the scene [NS] Spinning Prize Wheel, add a browser source, name it Wheel Spinner
    a. Ensure Local file is disabled
    b. Paste the URL you copied in step 3
    c. Set size to be 1920 x 1080
    d. Ensure Control audio via OBS is enabled
    e. (optional) Enable Use custom frame rate and set it to 60
    f. Tick both Shutdown source when not visible & Refresh browser when scene becomes active
    g. Click OK
  7. In OBS and in the scene [NS] Spinning Prize Wheel, add a browser source, name it Wheel Winner
    a. Ensure Local file is disabled
    b. Set the URL to about:blank
    c. Set size to be 1920 x 1080
    d. (optional) Enable Use custom frame rate and set it to 60
    e. Tick both “Shutdown source when not visible” & “Refresh browser when scene becomes active”
  8. Copy the file URL for the Wheel Winner file
    a. Open File Explorer and navigate to your folder spinningPrizeWheel > Wheel Winner
    b. Open index.html in your web browser
    c. Select the whole address, including the starting from the "file:///.." to the ending "../index.html"
    d. Copy the URL to your clipboard
  9. Add a global variable for the Wheel Winner URL
    a. In Streamer.bot, open the Global Variables window

    b. Right-click and Add Variable
    b. Variable: spinningWheelWinnerUrl
    c. Value: paste the wheel winner URL you copied in step 6
    d. Add ?name= to the end of the value
    e. Click OK
  10. Feel free to adjust the transform sizes of the sources in the scene [NS] Spinning Prize Wheel
  11. Continue on to Usage

If using a different name for the OBS Spinning Prize Wheel scene, Wheel Spinner or Wheel Winner source names, ensure they match in the action Spinning Prize Wheel 1. Settings

Advanced Configuration

Advanced configuration can be done by editing the script.js file in your spinningPrizeWheel folder using any text editor (VS Code, Notepad++, Notepad, etc).

  • You can change the colors for each section if you want by changing the HSL values (Google if you need to find the HSL of your colors) by editing the values on (or around) lines 65-72 of script.js file.

Changes made to script.js will not be officially supported.

Usage

You can have up to about 90 entries on the wheel before the wheel starts to visually glitch from having too many entries.

Technical Overview

  1. Triggering the wheel spin will show the spinner in OBS
  2. Once loaded, the wheel will connect to Streamer.bot via WebSocket server to retrieve the entry data (either from the text file or from the user group)
  3. Once entry is loaded, the wheel will begin spinning
  4. Once stopped, the winner data is sent back to Streamer.bot via WebSocket

In order to display the winner in OBS, the Wheel Winner browser source uses a URL parameter called name in order to dynamically display text. The sub-action Set Browser Source URL is used to update that URL parameter.

  1. Wheel Winner overlay is shown
    a. Variable %winner% is sent over WebSocket from the Spinner to Streamer.bot. Example: kermitthepoggies
    b. Chat message announces %winner%
    c. Global variable ~spinningWheelWinnerUrl~ is retrieved. Example: file:///D:/stream/spinningPrizeWheel/Wheel Winner/index.html?name=
    d. Wheel Winner browser source URL is updated with updated URL: ~spinningWheelWinnerUrl~%winner%. Example: file:///D:/stream/spinningPrizeWheel/Wheel Winner/index.html?name=kermitthepoggies
    e. Show OBS source for Wheel Winner
    f. Overlay appears with confetti and kermitthepoggies displayed
  2. Wheel Spinner and Wheel Winner sources are hidden after a delay
  3. (optional) If spinning a user group, the winning user is added to the user group for entry winner and will receive special permission to run the chat command !claim
  4. (optional) The user who runs !claim gets their user info added to the winners.csv, which can be referred to later and opened in spreadsheet software

Custom Entry Spin

These types of spins use the file names.txt to fill the wheel slices. You can manually edit the file names.txt and add one entry per line, or use the following actions to be able to adjust the text file via action/chat command

Action Name Command Name Description
0. Spin (Custom) !spinCustom
!customSpin
!spinw
!wspin
This action will make the wheel visible, which will in turn start the wheel.
Custom Entries Add !entryTextAdd
!addTextEntry
!addCustom
!customAdd
- This will take %rawInput% and add it to the file names.txt. You can use triggers Command Triggered or Reward Redemption
- You have the option of enabling duplicate entries, which will create another slice of the same entry text.
Custom Entries Remove !entryTextRemove
!removeTextEntry
!removeCustom
!customRemove
This will take %rawInput% and attempt to remove it from the file names.txt
Custom Entries Clear !clearTextFile
!clearCustom
This will clear the entire file names.txt

User Entry Spin

These types of spins require viewers from the platforms twitch, youtube, or kick to type a chat command !enter in order to be added to a user group, which then will populate the wheel slices. Each platform is accounted for when the user types the command.

Action Name Command Name Description
0. Spin (User Group) !userSpin
!spinuser
!uSpin
!spinU
This action will make the wheel visible, then the wheel will retrieve the list of users in the user group
Clear Entries !clearUserEntries
!clearUser
Moderators only - Clear all users from the User Group %entriesGroupName%
Clear Winners !clearUserWinners Moderators only - Clear all users from the User Group %winningGroupName%
Command Add User to Group !enter The user who runs this command will be entered into the User Group to be part of the spin
Command Remove User from Group !unEnter
!removeEntry
The user who runs this command will be removed from the User Group
User Entries Close !closeEntries
!entriesClose
Moderators only - This will disable the commands to enter or remove entry from the User Group
User Entries Open !openEntries
!entriesOpen
Moderators only - This will enable the commands to enter or remove entry from the User Group
Winner Announce This action is automatically triggered if the wheel spin was for a user group and will add the user selected by the wheel to the User Group %winningGroupName% and send a message to the chat informing the winner to run the claim command
Winner Claim !claim Winners can confirm and claim their prize. Their user information will be added to winners.csv to be reviewed by the broadcaster at a later time

Changelog

2026-09-28 v2.0.5

New

  • Added Kick Support

Update

  • Exported for Streamer.bot v1.0.7
  • Updated Streamer.bot Client to 2.0.1

Bug Fix

  • Removed Trovo (RIP) for Streamer.bot v1.0.5+

2025-08-01 v2.0.4

New

  • Added a Set Argument sub-action in the action ‘Spinning Prize Wheel Add Custom Entry’ to allow adding duplicates into the text file, this setting is disabled by default

Update

  • Updated script.js to allow duplicate entries on the wheel

2025-07-31 2.0.3

Update

  • WebSocket Broadcast includes ‘extensionName’ with contents ‘spinningPrizeWheel’ and updated script.js
  • Packaged logo.png for full offline functionality
  • Packaged streamer-bot for [email protected] for full offline functionality

2025-05-15 v2.0.2

Update

  • Fixed import code including unrelated actions

Initial Changes

New

Update

Contributors

Lyfesaver74

Whipstickgostop

Rondhi

This extension was developed from a Codepen by Ryan Mulligan

Hello @rondhi @Lyfesaver!

Love the concept here, and the smooth implementation via imports and clean documentation has been incredible, thank you.

I can’t; however, seem to get it working. No matter what I try, it won’t read from the names.txt file and as such I cannot ever see anything on the wheel outside the ticker and the center image. I’ve tried manually editing the names.txt file, using the chat commands (which all work seamlessly), editing the script file, but it simply refuses to read.

Is there any way I could get some help troubleshooting here?

Could you open a support post on either the Streamer.bot discord or the Extension discord? Provide a screenshot of where you have the folder extracted to. Also make sure you followed the directions. Make sure that your websocket server is started.

Love this thing but appears to have stopped functioning as of SB 1.0.5+ update :frowning:

Just a quick update. A recent change to streamer.bot removed support for Trovo, which means that any parts of the Spinning Prize Wheel code which try to detect the current platform are now broken. The wheel still works, but you’ll need to go into the “Spinning Prize Wheel 0. Code”, find the three switch statements which look at the current platform and either remove or comment out the cases which refer to “Platform.Trovo” or “EventSource.Trovo”.