Skip to content

This is a simple Death Counter using REST-API (nodejs) and the OBS Browser Source. The REST-API can then be triggered via Nightbot .

License

Notifications You must be signed in to change notification settings

Blackstareye/obs_browser_source_deathcounter

Repository files navigation

Death Counter for OBS Browser Source

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

Getting started

  1. 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!
  2. edit data.json file for setting the sound file (if needed)
  3. go to OBS and add a Browsersource with the url of your server
  4. if you have nightbot, insert the commands below
  5. Have fun

optional: restrict the commands for mods only if needed

Features

  • increase death count
  • decrease death count
  • reset death count
  • set death count to a specific value

Enabling Controls

Uncomment the Block (Line 52) on index.html to get Buttons like it is used on the DEMO.

Note for Glitch Users

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

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

License

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)

Contact

Blackeye - @BlackeyeM - [email protected]

Project Link: https://github.com/Blackstareye/obs_browser_source_deathcounter

Acknowledgements

Support

If you like my work and want to support me and my work, then this is the way:

Many Thanks ♥

About

This is a simple Death Counter using REST-API (nodejs) and the OBS Browser Source. The REST-API can then be triggered via Nightbot .

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published