mirror of
https://github.com/onyx-and-iris/obsws-ruby.git
synced 2024-11-16 03:00:47 +00:00
22 lines
457 B
Ruby
22 lines
457 B
Ruby
require "obsws"
|
|
require "yaml"
|
|
|
|
OBSWS::LOGGER.info!
|
|
|
|
def conn_from_yaml
|
|
YAML.load_file("obs.yml", symbolize_names: true)[:connection]
|
|
end
|
|
|
|
def main
|
|
OBSWS::Requests::Client.new(**conn_from_yaml).run do |client|
|
|
resp = client.get_scene_list
|
|
resp.scenes.reverse_each do |scene|
|
|
puts "Switching to scene #{scene[:sceneName]}"
|
|
client.set_current_program_scene(scene[:sceneName])
|
|
sleep(0.5)
|
|
end
|
|
end
|
|
end
|
|
|
|
main if $0 == __FILE__
|