Deep Bot - Twitch Streamer Assistant
Deep Bot => Help/Support => Topic started by: ladman on July 06, 2017, 03:22:43 AM
-
Hello,
Im looking for someone or some knowledge on how to make a subtrain counter on the stream go deactivate after 5 minutes of no new subs.
Currently, i it set up with a command that will activate a bar that has the counter and subtrain timer on screen, this will show up on stream when a sub occurs with obs remote. But what i now need is the logic to make it go away if there are no new subs after 5 minutes but keep it on screen when during it being activated and when a new sub happens, reset the timer.
pretty much
if ( subcount = +1 )
[ reset time();
else if
(subtimer == 300 and subcount = previous subcount )
do
!subtrainoff
or something like this
-
Can anyone help with this?
-
does no one out there know how have this done? there has to be a way of doing it.
-
Thinking about this logically it is possible to do. However it would require a command running in the background to check the status every minute or so. Depending how many subs you pull in the following could get quite messy but you'd need to do the following
1) We need a text file to save the current time in seconds. We can use @unixtime@ for this particular purpose.
- Create a new folder in Custom Logs called "subs"
- Create two text files in here. "subtrainnumber.txt" and "subtraintimer.txt"
- in "subtrainnumber.txt" save the text file with the number 0 in it.
2) Best case scenario would be to just enable and disable the looping command whenever it is run. We can use @enablecmd@ and @disablecmd@ to that effect.
3) The first command will do whatever you want it to do. You could make it more personalised like "Choo Choo! The train now has x subs on it. Full steam ahead!" for example.
4) Magic will happen in the command we'll create. It'll be a self executing one which will loop every minute. In theory this means it will loop 5 times and complete its journey.
With this example, the command names are !subtrain and !subtrain_2. You sub notification would call the !subtrain command when a new sub comes in
With that out the way this is how it should look
!subtrain
@if@[>||@calc@[+|@readfile@[subs/subtrainnumber.txt]|1]||1||Choo Choo, This train is going full steam ahead! @user@ has now subscribed to the stream||@user@ has just subscribed to the stream. The sub train has now left the station! Choo Choo!] @savefile@[subs/subtraintimer.txt,@calc@[+|@unixtime@|300]] @enablecmd@[!subtrain_2] @savefile@[subs/subtrainnumber.txt,@calc@[+|@readfile@[subs/subtrainnumber.txt]|1]] @exec@[60,!subtrain_2]
!subtrain_2
@if@[<=||@unixtime@||@readfile@[subs/subtraintimer.txt]||@exec@[60,!subtrain_2]||@disablecmd@[!subtrain_2] The sub train has ended with @readfile@[subs/subtrainnumber.txt] member(s) on board @savefile@[subs/subtrainnumber.txt,0]]
-
Awesome!!!
Life saver man!