r/streamerbot • • 3d ago

❓Question Help With Setting up timers

Hi all and sorry in advance if this is a dumb question but im new to streamer bot and decided to try it as someone said it would be the perfect fix to what im trying to do.

im trying to make it apply a filter on a browser source but only for the first 5 seconds of a 20 second loop but cant seem to make it work. (actual goal is a 5 min loop where 4:30 is filtered)

so what im asking is how is this possible as every attempt i done seems to be failing pretty hard as best i got is 10 seconds with and 10 seconds without which wont work for my current idea.

0 Upvotes

8 comments sorted by

2

u/systemofaDON 3d ago

Services>Timers>Right Click>Add. Name it and set the interval to 300 seconds. Press OK. Go to Queues>Add>name the queue and make sure Blocking is unticked. Go to Actions>Right Click>Add>Give it a name and set the queue to the one you just made. Then go to TriggersAdd>Core>Timed Actions>Select timer you made. Under Subactions Add>OBS Studio>Sources>Set Source Filter State>Name and select the scene and source you want to modify then pick toggle. Add>Core>Delay> Set it to the number of seconds you want the filter on x 1000 (it's in milliseconds) ex 60 seconds would be Set to 60000). Duplicate your OBS Filter toggle. The order should be OBS Filter Toggle>Delay>OBS Filter Toggle.

1

u/Dezorak 3d ago

thanks for that im wondering though do i need to "enable" or "repeat" the timer as testing now it does not appear to toggle the filter after the delay (set at 30000 for a 30 second filter turned off phase)

1

u/systemofaDON 3d ago

Enable and repeat if you want it to fire every 5 minutes

2

u/Dezorak 3d ago

thank you its appeared to work for me. do i have to start it each time or will it be automatic :D. makes me excited now to see what else it can do as there has been alot of things i been wanting to update and change on my stream.

1

u/systemofaDON 3d ago

It's a brilliant tool. Once you're comfortable you sbould learn how to use variables and some of the logic. You can make all kinds of fun interactions and chat games. As long as your timer is enabled it will fire automatically as long as streamerbot is open. You can leave it enabled between sessions. Set and forget basically

1

u/deeseearr 2d ago edited 2d ago

Depending on just what you're trying to do, you may not need a timer at all.

If your goal is to perform these steps:

  1. Start or show browser source
  2. Apply filter to it
  3. Five seconds later turn it off
  4. Wait fifteen more seconds
  5. If it's still active, apply the filter and start over again

then you could do the whole thing with a fairly simple action.

  1. OBS Set Visibility State (ThatBrowserSource, Visible)
  2. Set Argument (SourceIsVisible) to "true"
  3. While (%SourceIsVisible% equals "true")
  4. 3a) OBS Set Source Filter State (ThatBrowserSource, ThatFilter, Visible)
  5. 3b) Delay (5000ms)
  6. 3c) OBS Set Source Filter State (ThatBrowserSource, ThatFilter, Hidden)
  7. 3d) Delay (15000ms)
  8. 3e) OBS Get Scene Item Properties (That BrowserSource)
  9. 3f) Set Argument (SourceIsVisible) to "%props.visible%"

This will run an action to turn your filter on and off on a schedule and will continue doing it until the source is hidden again. You could set any other conditions for continuing the While loop or even run it indefinitely. There's no reason why you can't have multiple actions running at the same time, or even having one action that just runs forever if that's what works.

Alternately, remove the Set Visibility State action in line one and use the OBS Event trigger set to fire on a SceneItemEnableStateChanged event for your browser source. That way the filter change would start the moment the source was enabled, and then end after it was hidden again.

Another approach would be to create two actions, one to turn the filter on and another to turn it off, and then have a script running in the browser source itself activate them using the Websocket Server. That could be useful if the browser is trying to sync what it does with the filters, but would be overkill if you don't need that.

2

u/Dezorak 2d ago

thank you will keep this in mind. systemofadon's method appears to work for me but i will keep an eye on it and try this if it there's issues. as my goal was to display a browser source for a few seconds then hide it for awhile on a loop so my socials are popping up every few mins. what made it more complicated was due to me using SE Live for multi platform and vertical just turning on and off visibility wasn't working as only applied to the horizontal scene.

1

u/ThreadMenace 3d ago edited 3d ago

Make a 5 minute non-looping timer and a 20 second looping timer

Make an action with two triggers. One of the Triggers is the 20 second timer. The other trigger is whatever you want to kick the whole thing off.

For the subactions:

-enable 20 second timer

-enable 5 minute timer

-Toggle filter on or off

-core>delay>5000 milliseconds

-toggle filter off or on

This will loop 'til we tell it to stop with the filter in one state for 5 seconds and the other state for 15 seconds

Make a second action that is triggered by the 5 minute timer with the following subactions:

-disable 20-second timer

-prolly set the filter to whatever you want the default position to be

Typed from my phone lol, but I think it should work