Updated Websockets (markdown)

WarmUpTill
2026-02-20 18:06:38 +01:00
parent 63225182cd
commit 7994891bf9

@@ -1,5 +1,5 @@
# Websockets
It is possible to use the [macros](Macros) system to communicate with remote OBS instances using version 5.0 of the obs-websockets plugin.
It is possible to use the [macro](Macros) system to communicate with remote OBS instances using version 5.0 of the obs-websockets plugin.
Since version 28 of OBS the obs-websocket plugin is shipped with OBS itself so there is no need to install anything for this functionality.
To receive messages the [macro](Macros) condition "Websocket" can be used.
@@ -127,3 +127,56 @@ So you your message must at least include an `op` and `d` field and in most case
Here is an example who to send the websocket message to start a recording:
![image](https://github.com/WarmUpTill/SceneSwitcher/assets/19472752/bb1cc3ae-04b7-4c9d-afbb-b5860919602b)
## Triggering macros and setting variables using VendorRequests
It is also possible to directly run a macro and (optionally) set variables using the `AdvancedSceneSwitcherRunMacro` vendor request:
```
{
"op": 6,
"d": {
"requestType": "CallVendorRequest",
"requestId": "request-id",
"requestData": {
"vendorName": "AdvancedSceneSwitcher",
"requestType": "AdvancedSceneSwitcherRunMacro",
"requestData": {
"name": "Macro 3",
"variables": [
{
"name": "My Variable",
"value": "Text (GDI+)"
}
]
}
}
```
To just modify the value of variables you can use the `AdvancedSceneSwitcherSetVariables` vendor request:
```
{
"op": 6,
"d": {
"requestType": "CallVendorRequest",
"requestId": "request-id",
"requestData": {
"vendorName": "AdvancedSceneSwitcher",
"requestType": "AdvancedSceneSwitcherSetVariables",
"requestData": {
"variables": [
{
"name": "My Variable",
"value": "Some value"
},
{
"name": "Another Variable",
"value": "Something else"
}
]
}
}
}
}
```