Hey @Lewo!
If you want a really simple command for this, you could use the following and call it for every new sub and at the end of the stream when the streamer is about to do their push-ups (it’ll give them 2 more push-ups than what they’d normally have to do, but 2 more never hurts, haha):
!addcom !newsub -ul=mod $(eval `$(channel) has to do ${$(count)*2} push-ups`)
And this command is for resetting the !newsub
command at the beginning of every stream, or once the push-ups have been done:
!addcom !resetpushups -ul=mod -a=!editcom !newsub \-c=0
While I think it’s the simplest method, but also the best one for that application, there is another solution…
I really advise against this solution.
The other 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, 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’d have to run this command at the beginning of the stream, it’ll store the number of subs at the start of the stream to a quote:
• !resetpushups
$(eval r=`$(urlfetch https://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=$(twitch $(channel) "{{subscriberCount}}"))`; `Number of push-ups reset.`)
Make sure !resetpushups
is for moderators and above only.
And then run this command at the end of the stream, it’ll compare the number of subs at the start and at the end of the stream and compute how many push-ups the streamer has to do:
• !pushups
$(eval start=`$(urlfetch https://twitch.center/customapi/quote?token=PUBLIC_TOKEN&data=-1)`; end=`$(twitch $(channel) "{{subscriberCount}}")`; `$(channel) has to do ${(end-start)*2} push-ups.`
The big issue with this solution is that it won’t count renewals as it’s not really a new sub, and if someone’s sub is running out during the stream it’ll be counted as a negative.