Gulag Counter Command

Hello, My friend is using nightbot for some simple commands. !gulagw which counts up the amount of times he won the gulag. Also !gulagl which counts up the amount of times he lost the gulag. I am looking to make a command !gulag which shows both the counters and am not quite sure how to make it thanks!

This is possible using the following 3 commands all credit goes to @RokettoJanpu for the commands and @ehsankia for the API:

This is possible using ehsankia’s quote custom API - read more about it here .

Click this link . It will generate three links and two tokens, a public token (8 characters long) and a private token (16 characters long). The public token is located within the first generated link. The private token is located within both the second and third generated links. The tokens are found after token= and before &data=$(querystring) Copy them and keep them somewhere safe !

!addwin which adds a win to the running score (mod-only)
!addkill which adds a kill to the running score (mod-only)
!score which displays the numbers of wins and kills

Either copy and paste these commands into chat or add them through the Nightbot dashboard . Add the commands through chat only if you are sure no one else is there, otherwise they might see your private token (which is used to edit the list)! Replace PUBLIC_TOKEN with your public token and PRIVATE_TOKEN with your private token.

!addcom -ul=mod !gulagw $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=win)`;` `) $(channel) just won a gulag!
!addcom -ul=mod !gulagl $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=loss)`;` `) $(channel) just lost a gulag!
!addcom -cd=5 !gulag $(eval a=`$(urlfetch json http://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`;w=a.match(/win/g)!=null?a.match(/win/g).length:0;k=a.match(/loss/g)!=null?a.match(/loss/g).length:0;`$(channel) has ${w} wins and ${k} loss.`)

Feel free to change the responses of !gulagw and !gulagl just as long as the $(eval) variables remain untouched!

Thank you so much! When i type !gulagw it isnt counting my score up is that apart of the command or no?

Assuming all the tokens are correct when you type !gulagw it should add a win to the quote list. (It should be going up) , but if you mean what I think you mean the only command actually counting the totals is the !gulag command

Sorry, Im a bit confused where i put the tokens into the commands.

Nvm i found it thank you

1 Like

Is there a way to reset the counters?

Yes but it resets them both:

!addcom -ul=mod !gulagreset $(eval a=`$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&clear=1)`;` `) $(user) has cleared the score!

I would even suggest making the userlevel owner as to avoid any accidents. As it is set to mod just change the mod after -ul= to owner if you want to change it.

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