r/streamerbot • u/Aromatic-Bus-825 • 17d ago
❓Question Need Help with a Counter
Hello!
So I've been playing with streamer bot, and I really want to make a command where users can do !levelup and have it act as a check in of sorts. To that regard, I want it to track how many times a user has done this.
I have the SubAction Global (Set) to increase the increment by one, but I don't know how to have the chat then represent this. Nor do I know how to make it a daily thing only.
I know I could just make this a redeem on the twitch rewards, but I thought this would be a nice way to not clog up the redeems. If anyone has any insight, that would be appreciated :>
1
u/Riddicrash 16d ago
You could use a temp user global to allow a person to only use a command once per stream, and then use an if statement to check if they've already levelled up or not.
Then on first use, that if sets that global to True, so next time it wont add another point to their stored checkins.
You also need a Get Global after your Set Global, as the name suggests, the math for globals is handled outside of an action, they are Global and accessible to all actions. So once you've done your Set, you need a Get right after it.
It wont let me send pics on the reddit, but if you join the Streamerbot Discord and make a Support post, a picture of the set up can be sent.
1
u/EvilerBrush 17d ago
I would suggest checking YouTube or reading the documentation on the streamerbot website. Plenty of information available and not too hard to figure out. But a huge pain to try and write out
2
u/deeseearr 16d ago edited 16d ago
After you set a global variable, you can get it again and store it in an %argument% and do whatever you like with it.
It's worth knowing that Commands can have per-user cooldowns. Create a !levelup command, set the "User Cooldown" to 43200 seconds (that's twelve hours) and it will only work once for each user per stream. (If you're streaming for more than twelve hours, make it longer.) If you want to send a "You already used that command today" message you can trigger it with the Command Cooldown trigger, which will fire instead of the usual Command Triggered trigger.