Changes for page 09 Lua Editor
Last modified by Nhu Nguyen on 2025/03/09 17:22
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. Stone1 +XWiki.Jim - Content
-
... ... @@ -23,6 +23,8 @@ 23 23 * Create new file: right-click the Lua node to select new file, and enter a name in pop-up window, (the name starts with an underscore or letter); 24 24 * Refresh list: the file edited (new/deleted/renamed) by the user externally, the configuration is not refreshed. In this case this function needs to be used to synchronize changes; 25 25 26 +(% class="box infomessage" %) 27 +((( 26 26 **✎Note: ** 27 27 28 28 * There is no script file for the newly created project. Following two new files will automatically generate. ... ... @@ -29,6 +29,7 @@ 29 29 * Script_BG.lua: is the global background script file, which includes initialization and timing functions 30 30 * Script_Screen.lua: is a screen script file, and each screen can have initialization, timing, and close functions 31 31 * At any time, as long as there is a new operation, the software will judge whether the above two files exist, and which one is missing will be automatically filled. 34 +))) 32 32 33 33 **Lua Child Node** 34 34 ... ... @@ -54,7 +54,10 @@ 54 54 55 55 **Unprotect:** Right-click on the child node, select Unprotect, enter the password to release. 56 56 60 +(% class="box infomessage" %) 61 +((( 57 57 **✎Note: **If user forgets the password, the script file can never be recovered, the software will not storage any passwords, developers need to keep the password by themselves carefully. 63 +))) 58 58 59 59 == Script editor == 60 60 ... ... @@ -105,10 +105,13 @@ 105 105 * **Rising script**: after the button is raised, the code chunk in the area is executed; 106 106 * **Timing script**: periodically execute the code. 107 107 114 +(% class="box infomessage" %) 115 +((( 108 108 **✎Note: ** 109 109 110 110 * The timing script is not commonly used because it is similar to the screen background script function. It is not recommended to write and call function here. It should be written in Script_Screen.lua, which is convenient for editing, searching, and replacing operations. 111 111 * It is not allowed to write endless loops or call functions that will loop enlessly in the widget. Once used, the entire screen will be stuck, and any buttons will no longer be used. We have to restart the screen to restore. 120 +))) 112 112 113 113 = **Platform** = 114 114 ... ... @@ -131,7 +131,10 @@ 131 131 * **Tens digit=1**: indicates that the function or global variable defined in this file can be used in the background code file (Script_BG.lua). If it is 0, it is not available. 132 132 * **Ones digit=1**: indicates that the functions or global variables defined in this file can be used in the screen code file (Script_Screen.lua) or LuaScript components. If it is 0, it is not available. 133 133 143 +(% class="box infomessage" %) 144 +((( 134 134 **✎Note: **If you rename the file manually, you must modify the limits in the file accordingly, otherwise the script file will not take effect. 146 +))) 135 135 136 136 == Built-In script file == 137 137 ... ... @@ -156,7 +156,10 @@ 156 156 157 157 The above is the initialization function of screen 0. For screen 100, you can replace 0 with 100. You can add your own function: function we_scr_init_100() end 158 158 171 +(% class="box infomessage" %) 172 +((( 159 159 **✎Note: **The above function has a fixed name. If it is modified, it will not cause crash, but the function can be found. 174 +))) 160 160 161 161 **Example:** After the screen 0 initialization function is changed to we_scR_init_0(), the script will not be executed when screen 0 is initialized, and then no script will be executed, and nothing will be done because the "we_scr_init_0" function cannot be found. 162 162