Subathon Timer in C#
Description
Using this extension you can now run Subathons on your stream easily.
Import Code
subathonCountdownTimer.sb (15.7 KB)
Steps after import
1. In OBS:
Create a scene called [NS] SubathonTimer
(NS is short for nested scene) with a text source called [TS] SubathonCounter
(TS is short for text source). Add this nested scene into any other scenes you need.
2. Streamer Bot.
Actions > Subathon Timer Code
> Double-click Execute Code (Subathon Timer)
> Click the References
tab > Click Find Refs
and make sure System.dll is added to the list.
- NOTE: In more recent versions of Streamer Bot, this step may be unnecessary.
Click the Compiling Log tab, click Compile to make sure the code compiles correctly, and then click Save and Compile
3. Depending on which Platform you’re streaming to, you will need to link events to certain actions.
For Twitch (under Platforms > Twitch > Events
):
Cheers
should point toSubathon Add Timer Cheers
or as a Run Action within another action.Sub
should point toSubathon Add Timer Twitch Sub
or as a Run Action within another action.Re-Sub
should point toSubathon Add Timer Twitch Sub
or as a Run Action within another action.Gift Sub
should point toSubathon Add Timer Twitch Sub
or as a Run Action within another action.Gift Bomb
should point toSubathon Add Timer Twitch Sub
or as a Run Action within another action.
For YouTube (under Platforms > YouTube > Super Events
):
Super Chat Event
andSuper Sticker Event
should point toSubathon Add Timer YouTube Super
or as a Run Action within another action.
Other integrations under the Integrations
tab can point to their relevent Subathon Add Timer
Action.
- Note: Kofi can be found under the
Integrations > Streamer.bot Website
tab.
4. Configure action Subathon Configuration and Start !startsubathon
- You can edit the initial length of the subathon in hours
- You can edit the max limit lengh of the subathon in hours
- You can edit the
secondsLeftBackupDirectory
variable to point the directory where you have three text files:subathonSecondsLeft.txt
,subathonTotalTimeInSeconds.txt
, andsubathonElapsedSeconds.txt
. These files keep a backup of your time remaining so you can use!subathonresume
if either Streamer Bot crashes or you decide to pause your subathon with!subathonpause
- Set your OBS connection that corresponds with the assignment in the Stream Apps tab. (Note that the first OBS connection is 0)
- If you want to change the names of the scene and text source in OBS, make sure it matches here too.
5. You can configure how many minutes get added for each sub tier event.
Subathon Twitch Sub Tier 1 Config Minutes
Subathon Twitch Sub Tier 2 Config Minutes
Subathon Twitch Sub Tier 3 Config Minutes
For money related events:
- Editing
moneyDivide
controls the minimum denomination you want to add time. - Editing
secondsMultiplier
controls how much time gets added to the countdown for eachmoneyDivide
is given. - Example: if
moneyDivide
is 2.50 andsecondsMultiplier
is 60. If someone gives $5.00, then 2 minutes (120 seconds) gets added to the countdown. $6 will also add 2 minutes. $7.50 would add 3 minutes. - NOTE: For calculating time: it is rounded down to the nearest
moneyDivide
.
6. Subathon Chat Commands
- NOTE: Imported commands are disabled by default as a security measure. Please make sure to enable them.
!subathonstart
to start the subathon timer. You need to enter it twice to confirm overwriting an existing subathon!subathoncancel
to cancel the timer. This also erases the contents ofsubathonSecondsLeft.txt
You need to enter it twice to confirm cancelling the timer!subathonpause
to pause the timer!subathonresume
to resume the timer. You can resume even if you’ve restarted Streamer Bot. This is done by reading the contents ofsubathonSecondsLeft.txt
,subathonTotalTimeInSeconds.txt
, andsubathonElapsedSeconds.txt
!subathonadd #
to add that # of minutes to the timer. This is a manual way of adding minutes to the countdown!subathonelapsed
to get a chat message showing how long the subathon has been going