Scripteditor Dialog » History » Revision 4
Revision 3 (Per Amundsen, 03/27/2021 05:53 AM) → Revision 4/6 (Per Amundsen, 03/27/2021 05:53 AM)
{{>toc}} 
 h1. Script Editor 
 !scripteditor.png! 
 The script editor allows adding or editing scripts. 
 Multiple script files can be loaded at the same time. 
 it can be opened by clicking [[Menubar_Control|Menubar]] -> Tools -> Edit Scripts or by pressing the %(key)ALT% + %(key)R% shortcut or by typing [[/edit]] -s. 
 The editor shares characteristics with all the other editors. 
 _See also [[/load]], [[/reload]], [[/unload]], [[$script]], [[$scripts]], [[Editor Options]]._ 
 h2. Script formats 
 on<whitespace><level>:<event>:command, on<whitespace>*:<event>:command, see [[Scripting Events]] for more information. 
 alias<whitespace><name><whitespace>command 
 Format when using multiple lines is: 
 <pre> 
 on<whitespace><level>:<event>:{ on<whitespace>*:<event>:{ 
   /command1 
   /command2 
   ... 
 } 
 alias<whitespace><name><whitespace>{ 
   /command1 
   /command2 
   ... 
 } 
 </pre> 
 h2. Saving a script to a different ini file 
 To save the current script file to a different ini file, click the Menubar (inside the editor) -> File -> Save As menu item. 
 h2. Loading a script from a different ini file 
 To load a script from a different ini file, click the Menubar (inside the editor) -> File -> Load menu item or use the [[/load]] command. 
 When loading scripts using the [[/load]], [[/reload]] or [[/unload]] command, the script editor will be automatically updated with the new script. 
 h2. Search/replace text 
 Clicking the Menubar (inside the editor) -> Edit -> Find or pressing the %(key)CTRL% + %(key)F% shortcut opens the search and replace panel. 
 You can search or search and replace using a [[Scripting_Regex|Regular Expression]] by checking the *Regex* checkbox. 
 Pressing the %(key)ESCAPE% key closes the search panel. 
 h2. Checking brackets 
 Checking for balanced brackets can be done by clicking the *{}* menu item to the far right of the Menubar (inside the editor) or by pressing the %(key)CTRL% + %(key)H% shortcut. 
 h2. Reloading a script file 
 If a script file was modified outside of the editor, it can be reloaded by clicking the Menubar (inside the editor) -> File -> Reload menu item or by pressing the %(key)F5% shortcut or by typing [[/reload]]. 
 h2. Jumping to a specific alias in a script 
 The *Alias* menu item in the Menubar (inside the editor) can be used to jump to a specific alias in the current script file. 
 h2. Adding TODO items 
 The *TODO* menu item in the Menubar (inside the editor) allows adding and viewing TODO items in the script. 
 h2. Ignoring a script 
 A script file can be ignored (not loaded bu still editable) by right-clicking it in the sidebar list and clicking the *ignore* menu item. 
 h2. Font 
 The font of the editor can be changed by clicking the Menubar (inside the editor) -> File -> Change Font menu item. 
 _Note: only "truetype":https://en.wikipedia.org/wiki/TrueType fonts can be used._ 
 h2. Colors 
 The editor colors can be changed in [[Options Dialog|Options]] -> [[Colors Options|Colors]].