Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:guides:features:scripts:variables [2017/02/06 18:11]
maxibanki
en:guides:features:scripts:variables [2018/08/27 22:00] (current)
mxschmitt
Line 5: Line 5:
 Current available variable types: Current available variable types:
  
-^ Type ^ Input ^ +^ Type      ^ Input ^ 
-| string | Show a regular input element where the user can enter some text | +| string ​   | Show a regular input element where the user can enter some text | 
-number ​Show a regular input element, ​but only accept numeric input from the user +password  ​like string ​but doesn'​t display ​the text you've entered ​
-track %%Show an input where the user can search and specify a track that has been uploaded to the bot - the config variable will later on contain an object like this: { "​url":​ "​track://​uuid",​ "​title":​ "A short title of the track" } %%| +strings ​  set multiple strings ​|
-| channel | If the bot is connected, this displays a channel selector. The config variable will later on hold the channel-id of the selected channel | +
-| select | this will display a select box. All options need to specified in an array called options and the config value will later on hold the index to the selected option. ​|+
 | multiline | this will display a text area where the user can enter several lines of text | | multiline | this will display a text area where the user can enter several lines of text |
 +| number ​   | Show a regular input element, but only accept numeric input from the user |
 +| track     | %%Show an input where the user can search and specify a track that has been uploaded to the bot - the config variable will later on contain an object like this: { "​url":​ "​track://​uuid",​ "​title":​ "A short title of the track" } %%|
 +| tracks ​   | select multiple tracks |
 +| channel ​  | If the bot is connected, this displays a channel selector. The config variable will later on hold the channel-id of the selected channel |
 +| select ​   | this will display a select box. All options need to specified in an array called options and the config value will later on hold the index to the selected option. |
 +| checkbox ​ | this will display a checkbox |
 +| array     | this allows the user to add an unspecified amount of items |
  
 Example of the string type usage: Example of the string type usage:
Line 34: Line 39:
 </​sxh>​ </​sxh>​
  
-You can get these values by using:+Example of the condition type with the above options example: 
 + 
 +<sxh js> 
 +
 +    name: '​fooSwitch',​ 
 +    title: '​Selected fooType',​ 
 +    type: '​select',​ 
 +    conditions: [{        //make a field visible or invisible in the config with conditions 
 +        field: '​fooType',​ //this will tell to use the config field with the name "​fooType"​ 
 +        value: 2,         //​this will tell to use the 3rd index of the options of the selected type in this case "​Foobar"​ 
 +    }] 
 +
 +</​sxh>​ 
 + 
 +You can print these values ​in the log by using:
  
 <sxh js> <sxh js>