Skip to content

Instantly share code, notes, and snippets.

@UUoocl
UUoocl / HotkeyCommand.lua
Created March 24, 2024 23:52
An OBS Lua Script to run Command-lines that are triggered by a hotkey
--[[
OBS Studio Lua script : Run a command-line trigged by a hotkey
Author: Jonathan Wood
Version: 0.1
Released: 2024-03-23
references: https://obsproject.com/forum/resources/hotkeyrotate.723/, https://obsproject.com/forum/threads/command-runner.127662/
https://github.com/jtfrey/uvc-util
--]]
local obs = obslua
@UUoocl
UUoocl / PTZ-Camera-Get-Position.lua
Created November 24, 2023 16:36
OBS PTZ Move Filter: Get Camera Current Position LUA script
local obs = obslua
local ffi = require("ffi")
local obsffi
local cur_settings
local prev_settings
ffi.cdef[[
struct obs_source;
@UUoocl
UUoocl / camera-preload.js
Last active September 26, 2023 04:00
Play Google Slides transparently and connect to OBS with webSockets
const { contextBridge, ipcRenderer } = require('electron');
const cameraID = ipcRenderer.sendSync('camera-ID');
window.addEventListener('DOMContentLoaded', () => {
//console.log("cameraID ", cameraID )
const dataElement = document.createElement(`data`);
dataElement.setAttribute("id", "cameraID");
dataElement.setAttribute("data-camera-Id", cameraID);
@UUoocl
UUoocl / index.html
Created September 10, 2023 04:21
Play Published Google Slides with a transparent background
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<link href="./styles.css" rel="stylesheet">
<title>Hello World!</title>
</head>
<body>
@UUoocl
UUoocl / index.html
Last active September 5, 2023 03:17
An Electron Fiddle to play Reveal js slides and connect to OBS via websockets
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Reveal Player</title>
</head>
<body>
<h1 >Enter OBS WebSocket server details</h1>
@UUoocl
UUoocl / Reveal-player.html
Last active August 13, 2023 13:50
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
<!DOCTYPE html>
<html>
<head>
<title>Reveal Player</title>
</head>
<body>
<h2>Choose a Reveal slide deck</h2><br/>
<p >Open in transparent window</p>
<input type="file" onchange="transparentWindow()"/><br/><br/><br/>
@UUoocl
UUoocl / Update OBS Text Sources with Excel.EXCEL.yaml
Created March 27, 2023 02:58
This script gets all the text sources from OBS. When a text value is updated in Excel, the update also appears in OBS.
name: Update OBS Text Sources with Excel
description: >-
This script gets all the text sources from OBS. When a text value is updated
in Excel, the update also appears in OBS.
host: EXCEL
api_set: {}
script:
content: |
$("#register-event-handlers").click(() => tryCatch(registerEventHandlers));
@UUoocl
UUoocl / OBS WebSocket Sample (1).EXCEL.yaml
Last active September 12, 2023 05:01
A Register handles the `onSelectionChanged` events and sends the selected cell value to OBS via OBS WebSockets js
name: OBS WebSocket Sample (1)
description: >-
A Register handles the `onSelectionChanged` events and sends the selected cell
value to OBS via OBS WebSockets js
host: EXCEL
api_set: {}
script:
content: "$(\"#register-event-handlers\").click(() => tryCatch(registerEventHandlers));\n\nasync function registerEventHandlers() {\n await Excel.run(async (context) => {\n // Add a selection changed event handler for the workbook.\n context.workbook.worksheets.onSelectionChanged.add(onWorksheetSelectionChange);\n console.log(\"Change the seleceted cell\");\n await context.sync();\n });\n}\n\nasync function onWorksheetSelectionChange(args: Excel.WorksheetSelectionChangedEventArgs) {\n await Excel.run(async (context) => {\n //get selected cell value\n let myWorkbook = context.workbook;\n let activeCell = myWorkbook.getActiveCell();\n activeCell.load(\"values\");\n await context.sync();\n let cellText = activeCell.values.toString();\n console.log(\"The\_active\_cell\_is\_\" + cell