Help with $(count)

hi, is there anyway i can get count to count how many times someone has been mentioned inside a command?

as an example (user) blames (touser) for everything wrong in the world, (touser) has been blamed for this (count) times

but the counter would count specifically how many times the user in the command, not just the command

1 Like

This isn’t possible currently with the count variable (since it only retains a global count of usage per command).

Hey @Exile!

I have a workaround, for that we’ll use the quote system API. You’ll get your TOKENS by clicking on the second link in the post, 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. To add a command containing your PRIVATE_TOKEN do it from the dashboard. Don’t use the chat as anyone could monitor it and copy the token, they could then edit your data.


Then you would have the following commands:
!blame

$(eval `$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(touser)|)`; `$(user) blames $(touser) for everything wrong in the world, $(touser) has been blamed for this`)

_blame (add this command as an alias of !blame)

$(eval q=`$(query)`; t=q.split(` `)[2]; l=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`.split(`|`); n=l.filter(t).length; `${q} ${n} times.`)

And in case you’d like to reset the counters:
!resetblame

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

This topic has an update here: A counter for an individual - #2 by Emily

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