Skip to content

Instantly share code, notes, and snippets.

@flolanger
Last active February 22, 2023 17:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flolanger/fd2b8c266c37c57773932de413eef43f to your computer and use it in GitHub Desktop.
Save flolanger/fd2b8c266c37c57773932de413eef43f to your computer and use it in GitHub Desktop.
StreamDeck: Win / Loss counters for your stream (Windows, OBS / Streamlabs OBS)

StreamDeck: Win / Loss counters for your stream (Windows, OBS / Streamlabs OBS)

I created 3 simple scripts, which you can execute with your StreamDeck to increase or reset your win / loss counters while you are streaming.

Installation

Create the following batch files on your Windows-PC and paste in the code snippets:

reset_script.bat

@echo off
echo 0 > %cd%\wins.txt
echo 0 > %cd%\losses.txt

wins_script.bat

@echo off
set file=%cd%/wins.txt
if not exist %file% (exit)

for /f "tokens=*" %%A in (%file%) do (set counter=%%A)
set /A COUNTER=%COUNTER%+1
echo %Counter% > %file%

loss_script.bat

@echo off
set file=%cd%\losses.txt
if not exist %file% (exit)

for /f "tokens=*" %%A in (%file%) do (set counter=%%A)
set /A COUNTER=%COUNTER%+1
echo %Counter% > %file%

Initialization

Run reset_script.bat to create wins.txt and loss.txt

Use these scripts on your StreamDeck

  • Create a new "open" button in your StreamDeck software (System -> Open)
  • Highlight the button and select your script file
  • Repeat these steps for all 3 scripts (win, loss, reset)

Add counters to your stream (OBS / Streamlabs OBS)

  • Add a new text source in your scene and choose "Read from file" in properties
  • Select the wins.txt for your win counter and loss.txt for your loss counter (loss counter needs to be a new text source)

Enjoy

You should now be able to press your win / loss / reset buttons on your StreamDeck to control your counters in OBS / Streamlabs OBS!

@hamoon64
Copy link

You should now be able to press your win / loss / reset buttons on your StreamDeck to control your counters in OBS / Streamlabs OBS!

SORRY WHAY BUTTON DO YOU MEAN? i can change txt files but i need buttons whre r them?

@snokefn
Copy link

snokefn commented Dec 14, 2021

Im so confused

@HeckoX
Copy link

HeckoX commented May 16, 2022

You should now be able to press your win / loss / reset buttons on your StreamDeck to control your counters in OBS / Streamlabs OBS!

SORRY WHAY BUTTON DO YOU MEAN? i can change txt files but i need buttons whre r them?

A StreamDeck is a physical device with buttons on it. You key the buttons on your streamdeck to run the .bat file, which increases the respective counter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment