Introduction

Edit

General #

When you right click-Edit commands or double click on your button in your deck, you can press + or use CTRL+N keyboard shortcut to start adding commands to execute when the button is pressed.

  • Once a button is triggered, all enabled commands are executed

  • You can hover over a command name and press F1 on your keyboard to open Documentation in your default browser for the given command

  • You can disable a command (and prevent it from executing) by checking Off on the very right side of the command. Disabled commands have a red color.

    Disabled command
    Disabled command
  • You can copy a command (or multiple commands) by pressing the scissors icon and pasting it anywhere else (even in another button in another deck)

  • You can freely rearrange your commands by pressing the ball icon (very left side) and dragging them to a different position. Select multiple commands to drag all of them at the same time. You can also use up and down arrows for the same effect.

  • If you accidentally delete or rearrange a command, you can press Undo to revert the action and Redo to redo the action.
  • When typing in an input box, you can press CTRL+Z to undo what you typed last
  • You can temporarily block a button from executing
  • You can use comments to organize your buttons. Simply create a new Comment command, give it some relevant description and place all relevant commands inside of it!


Edit

Command delays #

Command delays are absolute and not related to each other. You can think of them as a timeline, they do not affect each other in any way.

Example 1: If you set up the first command to trigger at 1000ms and the second command to trigger at 1000ms, both commands will trigger at 1000ms, one right after another (in this case order matters), exactly 1000ms from when the button was pressed.
Example 2: If you set up your first command to trigger at 5000ms and your second command to trigger at 2000ms, the second command will be triggered exactly 2000ms from when you pressed the button and then first command will be triggered exactly 3000ms after it (5000ms from when you pressed the button).

The command delay is superior to the command order, which means that a second command with a shorter delay will be always triggered before the first command with a longer delay.

Example showing how command delays work
Example showing how command delays work

You cannot use variables in command delays, but you can use Wait for Timeout command instead.


Edit

Purple Commands #

You might notice that some commands are coloured purple - these commands are ones that are not instantaneous. As such, you must Wait for the response before continuing.

SAMMI Purple Commands
SAMMI Purple Commands


Edit

Input Boxes #

When you start using commands in SAMMI, you will notice that some parameter boxes have yellow color and some have white color.

Different parameter box colors
Different parameter box colors

It’s extremely important to know the difference as you need to format your input according to the color of the box.

Operation White Box Yellow Box
Inserting another variable You must wrap other variables in /$$/.
/$myVariable$/
You can directly type another variable.
myVariable
Inserting array value You must wrap them in /$$/.
/$myArray[0]$/
You can directly insert them.
myArray[0]
Inserting real values (numbers) You can directly insert them.
26
You can directly insert them.
26
Inserting string values (text) You can directly insert them, such as Hello World and even use new lines by pressing ENTER You have to wrap any string in double/single quotes.
"Hello World" or 'Hello World'
Using a combination of strings and variables You can insert a variable into text by wrapping it in /$$/.
Hello world, this is my /$myVariable$/, isn't it cool?
You must wrap any string in double/single quotes and use + to combine them with other variables. The whole value must be enclosed in parentheses.
( "Hello World, this is my " + myVariable + ", isn't this cool?" )
Math Operations All math operations must be enclosed in /$$/ and parentheses.
Hello world, do you know what's 3+7? It's /$(3+7)$/!
All math operations must be enclosed in parentheses.
( "Hello world, do you know what's 2+7? It's " + (2 + 7) + "!" )


Edit

Premade Variables #

The following premade/permanent global variables are accessible from all the buttons and their commands at all times.
These global variables can be viewed in the Variable Viewer in your SAMMI.
You can access them by using the Get Global Variable command, or reference them with global.variablename in a command.

SAMMI Global Premade Variables
SAMMI Global Premade Variables

General Variables

Variable Explanation
main_directory Main directory where SAMMI folder resides. Useful for extension makers to be able to easily copy files.
Architecture Type of architecture you’re on. x64 or x86.
administrator_mode True if running in Administrator mode
elapsed_time Elapsed time in seconds since you last started SAMMI
since_2020 Elapsed time in seconds since January 1st, 2020.
mouse_x Current x position of your mouse
mouse_y Current y position of your mouse

SAMMI Variables

Variable Explanation
SAMMI An object containing information about your current SAMMI versions.
SAMMI.bridge_version Your current SAMMI Bridge version
SAMMI.deck_version Your current SAMMI Deck version
SAMMI.sammi_version Your current SAMMI Core version
client_language Language SAMMI is currently using
browser_name Browser name your Bridge connected to SAMMI is using
bridge_connected True if connected, false if not connected
deck_connected Returns true if SAMMI deck is connected, false if not.
api_server_opened Returns true if SAMMI Local API server is running.
trigger_type Array that lists all available trigger types

Twitch Variables

Variable Explanation
twitch_client_id SAMMI Twitch Client ID, used in Twitch API calls
twitch_accounts Array of all linked Twitch account login names
twitch_chat_connected Twitch chat connection status. True if connected, false if not connected
twitch_pubsub_connected Twitch Pubsub (for Twitch alerts) connection status. True if connected, false if not connected

OBS Variables

Variable Explanation
obs_connections An array of all your OBS connection names
[obsName] An object containing information about your main/alternate OBS connection.
[obsName].connected Whether you’re connected to your selected OBS Name, 1 = connected, 0 = not connected
[obsName].current_scene Your selected OBS current scene
[obsName].previous_scene Your selected OBS previous scene
[obsName].type OBSws selected type in OBS Connections, either OBSws4, OBSws5 or Auto
[obsName].ip The IP address of the OBS connection
[obsName].port The port of the OBS connection
[obsName].obs_studio_version Current OBS studio version the OBSws is connected to
[obsName].obs_websocket_version Current OBS Websocket version the OBSws is connected to