This is a simple Death Counter using REST-API (nodejs) and the OBS Browser Source. The REST-API can then be triggered via Nightbot see Nightbot Commands
It has three parts:
- Backend (NodeJs)
- Frontend (Window that will be integrated in OBS)
- Nightbot Commands
Glitch Link: https://hip-holly-beak.glitch.me/
Project Page: https://glitch.com/~hip-holly-beak
Demo (with Controls): https://spring-chlorinated-seahorse.glitch.me
created by Blackeye / Blackstareye
- clone or remix the repo
- if you have a glitch.com account, you can remix it via this link
- clone the repo to your server. The server must run node js!
- edit data.json file for setting the sound file (if needed)
- go to OBS and add a Browsersource with the url of your server
- if you have nightbot, insert the commands below
- Have fun
optional: restrict the commands for mods only if needed
- increase death count
- decrease death count
- reset death count
- set death count to a specific value
Uncomment the Block (Line 52) on index.html to get Buttons like it is used on the DEMO.
The first nightbot command (request) can be a bit slow ! Glitch sets the container without requests on sleep mode, hence they need to wake up first.
Nightbot Commands, change '<your_domain_url>' to the url of your deathcount server
!commands add !death+ $(eval const result=$(urlfetch json '<your_domain_url>'/inc); result["msg"])
!commands add !death- $(eval const result=$(urlfetch json '<your_domain_url>'/dec); result["msg"])
!commands add !deathreset $(eval const result=$(urlfetch json '<your_domain_url>'/reset); result["msg"])
!commands add !deathset $(eval const result=$(urlfetch json '<your_domain_url>'/set?n=$(1)); result["msg"])
Command | Description |
---|---|
!death+ | increase counter |
!death- | decrease counter |
!deathreset | reset counter |
!deathset number | set death counter to number |
Distributed under the APGL-3 License. See LICENSE
for more information.
Images are licensed under the License Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)
Blackeye - @BlackeyeM - private_blackeye+deathcounter@posteo.de
Project Link: https://github.com/Blackstareye/obs_browser_source_deathcounter
If you like my work and want to support me and my work, then this is the way:
Many Thanks ♥