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.
Count with uptime help
7 replies
Hey @Modest Beaver!
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
Ok so this system of 4 commands should do everything you want it to.
First off generate your tokens here https://twitch.center/customapi/quote/generate
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 https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)".split(",");$(urlfetch json https://pastebin.com/raw/8PhFmwtP);"https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=,"+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 https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)".split(",");Time="$(twitch CHANNEL "{{uptimeLength}}")";$(urlfetch json https://pastebin.com/raw/qp33uCAK);"https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=,"+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 https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)".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.
Didn't find your answer? The community is on Discord.
Ask on Discord