How to reset $(count) variable with command

I’ve set up a command in my friend’s twitch channel with a $(count) variable, and we can’t get it to reset with commands.
I tried adding a command to reset it with
!commands add -a=!commands edit !resetabandons \-c=0
but this doesn’t work. I’ve seen several other threads here that all say this exact thing, but it never works. It just keeps counting from where it was. What am I doing wrong here?

In case it was how I made the commands, I ran these
!commands add !abandons 0
!commands add !abandoned -a=!commands -ul=mod edit !abandons "$(channel) has abandoned us $(count) times!"
!commands add !resetabandons -a=!commands -ul=mod edit !abandons \-c=0
I also tried
!commands edit !resetabandons -a=!commands -ul=mod edit !abandons \-count=0
just in case, but no luck. Thank you!

P.S. If this isn’t enough info, please let me know so I can ask a better question :slight_smile:

@Forstrei You’re trying to use !resetabandons to set the counter value in !abandons to 0. The problem is !abandons doesn’t truly have a stored counter value (the $(count) variable). It’s a simple text response that’s being edited by !abandoned which itself DOES have a stored counter value. So you should change !resetabandons like so:

!commands add !resetabandons -a=!commands edit !abandoned \-c=-1

When you want to set the number in !abandons to 0 you first type !resetabandons then type !abandoned

What this does is: !resetabandons will set the counter value in !abandoned to -1. !abandoned will then increment its counter value (from -1 to 0) before editing !abandons

1 Like

Thank you! And double thanks for the explanation. That made a lot of sense, but never would have occurred to me.

1 Like

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