Introduction
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.
-
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!
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.
You cannot use variables in command delays, but you can use Wait for Timeout command instead.
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.
When you start using commands in SAMMI, you will notice that some parameter boxes have yellow color and some have white color.
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) + "!" ) |
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.
General Variables
Variable | Type | Explanation |
---|---|---|
administrator_mode |
Boolean | True if running in Administrator mode. |
elapsed_time |
Number | Time in seconds since you started SAMMI. |
main_directory |
String | Main directory where SAMMI folder resides, using forward slashes (/ ). Useful for extension makers to be able to easily copy files. |
main_directory_slash |
String | Main directory where SAMMI folder resides, using backslashes (\\ ). Useful for sending file paths to OBS. |
mouse_x |
Number | Current x position of your mouse. |
mouse_y |
Number | Current y position of your mouse. |
since_2020 |
Number | Elapsed time in seconds since January 1st, 2020. |
SAMMI Variables
Variable | Type | Explanation |
---|---|---|
api_port |
Number | The port number for the Local API server. |
api_pw_enabled |
Boolean | Returns true if SAMMI Local API server has a password. |
api_server_opened |
Boolean | Returns true if SAMMI Local API server is running. |
bridge_connected |
Boolean | True if connected, false if not connected. |
extensions |
Object | Contains all extensions and their versions installed in Bridge (only if Bridge is connected to SAMMI) |
browser_name |
String | Browser name your Bridge connected to SAMMI is using. |
client_language |
String | Language SAMMI is currently using. |
deck_connected |
Boolean | Returns true if SAMMI deck is connected, false if not. |
deck_app_connected |
Boolean | True if connected, false if not connected. Lists the connected deck apps. |
deck_app_port |
Number | The port number for SAMMI Panel. |
SAMMI |
Object | Contains information about your current SAMMI versions. |
SAMMI.bridge_version |
String | Your current SAMMI Bridge version. |
SAMMI.deck_version |
String | Your current SAMMI Deck version. |
SAMMI.sammi_version |
String | Your current SAMMI Core version. |
bridge_port |
Number | The port number for SAMMI Bridge connections. |
trigger_type |
Array | All available trigger types. |
Extensions |
Object | Shows all currently installed extensions in Bridge connected to SAMMI. |
Twitch Variables
Variable | Type | Explanation |
---|---|---|
twitch_accounts |
Array | All linked Twitch account login names. |
twitch_chat_connected |
Boolean | Twitch chat connection status. True if connected, false if not connected. |
twitch_client_id |
String | SAMMI Twitch Client ID, used in Twitch API calls. |
OBS Variables
Variable | Type | Explanation |
---|---|---|
obs_connections |
Array | Names of all your OBS connections. |
[obsName] |
Object | Contains information about your main/alternate OBS connection. |
[obsName].connected |
Boolean | Returns true if SAMMI is connected to that OBS. |
[obsName].current_scene |
String | Your selected OBS current scene. |
[obsName].ip |
String | The IP address of the OBS connection. |
[obsName].obs_studio_version |
String | Current OBS studio version the OBSws is connected to. |
[obsName].obs_websocket_version |
String | Current OBS Websocket version the OBSws is connected to. |
[obsName].port |
Number | The port of the OBS connection. |
[obsName].previous_scene |
String | Your selected OBS previous scene. |
[obsName].type |
String | OBSws selected type in OBS Connections, either OBSws4 , OBSws5 or Auto . |