Need help with Wins and Kill counter

Alright, so I took the time to read the commands of #21791 as it’s the set of commands that looks to fit your needs the best, and there’s indeed an error in the !wins command where the last ` backtick is missing, but the rest works just fine!
So here’s the fix while Roketto updates his post:

!addcom !addwin -ul=mod -a=_addwin $(eval a=parseInt(decodeURIComponent(`$(querystring)`),10);`PRIVATE_TOKEN`+(a>=0?`&data=~${a}K~`:``))
!addcom _addwin -ul=mod $(eval a=`$(urlfetch https://twitch.center/customapi/addquote?token=$(query))`;b=decodeURIComponent(`$(querystring)`);b.includes(`PRIVATE_TOKEN`)?(a.includes(`Successfully added entry`)?`$(channel) won another game with ${b.split(`~`)[1].split(`K`)[0]} kills!`:`Invalid input!`):`Use !addwin`)
!addcom !wins $(eval a=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`.match(/~\d+K~/g);a?(b=a.length,c=`(`+a.map(x=>x.slice(1,x.length-1)).join(`, `)+`)`):(b=0,c=``);`$(channel) has ${b} wins ${c}`)
!addcom !resetwins -ul=mod $(eval `$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&clear=1)`.includes(`All entries have been deleted`)?`Wins have been reset.`:`Try again later...`)

If you want to remove the K altogether from the command, here’s the fix:

!addcom !addwin -ul=mod -a=_addwin $(eval a=parseInt(decodeURIComponent(`$(querystring)`),10);`PRIVATE_TOKEN`+(a>=0?`&data=~${a}~`:``))
!addcom _addwin -ul=mod $(eval a=`$(urlfetch https://twitch.center/customapi/addquote?token=$(query))`;b=decodeURIComponent(`$(querystring)`);b.includes(`PRIVATE_TOKEN`)?(a.includes(`Successfully added entry`)?`$(channel) won another game with ${b.split(`~`)[1]} kills!`:`Invalid input!`):`Use !addwin`)
!addcom !wins $(eval a=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`.match(/~\d+~/g);a?(b=a.length,c=`(`+a.map(x=>x.slice(1,x.length-1)).join(`, `)+`)`):(b=0,c=``);`$(channel) has ${b} wins ${c}`)
!addcom !resetwins -ul=mod $(eval `$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&clear=1)`.includes(`All entries have been deleted`)?`Wins have been reset.`:`Try again later...`)

The usage of the !addwin command is the following: at the end of each game, use it if you won, and specify the amount of kill you made during that game, so if I won a game with 5 kills: !addwin 5


Now, onto your commands… It seems like the error is caused by your !addmatch command, here:
&data=~${a}K~0~, the last 0~ is an issue in my opinion.


I would recommend using the commands from #21791 I updated above, with your text and without the K it would be:

!addcom !addmatch -ul=mod -a=_addmatch $(eval a=parseInt(decodeURIComponent(`$(querystring)`),10);`PRIVATE_TOKEN`+(a>=0?`&data=~${a}~`:``))
!addcom _addmatch -ul=mod $(eval a=`$(urlfetch https://twitch.center/customapi/addquote?token=$(query))`;b=decodeURIComponent(`$(querystring)`);b.includes(`PRIVATE_TOKEN`)?(a.includes(`Successfully added entry`)?`$(channel) played another match with ${b.split(`~`)[1]} points!`:`Invalid input!`):`Use !addmatch`)
!addcom !match $(eval a=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`.match(/~\d+~/g);a?(b=a.length,c=a.map(x=>x.slice(1,x.length-1)).join(`, `)):(b=0,c=``);`$(channel) has played ${b} matches, points: ${c}`)
!addcom !resetmatch -ul=mod $(eval `$(urlfetch https://twitch.center/customapi/delquote?token=PRIVATE_TOKEN&clear=1)`.includes(`All entries have been deleted`)?`Matches have been reset.`:`Try again later...`)
2 Likes