The RGP Lua Console is a re-implementation in pure Lua of the Developer Tab in JW Lua. It allows you write and/or execute ad hoc scripts or scripts that have not been configured in the RGP Lua Configuration Window. It is included as
rgpluaconsole.lua in the zip archive of RGP Lua Utilities available on the download page for RGP Lua.
rgpluaconsole.lua script requires version 0.68 or higher of RGP Lua. Other than that it has no dependencies. You may place it anywhere on your hard drive. Once you have configured it in RGP Lua, it will be available to run.
Left Popup A file menu, including
Close All, and recent files.
Right Popup A menu of all the ways the script can be run. If the script includes Additional Menu Options, they are listed here.
Run As Trusted Runs the script in trusted mode. The console itself must be configured as Trusted for this option to be available.
Run As Debug Runs the script in Debug mode.
Line Endings Displays the line endings of the current script file as one of three options:
Stop Script This button is available if the script is running a modeless dialog or has retained its Lua state. By pressing it, you can terminate the script immediately.
Run Script Executes the script and displays print output in the output console.
Clear Clears the output console.
Copy Copies the contents of the output console to the clipboard.
Clear Before Run Tells the console to clear itself each time your press Run Script.
Preferences Opens the Preferences Dialog.
Search Opens the Find Text Dialog. If you hold down the shift key while clicking, it finds the next occurence of the text without opening the dialog.
The Console recognizes standard keyboard navigation commands for each operating system. It also recognizes the following:
The RGP Lua Console works well in tandem with both ZeroBraneStudio and Visual Studio Code. For more information about how to set these up, see instructions for the Development Environment. Some items to keep in mind are
Run Script command of RGP Lua Console. More information about the extra code needed is at the development environment page.
A particularly effective approach is to edit scripts with your IDE editor and use the console to trigger their execution. The console picks up saved changes from the IDE nearly instantaneously. This approach obviates the need to configure scripts in the RGP Lua Configuration Window. Having both windows open side-by-side makes for very rapid code-and-test iteration.
Total Width The total width in 72dpi points of the Console window, minus the border. This cannot be smaller than 580.
Editor Height The height in 72dpi points of the script editing control. This cannot be less than 200.
Output Console Height The height in 72dpi points of the output console. This cannot be less than 100.
Tabstop Width The width of tabs, in spaces. This must be at least 1.
Use Spaces for Tabs Selecting this option causes the editor to substitute spaces for tabs.
Wrap Text in Editor If checked, longer lines of text are wrapped to the visible area of the editor. If unchecked, a horizontal scrollbar allows one line on the screen per line of code.
Show Timestamps in Output If checked, each line of output begins with a timestamp that measures 1000ths of a second from the start of the script run.
Output Tabstop Width The width of tabs in the output console, in spaces.
Wrap Text in Output If checked, longer lines of text are wrapped to the visible area of the output console. If unchecked, a horizontal scrollbar allows one line on the screen per line of output.
Font The font used in all three of the text panes. It is recommended to use a fixed-width font.
Change Allows you to select the font and size for the text panes. Font effects are ignored.
Text The text or pattern for which to search.
Case Sensitive Specifies whether to search exact case or ignore case.
Whole Words If checked, only find whole words.
Regular Expressions If checked, the search pattern is a regular expression. (Overrides the Whole Words option.)
Current Selection Only If checked, only the current selection is searched.