Skip to content

Instantly share code, notes, and snippets.

@UnaiM
Created April 7, 2021 22:38
Show Gist options
  • Save UnaiM/b5f803f1782baf2ae899d6d1d65dc48f to your computer and use it in GitHub Desktop.
Save UnaiM/b5f803f1782baf2ae899d6d1d65dc48f to your computer and use it in GitHub Desktop.
Example of a question in the OBS Discord community
local elapsed = 0
function script_properties()
local props = obslua.obs_properties_create()
obslua.obs_properties_add_bool(props, 'foo', 'Foo')
return props
end
function script_tick(seconds)
if elapsed then
elapsed = elapsed + seconds
if elapsed > 2 then
elapsed = nil
-- Tick the 'foo' checkbox.
end
end
end
elapsed = 0
def script_properties():
props = obspython.obs_properties_create()
obspython.obs_properties_add_bool(props, 'foo', 'Foo')
return props
def script_tick(seconds):
global elapsed
if elapsed is not None:
elapsed += seconds
if elapsed > 2:
elapsed = None
# Tick the 'foo' checkbox.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment