Resetting stored count variables to 0, and switching count with another user

Hello!

I’m rather confused about the CustomAPI quote system. I’ve followed this thread here in regards to getting things set up.

Here is what I have done so far, which essentially copies the thread’s code:

$(eval C=$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLICTOKEN_id=1).split(,);A=$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATETOKEN=j$(user),);x=0;for(i=0;i<C.length-1;i++){if(C[i]==$(user)){x–}};$(user) has been deemed to have fake Jordans! Their dignity is now ${x-1}.)

Id like to do something like: (user) calls x command that resets the !fakejays command count back to 0. So if, say, user BananaHead had their dignity at -19, it would now be 0.

I have no knowledge of coding, but from my limited knowledge in the past, I believe it would use a similar concept as to this thread here. Storing the count variable for a user in a separate command, The !fakejays command could decrement the count and send a message showing the count, and another command (I suppose, something like !restored) would reset that count back to 0 along with a message.

This may be more complex, so its perfectly fine if it can’t be done so simply, but I’d also like to see if there’s a way to switch counts between users.

If you’ve made it this far, thank you so much for taking the time to read.

first of all, u shouldn’t expose your private token like that, anybody that sees this thread can take it and make their own commands on their own channel to manipulate the contents…
so for the !fakejays command…

$(eval a=`$(urlfetch https://twitch.center/customapi/quote?token=PUBLIC_TOKEN&data=$(user))`.split(` `);if(a[1]==0){a[2]=1};a[0]==`0.`||a[0]==`No`||a[0]==`There`?`0 $(user) 1 add`:`${a[0].replace(`.`,``)} $(user) ${(a[2]*1)+1} edit`)

and that needs to have this second command as an alias, my personal naming convention, i would call it !fakejayspart2 (so both parts r next to each other) but many use the naming convention where u put an underscore in front of it (_!fakejays) so that it puts it at the end of the command list and discourages users from typing it as typing only the second part would error out…

$(eval a=`$(urlfetch https://twitch.center/customapi/$(4)quote?token=PRIVATE_TOKEN&data=$(query))`;x=`$(3)`*1;x&&a.includes(`Success`)?`$(2) has been deemed to have fake Jordans! Their dignity is now ${x*-1}.`:`Error, try again later`)

don’t forget to change PUBLIC_TOKEN to the 8 digit token and PRIVATE_TOKEN to the 16 digit token for an empty quote list…
and then almost the same thing for the !restored command…

$(eval a=`$(urlfetch https://twitch.center/customapi/quote?token=PUBLIC_TOKEN&data=$(user))`.split(` `);a[0]==`0.`||a[0]==`No`||a[0]==`There`?`0 $(user) 0 add`:`${a[0].replace(`.`,``)} $(user) 0 edit`)

and again either !restoredpart2 or _!restored or whatever u want needs to be the alias of that one…

$(eval a=`$(urlfetch https://twitch.center/customapi/$(4)quote?token=PRIVATE_TOKEN&data=$(query))`;x=`$(3)`*1;x&&a.includes(`Success`)?`$(2)'s dignity has been restored!`:`Error, try again later`)
1 Like

one thing i didn’t see, the switching count with another user?.. how would u like this implemented?.. like a 3rd command to condemn somebody else?, like if i wanted to give it to u i’d type…
!swap @yachi_san
or something like that?.. or maybe change the !restored command to pick another name at random to give it to?.. or what r u lookin for?

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