User Tools

Site Tools


lua:scripts_editor

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scripts_editor [2019/01/09 10:14] akuzmuklua:scripts_editor [2022/05/27 12:16] (current) – [Property area (2)] emozolyak
Line 1: Line 1:
 +{{ network:menu-icon-scripts.png?direct&40}}
 ===== Scripts Editor ===== ===== Scripts Editor =====
  
Line 8: Line 9:
   - Edit tool buttons (full screen, insert function calls, show/hide console window, save)   - Edit tool buttons (full screen, insert function calls, show/hide console window, save)
   - Create new script button   - Create new script button
 +  - Debbuging console
 +
 +<wrap em>As of 4.0 fw verstion there is a global search box above the script list:</wrap>
 +{{ :lua:script_global_search_box.png?direct&400 |}}
  
 The main editor's window: The main editor's window:
 +{{ :lua:script_editor_standard_view_numbered.png?direct&912 |}}
  
-{{ :main_window2.png?912 |}}+====  Script list (1) ==== 
 +{{ network:modified_disabled_script2.png?600 |}}
  
 +In the example list provided, the script titles are named as accroding to their possible execution types.
  
-====  Script list (1==== +Two or three icons indicates execution type of script (see more details below), wether it has modifications, and its running state (Enabled/Disabled). 
-{{ :modified_disabled_script2.png?600 |}}+
  
 The scripts run in the order how they are sorted in the list. This order can be easily changed by dragging a script into a new location. The scripts run in the order how they are sorted in the list. This order can be easily changed by dragging a script into a new location.
Line 22: Line 29:
   Jul 26 17:23:27.450: ERROR: LUA scripts: Can't execute LUA script #3.   Jul 26 17:23:27.450: ERROR: LUA scripts: Can't execute LUA script #3.
  
-Then goes title and two or three icons indicating type of script (see more details below), wether it has modifications, and its running state (Enabled/Disabled). In this example all possible types are shown with their respective icons. +
  
 ==== Property area (2) ==== ==== Property area (2) ====
 You can set here **name** for the script, select **type**, **disable** or **enable** it and give short **description**.  You can set here **name** for the script, select **type**, **disable** or **enable** it and give short **description**. 
  
-There are 5 **types** of scripts:+There are types of scripts:
   ***Execute in every loop** - script runs in every scan after reading registers in connections   ***Execute in every loop** - script runs in every scan after reading registers in connections
   ***Script for dashboard** - script runs upon clicking the button with this script “attached” to it   ***Script for dashboard** - script runs upon clicking the button with this script “attached” to it
Line 33: Line 40:
   ***Script for calendar** - the script is set as start or end task action in the calendar   ***Script for calendar** - the script is set as start or end task action in the calendar
   ***Execute once on project start** - runs one time on the very first scan during project start   ***Execute once on project start** - runs one time on the very first scan during project start
 +  ***Library for other programs** - the library body is included into another scritps with the command <code lua> 
 +--[[ Please note that library code should have only functions and variable declaration, not the main() function.--]] 
 +
 +include "myLibName" </code>
  
 ==== Editor (3) ==== ==== Editor (3) ====
Line 42: Line 53:
   * supports a number of typical hotkeys    * supports a number of typical hotkeys 
  
-Table of hotkeys:+Table of popular hotkeys:
 ^Key^Function^ ^Key^Function^
 |F6|toggle compact / full-screen mode  | |F6|toggle compact / full-screen mode  |
Line 57: Line 68:
 |Ctrl-U|convert text to upper case | |Ctrl-U|convert text to upper case |
  
 +For more hotkeys, please refer to the Ace code editor.
 ==== Editor toolbar (4) ==== ==== Editor toolbar (4) ====
 The toolbar has the following buttons (from left to right): The toolbar has the following buttons (from left to right):
Line 66: Line 78:
   *Show/hide console button   *Show/hide console button
   *Save script (hotkey **Ctrl-S**)   *Save script (hotkey **Ctrl-S**)
 +  *Decrease the code font size (s ∨)
 +  *Increase the code font size (S ^)
   *Clone script button   *Clone script button
   *Delete script button   *Delete script button
  
 In the following picture, the full editor mode with console activated is shown: In the following picture, the full editor mode with console activated is shown:
-{{ :editor_with_console.png?800 |}}+{{ :lua:script_editor_new_toolbar.png?direct&912 |}} 
 + 
  
 ==== Adding script (5) ==== ==== Adding script (5) ====
 When there are no scripts yet in the project, the **+Add script** button is placed in the page center. After adding a script it is moved to the top-right page corner.  When there are no scripts yet in the project, the **+Add script** button is placed in the page center. After adding a script it is moved to the top-right page corner. 
  
 +==== Debugging console (6) ====
 +
 +The console has two controls:
 +  - You can drag the top border to change the console size
 +  - You can run/stop output to console with the run/stop button in the top right corner. 
 +
 +{{ :lua:script_editor_just_console.png?direct&912 |}}
lua/scripts_editor.1547028878.txt.gz · Last modified: 2019/01/09 10:14 by akuzmuk

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki