Closed Epyxx closed 1 year ago
Hey Epyx,
It's possible to check if it was connected on start up. It's not possible to check active connection status without making a call. OBS Version
is probably the easiest one to run, however I think that throws an error and doesn't continue when there's an issue.
To check if it was connected on start up:
OnCommand mb 0 !check
Param Keyword _successful_ obs
if 2 {matched} == true
Chat Send "Websocket was connected"
Exit
Chat Send "Websocket connection error"
Thanks! i think this command should be enough for my case. But i copied your lines of code and tried it but i get no message at all. neiher "Websocket was connected" nor "Websocket connection error" :(
Huh, I tried it and it worked. However, I noticed a quirk with Param Keyword
that you'll have to add a workaround for:
OnCommand mb 0 !check
Param Keyword _successful_ obs,
if 2 {matched} == true
Chat Send "Websocket was connected"
Exit
Param Keyword _successful_ obs
if 2 {matched} == true
Chat Send "Websocket was connected"
Exit
Chat Send "Websocket connection error"
OnCommand mb 0 !check
OBS Version
Chat Send "Version: {version}"
In the next update, I'll make it so OBS Version
returns Disconnected
in the event that it isn't connected. That should fit your use case. That will look like:
OnCommand mb 0 !check
OBS Version
If 2 {version} == "Disconnected"
Chat Send "Websocket connection error"
Exit
Chat Send "Websocket was connected"
It now works for me, thanks!
Oh yeah, a live check with obs version would be awesome!
This is added in the upcoming release.
Hey, is there a way to check the OBS connection status on command?
For example something like this:
Or alternative output an connection error at OnInit event?
For Example:
Thanks!