Win-Loss / Death-Kill Counters in one command

Hey @zombihuntress!

One way you could do this is by using the quote system API. You’ll get your TOKENS by clicking on the second link in the post, in the Manual Installation section, use these in the commands I wrote. To know where to look for your PUBLIC_TOKEN and PRIVATE_TOKEN, look at the field bellow:

$(urlfetch https://twitch.center/customapi/quote?token=PUBLIC_TOKEN&data=$(querystring))
$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(querystring))
$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&data=$(querystring))

Keep your PRIVATE_TOKEN secret, don’t share it anywhere. Add the following commands from the dashboard. Don’t use the chat as anyone could monitor it and copy the token, they could then edit your data.


To add wins and losses to the counters:
!gw

$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=w$(count))

!gl

$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=l$(count))

Make sure !gw and !gl are for moderators and above only and to add !gulag as an alias to these commands.


For the main command:
!gulag

$(eval q=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`;w=q.match(/w\d+/g);l=q.match(/l\d+/g);w==null?w=0:w=w.pop().replace(`w`,``);l==null?l=0:l=l.pop().replace(`l`,``);`Wins: ${w} | Losses: ${l}`)

And then to reset the counters:
!gwreset

!gw -c=0

!glreset

!gl -c=0

!gulagreset

$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&clear=1)

Make sure !gwreset and !glreset have !editcom as an alias, and that !gwreset, !glreset and !gulagreset are for moderators and above only as well.

1 Like