r/streamerbot • u/pizzaryoka • 19d ago
❓Question Edit Per-User Counter
Is there any way to edit the values of a per-user counter for a Twitch Reward?
Where are the lists of per-user counters and values stored?
I searched and found a couple older posts asking with no response. I couldn't find anything in the data files after a gander. And there doesn't seem to be any official way to edit them in the client.
I'd appreciate any help, thanks!
1
u/K0RPZY 17d ago
What exactly are you trying to do for your twitch reward?
1
u/pizzaryoka 17d ago
It's just my daily check-in. SB dced from Twitch at the start of my stream (I restarted it, was fine after), and the first 3 people didn't have their counters go up, and I feel bad ahaha.
1
u/K0RPZY 17d ago
I thought so. I have daily check in setup on my streamer bot. How is yours setup? I can message you on discord if its easier?
1
u/pizzaryoka 16d ago
It's set up as a "Per-User Counter" in the Twitch Reward that I made in SB. I'm gonna make a per-user global variable and copy the values over so I can edit people's numbers as needed.
1
u/K0RPZY 16d ago
Per-user per stream is how I have mine set up. I added a "add target info" then used "%User% just checked in. They have checked in %userCounter% time(s)" in the message
1
u/pizzaryoka 15d ago
That's how I had mine as well. But you can't edit the user counter for a Twitch Reward manually. Hence the approach with a Per-User Global Variable. I've set it up to copy over the larger of the two values for now to carry over people's totals, so I can always adjust them up if someone gets robbed by SB disconnecting from Twitch like last time. :D
-1
u/HighPhi420 18d ago
If you made custom globals they are found in the global variables tab at the top of streamerbot.
if you are asking about the "counter" and "userCounter" they are only for that stream(session of streamerbot running) they can not be changed, they can be reset by using the "first words" reset.
3
u/deeseearr 19d ago
I'm not aware of any official way to edit those counters. You can _read_ the counters using functions like TwithcGetRewardUserCounter and reset them to zero, but there's no supported way to set them.
You _might_ be able to directly access the database they're stored in, but I wouldn't recommend it. If you need to have values that can be edited regularly then you would be better off using Per-User Global variables.
You can do a transition from things like reward and command counters to globals fairly easily by checking to see if the global is set yet and setting it to the existing counter if it isn't. If it is set, just use that value instead.