Hey Guys, I wanted to make a command, that counts the missed cannons in League of Legends, I mean, it’s a single command, with a counter, so a person writes !cannon, and it writes that xy missed $(count) cannon minions, and then, my idea was to, add a feature to this command which is it only counts if the game is League of Legends, so I coded it etc.
$(twitch $(channel) game)!==
League of Legends):
$(channel) is not playing League of Legends, please don't use this command meaninglessly.;
$(channel) already missed $(count) cannon minions smileW;
Yea, it seems to be working, but its not, the problem is, when the streamer plays, sg. else, the nightbot message is the line what it should be, but it adds 1 more to the counter, so basicly it counts with every command use.
The reason why the code is a bit complicated, is that, first I tried to use if statements, it just did the same, so I decided to change the whole thing to switch, and when the expression was “$(twitch $(channel) game)”, not “true”, it just did the same thing, so this was my last try I’m out of ideas.
I also tried to use the counter mentioned here: https://community.nightdev.com/t/adding-a-command-that-adds-the-amount-specified-to-a-counter/22913 (with a few modifications ofc)
but it just did the same thing.
My final thought was to use sg. like mentioned here (but ofc with a little modification like -c=c-1): https://community.nightdev.com/t/is-there-a-count-reset/8985
But I dont actually no how to define this inside $(eval) nor that it would work or it would just lower the $(count)'s value with every use, like the $(count) works…
So guys my question is that, can somebody give me a freakin’ awesome solution for my porblem?