OBS-WebSocket-JS setTimeOut

I was tinkering with OBS-WS-JS, and wanted to utilize setTimeOut.

Using setTimeOut works fine with OBS-WS-JS on it’s own, outside of SogeBot.
However when pasting the same code into the Advanced Mode of OBS-WS-JS in SogeBot, the code inside the setTimeOut function doesn’t trigger.

My use-case:
To toggle visibility of an scene source. (“Thanks for the follow {name}”, with a transition and stuff) So to slide it in, and slide it out again, after 10 seconds.

Is doing that with a JS Timeout silly and can it be done differently?

Sample code:

obs.send('SetSceneItemProperties', {'scene-name': 'Test', 'item': 'Test', 'visible': true}).then((data) => {});
setTimeout(function(){
    obs.send('SetSceneItemProperties', {'scene-name': 'Test', 'item': 'Test', 'visible': false}).then((data) => {});
}, 10000);

you can already use async waitMs(ms) and per comments in obs websockets you must use awaits

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.