Creating a 4 command counter on twitch to represent amount of deaths/times something happened

So i am trying to create a counter that would count how many interesting items he has found during that session. I also didn’t want to make it so that i would have to manually input the number of items and used a counter in a form of another command.

so the commands that i’ve used so far have been:

!commands add !candycounter Less Has found 0 pieces of candy so far

and

!commands add !ca -ul=mod -a=!commands edit !candycounter Less Has found $(count) pieces of candy so far

so the problem is that i cant seem to find a way to reset the counter in the !ca command. If i just straight up edit the !candycounter command to say 0, the next time i use !ca it will remember the earlier value and just add more to that. And if i use !candycounter again after using !ca it will just show the old value with 1 added to it.
\-c=0 doesn’t really seem to do anything or i am misusing it.

Thanks

EDIT:

Ok so this is how i got it to work:

I’ll use !deaths as a place holder, you can change it to what you want (in example !itemsfound)

So create a command for checking the time something happened usable by everyone.

!commands add !deaths This streamer has died 0 times this far

then create a command only usable by mods that adds to that counter:

!commands add !deathsadd -ul=mod -a=!commands edit !deaths This streamer has died $(count) times this far

so now using !deathsadd will add a death to the counter

So now well have to create something to reset both of the commands:

To reset the counter in !deathsadd well do this (note that i made it only usable by mods):

!commands add !deathsaddreset -ul=mod -a=!commands edit !deathsadd -c=0

And we also have to create a command (only usable by mods) that resets !deaths to its original state of 0:

!commands add !deathsreset -ul=mod -a=!commands edit !deaths This streamer has died 0 times this far

DO NOTE THAT YOU WILL HAVE TO RUN BOTH !deathsreset AND !deathsaddreset FOR IT TO WORK

Also if you want to change it to count something else you’ll have to know what to change in the commands, i will probably not be helping with that since this is just an example that i’ve made (with the help of Xgerhard) to represent a way to do it. You should still ask, maybe someone will help you with that.

That should work:
!commands add !ca -a=!commands edit !candycounter \-c=0

It doesn’t work. I created the command !cr to represent candyreset and using them does this

The !ca you did before that is wrong, it made !candycounter count !ca instead of itself.

To make it count !candycounter, run this once, after that when you use !cr the counter will be set back to 0.
!commands edit !candycounter Less has found $(count) pieces of candy so far

The original idea was that i would have 3 different commands
!candycounter would be usable by everyone and would just show the amount not add to it
!ca would be used by mods and would add to the amount
!cr would be used by mods as a way to reset the counter

i guess i should change the title to be a bit more clear of what i mean.

Oh I see, then your original setup can work, you would only need to change the !cr to reset the count of !ca instead of !candycounter.
!commands edit !cr -a=!commands edit !ca \-c=0

Yea, it works kind of. It does reset the counter of !ca but it wont reset !candycounter until !ca is used again.
Is there a way to have !cr edit both commands or should i create an additional one that would edit !candycounter to its original state?

Hmm, I can’t think of a quick solution for that, it’s not possible to edit multiple commands, so an additional one might be the best solution to set it to the original state.

Ok, Thanks for all the help, i guess i’ll create a sum up of what i’ve done in case some else wants to do the same

I believe the issue your facing is which this command. The problem is that $(count) (the variable) cannot be passed on to a command. The only way it will increment is with !cr again, however this won’t reset the count that is associated with the !cr command.

For something of this nature a Custom API would be recommended as the logic behind this isn’t complicated.

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