Kruiser8 / Kruiz-Control

Kruiz Control enables a pseudo code approach to manage and automatically handle Twitch Channel Points, Twitch Chat, OBS or SLOBS, and StreamElements or Streamlabs alerts.
Other
231 stars 32 forks source link

How to use Conditionals #37

Closed MoxyFoxy closed 2 years ago

MoxyFoxy commented 2 years ago

How does one properly use an "If" statement? I had tried a few different ways to do this, but to no avail. The documentation doesn't help much either. I tried it both like this:

OnChannelPoint e "Retro Mode"
If {OBS CurrentScene} = "Main"
Play 100 nowait "Retro Mode.wav"
OBS Scene CRT
Delay 60
OBS Scene Main

And like this:

OnChannelPoint e "Retro Mode"
If OBS CurrentScene = "Main"
Play 100 nowait "Retro Mode.wav"
OBS Scene CRT
Delay 60
OBS Scene Main

Yet it seems to still not trigger, despite being in the "Main" scene. What exactly am I doing wrong here?

Kruiser8 commented 2 years ago

Hey F0x1fy,

You're very close to the right answer here. Except for Random logic, you cannot use multiple actions on a line. You have to use the values returned by an action (parameters).

OBS CurrentScene returns the current_scene parameter that you can leverage on future lines. So, the code would look like

OnChannelPoint e "Retro Mode"
OBS CurrentScene
If {current_scene} = "Main"
Play 100 nowait "Retro Mode.wav"
OBS Scene CRT
Delay 60
OBS Scene Main
Kruiser8 commented 2 years ago

Also, side note, the OnChannelPoint trigger does not take a permission action, so the e means nothing in this case.

MoxyFoxy commented 2 years ago

Wow, thank you for the swift response! Just in time for my stream haha. I cut this one a bit close :P Greatly appreciated!!! I may even consider contributing to this project if you're open to PRs. Anyways, this was a lot of help! Thank you, and I hope you have a great day/night!