A very simple OBS script which lets you use hotkeys to increment/decrement a counter stored in a file.
- Save counter in a file so that it persists between sessions
- Increment and Decrement the counter
- Bind Hotkeys to Increment/Decrement
- Increment and Decrement only function when the text source is active
- HotKey Descriptor so you know which hotkeys are for which script
- Create a text source (Just put in a place holder text for now)
- Load up the p_counter.lua script
- Enter a HotKey Descriptor, the previously created Text Source, and a filepath
- Make sure to click the script "reload" button to save your settings
- Modify your text source to read from the given file
- Add your hotkeys to the increment/decrement buttons
With the way OBS implements scripts, you won't be able to import this script multiple times to use multiple counters. To get around this, you can copy the p_counter.lua
file multiple times with different names and import each one into OBS. This will allow you to have multiple persistent counters.
- Copy the file and make sure it has different file names
- Load up the various lua scripts that you have copied, and set up their settings
- Add your hotkeys (note the hotkey descriptors being useful here)
- Now you have multiple counters. You can even set the inc/dec hotkeys to be the same for multiple counters. Only the counters that are active will be incremented or decremented.
Unfortunately, this means that if this script if ever updated, you will need to re copy/paste the new version to all the copies you previously made before.
Open Broadcaster Service: https://obsproject.com/
This code is provided under an MIT License.