Skip to content

OBS script functions

Functions for C# (Cb.Call) and Python (cb.call). See Script functions for how to use them.

obs.connections

Lists every OBS connection you set up in Cuebot.

Gives back: A list with one entry per connection: name, state (Disconnected, Connecting, Connected or Error) and scene (its current scene).

var answer = await Cb.Call("obs.connections");
answer = cb.call("obs.connections")

obs.getCurrentScene

Asks OBS which scene is live right now. Fails with an error when OBS is not connected.

Value What to put in
connection Optional. The name of the OBS connection to use. Leave it out for your main OBS.

Gives back: The name of the live (program) scene, like "Gameplay".

var answer = await Cb.Call("obs.getCurrentScene");
answer = cb.call("obs.getCurrentScene")

obs.request

Sends any obs-websocket command to OBS and gives back OBS's answer. Good for things Cuebot has no ready-made step for. Fails with an error when OBS is not connected.

Value What to put in
requestType The obs-websocket command name, like "GetVersion" or "SetCurrentProgramScene". Needed.
requestData Optional. The settings for the command, like {"sceneName": "Gameplay"}. Leave it out when the command needs none.
connection Optional. The name of the OBS connection to use. Leave it out for your main OBS.

Gives back: OBS's answer data for that command (its responseData).

var answer = await Cb.Call("obs.request", new { requestType = "SetCurrentProgramScene", requestData = new { sceneName = "Gameplay" } });
answer = cb.call("obs.request", requestType="SetCurrentProgramScene", requestData={"sceneName": "Gameplay"})

obs.requestBatch

Sends several obs-websocket commands to OBS in one go. One failed command does not stop the rest, unless you ask it to. Fails with an error when OBS is not connected.

Value What to put in
requests A list of commands. Each one has a requestType and, if needed, requestData, like {"requestType": "GetVersion"}. Needed.
haltOnFailure Optional. true stops at the first command that fails. Default false.
connection Optional. The name of the OBS connection to use. Leave it out for your main OBS.

Gives back: A list with one result per command: its requestType, requestStatus (did it work) and responseData.

var answer = await Cb.Call("obs.requestBatch", new { requests = new object?[] { new { requestType = "GetVersion" }, new { requestType = "SetCurrentProgramScene", requestData = new { sceneName = "Gameplay" } } } });
answer = cb.call("obs.requestBatch", requests=[{"requestType": "GetVersion"}, {"requestType": "SetCurrentProgramScene", "requestData": {"sceneName": "Gameplay"}}])

obs.setScene

Switches OBS to another scene. Fails with an error when OBS is not connected.

Value What to put in
sceneName The scene name exactly as OBS shows it, like "Gameplay".
connection Optional. The name of the OBS connection to use. Leave it out for your main OBS.

Gives back: Nothing.

var answer = await Cb.Call("obs.setScene", new { sceneName = "Gameplay" });
answer = cb.call("obs.setScene", sceneName="Gameplay")