Death counter with total deaths

I’m trying to utilise the #26337 thread for a death counter and wanted to amend it slightly so that there’s a daily death and total death counter. How would this be done? Apologies if this is already solved but couldn’t find something in the search bar.

Hey @canigetahoooyaaa!

This is pretty close to what you’re looking for:

Hi @Emily , Thank you for the above.

I’m having a few issues with adding them - feel I may be missing something. I’ve added the below commands, am I doing something wrong?

!addcom !adddeath $(eval a=$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(time gmt "WW E|"));f=$(urlfetch https://twitch.center/customapi/quote?token=PUBLIC_TOKEN&data=1&no_id=1).split( ).shift();t=$(time gmt "WW");f==t? :PRIVATE_TOKEN&data=1)

!addcom !deaths $(eval f=$(urlfetch https://twitch.center/customapi/quote?token=PUBLIC_TOKEN&data=1&no_id=1).split( ).shift();t=$(time GMT "WW");f==t? :PRIVATE_TOKEN&data=1)

!addcom !_deaths $(eval a=$(urlfetch https://twitch.center/customapi/delquote?token=$(query));q=$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1).split(|).join( );w=(q.match(/$(time GMT “WW”)/g)||[]).length;d=(q.match(/$(time GMT “WW E”)/g)||[]).length;$(twitch $(channel) "{{displayName}}") died ${d} times today and ${w} times this week.)

!addcom !dayreset -ul=mod -a=!editcom !deaths -c=0

!addcom !weekreset -ul=mod -a=!editcom _deaths -c=0

I have removed the token codes from the commands to prevent them being abused.

Hey @djborret!

Please open a new topic, don’t hijack other’s.

Your messages will be deleted by a moderator unless you delete them first.
In either case I’ll delete this message once yours are deleted.

Your biggest issue is that you haven’t properly read the instructions of the topic I linked.
I’ll take the time to hold your hand this time, but I won’t do this every time.
However, if you found something unclear, please let me know, I’ll try to update the topic to improve it.


First things first: don’t use the chat to add commands containing your PRIVATE_TOKEN as anyone monitoring the chat could then manage your list, use the dashboard instead!

Ahem…

Next, I also said you need to add the _deaths command as an alias to both !adddeath and !deaths, it’s clear how to do that when you use the dashboard; there’s a way to add aliases through the chat, but to enforce people using the dashboard to add commands containing their PRIVATE_TOKEN, I deliberately left out that bit of information.
In the same domain, I also said to set !adddeath’s userlevel to Moderator (unless you’re fine with everyone being able to add deaths to your counter), this can also be done through the chat by adding -ul=mod after the !commandName, but it’s obvious when doing it through the dashboard.

The TIMEZONE you used isn’t properly formatted, I linked to the documentation of the variable, which contains the full list of valid values, however, that link was broken with an update to the documentation, I updated the topic in that regard.

Finally, since you’re using the update, you don’t need the !---reset commands, as stated in the topic I linked: the older deaths will be automatically purged.


If you still need assistance with adding the commands through the dashboard, please let me know.

Hi @Emily , Just to confirm I would only need to add the !deaths, !adddeath and !_deaths with !_deaths being aliased on !deaths and !adddeath? If this is correct then mine isn’t adding the deaths for some reason, it just remains at 0 deaths daily and weekly regardless of how many deaths are added.

I don’t know if you’ve done anything wrong, because the commands work fine when I test them:
221202115015

So here are screenshots to help check you got everything right:

Please make extra sure to replace all the PRIVATE_TOKENS and PUBLIC_TOKENS fields properly, and to replace the TIMEZONE field with a valid value, using the timezones list.



Hi @Emily,

I think the error might be myself misunderstanding the timezone format section - would $(time Europe/London “MMMM Do YYYY, h:mm:ss a z [GMT]Z”)/g) be the correct format?

Nope, I said you only need to modify the TIMEZONE field, so only replace TIMEZONE with Europe/London, don’t change anything else, you don’t need to format how the time is displayed, I already took care of that, sorry if that wasn’t clear enough.
So you’ll get stuff like $(time Europe/London "WW E") or $(time Europe/London "WW"), etc. depending of where in the code you are.
To go faster and avoid any mistake you can use the Search and Replace function of your Notepad, search for TIMEZONE and replace them all with Europe/London.

You may need to purge your quote list, enter the following URL in your browser:

https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&clear=1

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.