Skip to content

Latest commit

 

History

History

Onyx

Onyx Lua Scripts for ShowCockpit

This repository contains some LUA script which can be run from ShowCockpit to interact with Onyx.

Script List

Lua Fonctions

Inside the header.lua script which is include in all scripts, you have access to some functions. Theses last are detailed below if you want to create your own script based on it.

Logging function

HeadPrint()

This function will log the in ShowCockpit the Script Name and the Script Version

FootPrint(sentence)

Arguments: string sentence

This function will log the in ShowCockpit sentence argument and display the author informations and display a pop-up to user (for script ends)

LogActivity(text)

Arguments: string text

This function will register all the text argument. It can be restitute later by calling the GetActivity() function

GetActivity()

This function will compile all text sent through the LogActivity(text) function. Each text will have a chariot return as suffix.

Interface function

Main function

InputDropDown(Infos)

Arguments: JSON Infos {Question: string, Description: string, Buttons: JSON {string Button1, string Button2, string Button3}, DefaultButton : string, DropDown : JSON {string Value 1, string Value 2, ...}, DropDownDefault: string}

Dependency: Input(), ShowInput()

This function will display the CreatePrompt of type "DropDown" to the user and will return the user choice value

InputYesNo(Infos)

Arguments: JSON Infos {Question: string, Description: string, Buttons: JSON {string Button1, string Button2, string Button3}, DefaultButton : string, DropDown : JSON {string Value 1, string Value 2, ...}, DropDownDefault: string}

Dependency: Input(), ShowInput()

This function will display the CreatePrompt of with only buttons to the user and will return the user button click value

InputText(Infos)

Arguments: JSON Infos {Question: string, Description: string, Buttons: JSON {string Button1, string Button2, string Button3}, DefaultButton : string, DropDown : JSON {string Value 1, string Value 2, ...}, DropDownDefault: string}

Dependency: Input(), ShowInput()

This function will display the CreatePrompt of type "TextInput" to the user and will return the user value

InputNumber(Infos)

Arguments: JSON Infos {Question: string, Description: string, Buttons: JSON {string Button1, string Button2, string Button3}, DefaultButton : string, DropDown : JSON {string Value 1, string Value 2, ...}, DropDownDefault: string}

Dependency: Input(), ShowInput()

This function will display the CreatePrompt of type "IntegerInput" to the user and will return the user value

InputFloatNumber(Infos)

Arguments: JSON Infos {Question: string, Description: string, Buttons: JSON {string Button1, string Button2, string Button3}, DefaultButton : string, DropDown : JSON {string Value 1, string Value 2, ...}, DropDownDefault: string}

Dependency: Input(), ShowInput()

This function will display the CreatePrompt of type "FloatInput" to the user and will return the user value

Sub function

Input(Infos, Type=false)

Arguments: JSON Infos {Question: string, Description: string, Buttons: JSON {string Button1, string Button2, string Button3}, DefaultButton : string}, string Type [IntegerInput|FloatInput|TextInput|DropDown]

This function will return the ShowCockpit CreatePrompt() object

ShowInput(Prompt, Infos)

Arguments: object CreatePrompt, JSON Infos {Cancel: boolean}

Dependency: CheckInput()

This function will display the CreatePrompt to the user and will return the user answer (CheckInput() function output)

CheckInput(Infos, Answer)

Arguments: JSON Infos {Cancel: boolean}, array Answer

This function will return, following the Infos.Cancel value, the user answer. If Infos.Cancel is true, and the user answer is empty or button cancel, the return will be a NIL value. Else, the answer will be the button content or the input value

Onyx Function

ListPreset(PresetType, PresetIDStart, PresetIDEnd)

Arguments: string PresetType [Intensity|PanTilt|Color|Gobo|Beam|BeamFX|Framing], int PresetIDStart, int PresetIDEnd

Dependency: GetPresetName()

This function will return an array of JSON object {id,name} with all Presets name of PresetType from ID PresetIDStart to ID PresetIDEnd

ListCuelist(CuelistIDStart, CuelistIDEnd)

Arguments: int CuelistIDStart, int CuelistIDEnd

This function will return an array of JSON object {id,name} with all Cuelist name from ID CuelistIDStart to ID CuelistIDEnd

ListGroup(GroupIDStart, GroupIDEnd)

Arguments: int GroupIDStart, int GroupIDEnd

This function will return an array of JSON object {id,name} with all Group name from ID GroupIDStart to ID GroupIDEnd

DeletePreset(PresetType, PresetID)

Arguments: string PresetType [Intensity|PanTilt|Color|Gobo|Beam|BeamFX|Framing], int PresetID

This function will delete the Preset of PresetType with ID PresetID

GetPresetName(PresetType, PresetID)

Arguments: string PresetType [Intensity|PanTilt|Color|Gobo|Beam|BeamFX|Framing], int PresetID

Dependency: CheckEmpty()

This function will return the Preset name of PresetType with ID PresetID. If there is no Preset, it will return "--"

GetPresetAppearance(PresetType, PresetID)

Arguments: string PresetType [Intensity|PanTilt|Color|Gobo|Beam|BeamFX|Framing], int PresetID

Dependency: CheckEmpty()

This function will return the Preset apperance of PresetType with ID PresetID. If there is no Preset apperance, it will return the DefaultPresetAppearance of PresetType

RecordCuelist(CuelistID)

Arguments: int CuelistID

Dependency: KeyNumber()

This function will record a new cuelist (of the latest recorded cuelist type) with ID CuelistID

RecordPreset(PresetType, Preset, Merging)

Arguments: string PresetType [Intensity|PanTilt|Color|Gobo|Beam|BeamFX|Framing], JSON Preset {Position: int, Name: string}, boolean Merging

This function will create a preset of the provided PresetType at Preset.Position named Preset.Name. You can merge the preset creation by setting Merging to true, false will overwrite

KeyNumber(Number)

Arguments: int number

This function will type with the Onyx Keyboard the Number pass as argument

CopyCue(CuelistIDSource, CueID, CuelistIDTarget)

Arguments: int CuelistIDSource, int CueID, int CuelistIDTarget

Dependency: KeyNumber()

This function will copy an existing Cue CueID from an existing Cuelist CuelistIDSource to another existing Cuelist CuelistIDTarget