I have been trying to find this answer everywhere. I have seen multiple threads regarding win counters and most include a secondary variable. I used !wins Command with Kill Counter - #2 by RokettoJanpu to create a command to track wins. However, I do not wish to track kill count as well. Sure I can simply edit the output to not display the kill count per game, but I don’t want to have to type !addwin followed by a number every time I wish to add a win to the counter.
Idealistically I could have two variables:
!totalwins which would display $(channel) has a total of (###) (wins in lets say warzone)
!dailywins Which would display $(channel) has won (##) games today
Then I would have two commands
!addwin which would update !dailywins as well as !totalwins
and
!resetwins which would reset the number displayed in !dailywins to zero
The thread linked shows me how to set up most of that however I don’t know how to remove the kill count variable and need for it to be input also I would like !addwin to update both variables !dailywins and !totalwins. Thank you for your help @RokettoJanpu@xgerhard were the two in the forum who I’ve seen kind of cover the topic not sure if either of you are able to help.
@potatoeaterlove I am going to test it right now and see how it responds, but is the timezone thing needed? If so what format would the input be I am CST; and instead of deleting the last win is it possible to reset the dailywins to zero? Also, its not working at all lol.
Here are some new tested commands that should do exactly what you want.
You can find a list of time zones that nightbot allows here Time - Nightbot Docs
$(eval a=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`.split(`,`);b=0;c=0;for(x=1;x<a.length;x++){b=a[x].split(`|`)[1];c+=b.length};`$(channel) has ${c} total wins.`)
!dailywin
$(eval a=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`.split(`,`);b=0;c=0;if(a[a.length-1].split(`|`)[0]==`$(time YOUR_TIMEZONE "MMMM Do YYYY")`){b=a[a.length-1].split(`|`)[1];c+=b.length};`$(channel) has ${c} wins today.`)
I thank you very much for your time and help with this. I will use them when I get home. I have very little experience with JavaScript which is why my troubleshooting was getting me nowhere. Thank you again for the help.