Count with uptime help

Hello. Is there a way to make a command using the count and uptime command together?
I was thinking of doing something like this when someone types !burp for example: “$(channel) has burped $(count) times since [uptime]”.
I don’t want to make a counter that always increases, I’d like one that resets every stream, that’s the reason for the uptime. Thanks in advance.

Hey @hernaski_tw!

The $(count) variable can’t be automatically reset, you have to reset it manually for every stream, sorry. However, you can do it with a command, here’s how to add a !burpreset command that you’ll have to run at the beginning or end of each stream:

!addcom !burpreset -ul=mod -a=!editcom !burp \-c=0
1 Like

Aw, that’s a pity. But thank you for the workaround, I’ll be using it.

1 Like

Actually what your asking is most likely possible with the use of a timer and the custom Quote API and a little bit of know how I’ll see if I can work something out for you later today. <3


Ok so this system of 4 commands should do everything you want it to.

First off generate your tokens here

Tokens come after “token=” and before “&data”
The 8 digit one is you public token and the 16 digit one is your private token

Next you can add the next two cammands through the dashboard one due to length the other is a timer.

Command One: !addburp

$(urlfetch $(eval a="$(1)";if(a=="null"){CountAdd=1}else{CountAdd=parseInt(a)};Time="$(twitch CHANNEL "{{uptimeLength}}")";Data="$(urlfetch json".split(",");$(urlfetch json;","+CountTotal+"%20"+Timer))

Set userlevel to moderator I would suggest
Set no alias

IMPORTANT: replace CHANNEL with your channel name not $(channel) as nightbot only allows 3 layers of nesting

Note: you can add custom amounts just try to make sure it’s a number or if you leave it blank it’s automatically 1

Command Two: Name doesn’t matter this is a timer

$(urlfetch $(eval a="$(urlfetch json".split(",");Time="$(twitch CHANNEL "{{uptimeLength}}")";$(urlfetch json;","+Counter+"%20"+Timer))

Set alias to _burp
Set interval to 5 minutes and 2 lines of chat

IMPORTANT: once again replace CHANNEL with your channel name and not $(channel)

Command Three: _burp

$(eval a=" ";a)

Set userlevel to moderator
Set no alias

Note: this just makes it so nightbot doesn’t spam your chat.

Command Four: !burp

$(channel) has burped $(eval a="$(urlfetch json".split(",");b=a[a.length-1].split(" ");b[0]) times this stream.

Leave userlevel everyone
Set no alias

Note: Everyting outside of the $(eval) is completely free to change.

FinalNotes:Everything should work for you properly but if you get any issues please contact me

Hope this is what you wanted it aims to tell if you ended the stream and resets the counter if it recognizes that it has. There may be potential for a few glitches but they would happen very infrequently if at all.


The places you wrote “PUBLIC_TOKEN” or “PRIVATE_TOKEN” need to be replaced with the token generated or I just leave it as it is and only replace the Channel part?

Yes PUBLIC_TOKEN and PRIVATE_TOKEN need replaced with the 8 and 16 digit token respectively.

Sorry if I didn’t make it clear

1 Like

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