There currently isn’t a way to get the value of a $(count) variable. There exists a workaround although it will take some work on your end to set up. This workaround uses ehsankia’s quote list custom API - read more about it here.
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!
We can use this custom API to create a special ‘count variable’. I assume what you want is two commands: A command that displays the current counter value and a command that increments the value. In my setup the former command is !count and the latter is !addcount. Either copy and paste these new 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 !count The counter value is currently $(eval `$(urlfetch http://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`.split(`.`).length-1)
!addcom -cd=5 !addcount $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=e)`;` `) $(user) has increased the counter value by 1!
Feel free to change the command responses just as long as the $(eval) variables remain untouched.