Wins and Kills comand separate

Anyone you know how to develop commands? I’m trying to create something similar to the wins command, but only to add separate kills and wins, to make a total, one command for each example

!addcom !kills oGold ja killed 4500 players
!addcom !wins Gold has won 233 matches

So i want to creat a command that add a number of kill and wins to that,

!addcom !addkill 5
!kills command edited now !kills oGold ja killed 4505 players

thx!

@ogold

This is possible using ehsankia’s quote list API.

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!

I’ve set up 7 commands below: !kills which shows your number of kills, !wins which shows your number of wins, !addkill and !addkillp2 which takes a number input and adds that to the kill counter (both are mod-only), !addwin and !addwinp2 which takes a number input and adds that to the win counter (both are mod-only), and !reset which clears both counters (mod-only). 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 -cd=5 !kills $(eval a=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`.match(/k/g);b=a!=null?a.length:0;`$(channel) has killed `+b+` players!`)
!addcom -cd=5 !wins $(eval a=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`.match(/w/g);b=a!=null?a.length:0;`$(channel) has won `+b+` matches!`)
!addcom -ul=mod !addkill -a=!addkillp2 $(eval a=parseInt(decodeURIComponent(`$(querystring)`));Number.isInteger(a)&&a>0?`PRIVATE_TOKEN&data=`+`k`.repeat(a):` `)
!addcom -ul=mod !addkillp2 $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=$(query))`;`$(query)`.includes(`PRIVATE_TOKEN`)?`$(channel) just killed `+eval(`$(query)`.length-22)+` more players!`:`Enter a number greater than 0!`)
!addcom -ul=mod !addwin -a=!addwinp2 $(eval a=parseInt(decodeURIComponent(`$(querystring)`));Number.isInteger(a)&&a>0?`PRIVATE_TOKEN&data=`+`w`.repeat(a):` `)
!addcom -ul=mod !addwinp2 $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=$(query))`;`$(query)`.includes(`PRIVATE_TOKEN`)?`$(channel) just won `+eval(`$(query)`.length-22)+` more matches!`:`Enter a number greater than 0!`)
!addcom -ul=mod !reset $(eval a=`$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&clear=1)`;`$(user) has reset the kill and win counter!`)

u are A god! thx so much

1 Like

the commands are still associated, I wanted to try to make these 2 commands completely free from each other, with separate reset also

to add separate total kills and wins

Then you can generate a new set of tokens. I’ll call the tokens in the first set publicToken1 and privateToken2, and the other set publicToken2 privateToken2. Same commands as above, except kills-related commands use one set of tokens and wins-related commands use the other, and there is now !resetkills and !resetwins. Replace publicToken1/privateToken2/publicToken1/privateToken1 with their corresponding tokens.

!addcom -cd=5 !kills $(eval a=`$(urlfetch json https://twitch.center/customapi/quote/list?token=publicToken1)`.match(/k/g);b=a!=null?a.length:0;`$(channel) has killed `+b+` players!`)
!addcom -cd=5 !wins $(eval a=`$(urlfetch json https://twitch.center/customapi/quote/list?token=publicToken2)`.match(/w/g);b=a!=null?a.length:0;`$(channel) has won `+b+` matches!`)
!addcom -ul=mod !addkill -a=!addkillp2 $(eval a=parseInt(decodeURIComponent(`$(querystring)`));Number.isInteger(a)&&a>0?`privateToken1&data=`+`k`.repeat(a):` `)
!addcom -ul=mod !addkillp2 $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=$(query))`;`$(query)`.includes(`privateToken1`)?`$(channel) just killed `+eval(`$(query)`.length-22)+` more players!`:`Enter a number greater than 0!`)
!addcom -ul=mod !addwin -a=!addwinp2 $(eval a=parseInt(decodeURIComponent(`$(querystring)`));Number.isInteger(a)&&a>0?`privateToken2&data=`+`w`.repeat(a):` `)
!addcom -ul=mod !addwinp2 $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=$(query))`;`$(query)`.includes(`privateToken2)?`$(channel) just won `+eval(`$(query)`.length-22)+` more matches!`:`Enter a number greater than 0!`)
!addcom -ul=mod !resetkills $(eval a=`$(urlfetch https://twitch.center/customapi/delquote?token=privateToken1&clear=1)`;`$(user) has reset the kill counter!`)
!addcom -ul=mod !resetkills $(eval a=`$(urlfetch https://twitch.center/customapi/delquote?token=privateToken2&clear=1)`;`$(user) has reset the win counter!`)

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