LzRPA goal is to become a RoboticProcessAutomation development tool.
Used to make various automation scripts,
Help office staff solve the problem of duplication of work.
This is the first English version released (0.96).
Many of the planned features are already installed, providing a new, optional tool for ThinBasic development.
10075
LzRPA has a Visual Studio-like user interface.
Imitating the layout of QMacro makes it easier to use.
Hundreds of functions are organized in the command list on the left.
Click on the function to see the integration help.
Double click to insert the code into the editor.
Make the development process stay in the IDE all the way, Without switching between the IDE and the help documentation.
You can choose to use a single file for development, or use engineering to organize multiple extension libraries and files to make development more organized.
10076
You can choose from a variety of templates when creating a project. Templates can be added freely.
10077
During the development process, you will have a workspace where you can open multiple projects and files for easy debugging and build.
10078
The process of building an EXE file is fully automated, you only need to set the values you expect in the project options, LzRPA will organize the directory structure and dependencies for you.
10079
LzRPA has an auto-complete feature, which is not perfect yet, but will be better in later versions. Currently, LzRPA is updated very quickly and any problem will be resolved in a short time.
Of course, the above functions are very basic for LzRPA.
My long-term development plan for LzRPA is that it is simpler, easier to use, more standard, powerful and stable. This is not a fantasy. After three months of hard work, I have achieved some results.
LzRPA has some extensions to the functionality of ThinBasic, so they are not fully compatible during development.
LzRPA uses Main as the entry point function instead of TBMain, which is done in consideration of the more common language commonly used in the Main function.
LzRPA overwrites the MsgBox and InputBox functions to improve the UI and achieve better compatibility with other BASIC languages.
Of course, you can keep the original ThinBasic habit, using a single file suffix (.tbasic, .tbasicc, etc.), LzRPA will not make any changes to your code, it is exactly the same as the standard ThinBasic development.
LzRPA provides many additional features when developing in engineering or .tbs format files.
Some additional functions, easier-to-use extension library usage flow, automatic addition of dependency files, smoother development to release process.
10080
During the development process, when you use the extended library function, the extended library dependencies are automatically added to the project.
The extension library does not have to be a file like ThinBasic_*.dll, it might be a piece of ThinBasic code, a standard DLL file, or even just some dependencies needed by the EXE runtime.
These files are automatically added to the corresponding directory during the build or debug run after the extension library is referenced by the project, making it easier to develop and deploy more complex components.
LzRPA extends ThinBasic:
TracePrint (Output some data to the IDE's log window, similar to VB6's debug.print)
Mouse and keyboard simulation
A large number of compatibility aliases, such as CreateObject
FreeBasic time library, CDate function and Unix timestamp conversion
Work (Equivalent to multithreading)
Character set conversion family function
Some extensions to the original function library
Many extension libraries I developed with my friends:
dm3.1233 (The function is very rich, keyboard and mouse simulation, image text recognition, remote assembly code injection execution, background simulation operation on the target program.)
GlobalData (Use Redis client and server to exchange data between multiple ThinBasic processes)
SmWeb (The browser is emulated and is very versatile. It can manipulate all the elements in the browser and supports Internet Explorer and Google Chrome.)
Turing (A well-established text recognition library that can freely combine multiple techniques to pre-process images to identify text content in the image.)
Download:
Github:https://github.com/CN-xLeaves/LzRPA
Releases:https://github.com/CN-xLeaves/LzRPA/releases (Here you can download the program zip archive)
Finally, I am sorry for my English level. I am Chinese. The posts posted in this forum use Google Translate to express my meaning, and there may be deviations.
Future update plan:
Add a central control project template (The biggest difference between scripts and compiled languages is flexibility. Once the scripting language has the ability to be clustered or distributed, it can handle most tasks very flexibly, and its potential will increase exponentially. This is one of mines. The phased goal allows ThinBasic to easily develop multiple machine deployments, extension-loaded applications, and control the overall task on a single host computer.)
Reimplement the user interface editor (I hope that LzRPA is as easy to use as VB when making the interface. Drag and drop controls, select properties, and double-click to write event code. This is a big project that takes a long time to develop.)
Support more languages (Although the English version was released, the various data files of LzRPA add up to more than 1MB. I have not counted it, but it is very large in magnitude and will be bigger in the future, so there are still many places in the first English version that still use Chinese. I will be after The English version of these parts is gradually provided in the version. Similarly, LzRPA now has a multi-language mechanism, and it should support more programming languages in the future.)
Extended library online storeExtended library online store (I hope that in the future, the LzRPA project only needs to record the name of the extension library. At compile time, if the extension library does not exist on the machine, it will be automatically downloaded from the network and automatically updated to a backward compatible version. At the same time, users can also enter the store to select the extension library they need. Some developers can upload their own extended library to the store for others to download and use.)
Here, I will also announce the working mechanism of some components of LzRPA, so that everyone can eliminate concerns or personalize customization and extension of LzRPA.
TracePrint and log echo :
The TracePrint function is implemented in the setup\boot.tbs and setup\bootD.tbs files.
The bootD.tbs file is the version used for debugging runtime, and boot.tbs is the version used at compile time.
The contents of TracePrint output need to be sent to the IDE only during debugging, and the compiled program only needs to send the content to dbgview.
The implementation code is simple:
Sub TracePrint(ByVal sText As String)
OutputDebugString(sText)
Dim iFile As Long = UDP_FreeFile
Dim sIP As Long = IP_FromString("127.0.0.1")
UDP_Open(iFile)
UDP_Send(iFile, sIP, 21976, "msg#" & GetCurrentProcessId() & "#" & sText)
UDP_Close(iFile)
End Sub
This information is sent to the 21976 port of the machine, so what is the other end of the port?
When LzRPA starts, it will run bin\LogServer.exe at the same time.
Its code is as follows:
#include "xyapi.inc"
Uses "TCPUDP"
//Uses "Console"
Dim iFile As Long = UDP_FreeFile
If UDP_OpenServer(21976, iFile) = 0 Then
Dim IP As Long
Dim Port As Long
Dim sText As String
Dim sHead As String
Dim iPos As Long
Dim iPid As Long
Dim arrHead(2) As String
Dim pHash As Long = Hash_New(0)
Do
sText = UDP_Recv(iFile, IP, Port)
sHead = Left$(sText, 4)
//PrintL sText
Select Case sHead
Case "msg#"
iPos = InStr(5, sText, "#")
iPid = CLng(Mid$(sText, 5, iPos - 5))
sText = StrDelete(sText, 1, iPos)
Do
If Hash_Exists(pHash, CStr(iPid)) Then
// 分发消息
sHead = Hash_Get(pHash, CStr(iPid))
Split(sHead, ":", arrHead)
IP = CLng(arrHead(1))
Port = CLng(arrHead(2))
UDP_Send(iFile, IP, Port, sText)
//PrintL "分发消息 : ", IP_ToString(IP), Port, sText
Exit Do
Else
If iPid = PID_Parent(iPid) Then
// 未知去向的消息,输出到 dbgview
OutputDebugString(sText)
Exit Do
Else
iPid = PID_Parent(iPid)
If iPid = 0 Then
// 未知去向的消息,输出到 dbgview
OutputDebugString(sText)
Exit Do
End If
End If
End If
Loop
Case "test"
UDP_Send(iFile, IP, Port, "OK")
// PrintL "连通测试"
Case "set#"
Hash_Set(pHash, LTrim(sText, "set#"), IP & ":" & Port)
//PrintL "创建关联 : " & LTrim(sText, "set#")
Case "del#"
Hash_Del(pHash, LTrim(sText, "del#"))
//PrintL "删除关联 : " & LTrim(sText, "del#")
End Select
Loop
Else
MsgBox "灵智机器人日志服务器组件启动失败,请检查端口(21976)是否被占用!", %MB_ICONERROR, "灵智机器人"
End If
After this program starts, it will communicate with the IDE first, because LogServer.exe will only run one copy, and LzRPA may run multiple, so each IDE should be registered in LogServer.exe now, telling them the listening port and process PID. After LogServer.exe receives the message, it traverses the parent process PID to get the port to distribute the message to the correct IDE.
After the IDE receives the message, it displays the information in the log window.
Custom project template function:
The project template custom data is saved in the template\Option.json file, which is the Chinese custom template data. If the language is selected, the template definition data is in Option_% Language%.json, for example, the English version of the custom data is in Option_en.json.
The file structure is quite simple, they are json data, and it is easy to understand what they mean by comparing the content displayed by the new project interface.
[
{
"Caption": "Basic",
"Icon": "文件夹",
"Default": true,
"Child": [
{
"Caption": "Blank Project",
"Icon": "空项目",
"ProjName": "Project",
"WorkName": "Woorkspace",
"MakeFile": "ProjectMake.exe",
"MakeParam": "空白项目"
},
{
"Caption": "Standard Project",
"Icon": "标准项目",
"ProjName": "Project",
"WorkName": "Woorkspace",
"MakeFile": "ProjectMake.exe",
"MakeParam": "标准项目"
},
{
"Caption": "Console Project",
"Icon": "控制台项目",
"ProjName": "Project",
"WorkName": "Woorkspace",
"MakeFile": "ProjectMake.exe",
"MakeParam": "控制台项目"
},
{
"Caption": "Thread Project",
"Icon": "中控项目",
"ProjName": "Project",
"WorkName": "Woorkspace",
"MakeFile": "ProjectMake.exe",
"MakeParam": "多线程项目"
}
]
},
{
"Caption": "Central Control",
"Icon": "中控",
"Child": [
]
}
]
After entering the project interface and entering Create, LzRPA will create the project directory, generate the default project data, and then pass the permissions to the application specified in the MakeFile field. This program is of course stored in the template directory.
The default project template creator for LzRPA is ProjectMake.exe, whose source code is as follows:
Uses "File"
Dim sProjPath As String = Trim(OS_GetCommand(2), Any """")
Dim sProjName As String = Trim(OS_GetCommand(3), Any """")
Dim sParam As String = Trim(OS_GetCommand(4), Any """")
Dim sProjFile As String = sProjPath & "\" & sProjName & ".lzp"
' 创建子目录
Dir_Make(sProjPath & "\代码")
Dir_Make(sProjPath & "\资源")
Dir_Make(sProjPath & "\发布目录")
Dim Project_Library As String
Dim Project_Files As String
Dim Project_Icon As String
' 根据工程类型创建文件
Select Case sParam
Case "空白项目"
Project_Icon = "标准应用"
Project_Library = ""
Project_Files = "{""Path"": ""代码\\Main.tbs"", ""Open"": true}"
File_Copy(APP_ScriptPath & "app_gui.ico", sProjPath & "\资源\app.icon")
File_Copy(APP_ScriptPath & "空白项目.tbs", sProjPath & "\代码\Main.tbs")
Case "标准项目"
Project_Icon = "标准应用"
Project_Library = ""
Project_Files = "{""Path"": ""代码\\Main.tbs"", ""Open"": true}"
File_Copy(APP_ScriptPath & "app_gui.ico", sProjPath & "\资源\app.icon")
File_Copy(APP_ScriptPath & "Readme.txt", sProjPath & "\Readme.txt")
File_Copy(APP_ScriptPath & "标准项目.tbs", sProjPath & "\代码\Main.tbs")
Case "控制台项目"
Project_Icon = "控制台应用"
Project_Library = """Console"""
Project_Files = "{""Path"": ""代码\\Main.tbs"", ""Open"": true}"
File_Copy(APP_ScriptPath & "app_cui.ico", sProjPath & "\资源\app.icon")
File_Copy(APP_ScriptPath & "Readme.txt", sProjPath & "\Readme.txt")
File_Copy(APP_ScriptPath & "控制台项目.tbs", sProjPath & "\代码\Main.tbs")
Case "多线程项目"
Project_Icon = "标准应用"
Project_Library = """Redis"", ""RedisServer"", ""GlobalData"""
Project_Files = "{""Path"": ""代码\\Main.tbs"", ""Open"": true}"
File_Copy(APP_ScriptPath & "app_gui.ico", sProjPath & "\资源\app.icon")
File_Copy(APP_ScriptPath & "Readme.txt", sProjPath & "\Readme.txt")
File_Copy(APP_ScriptPath & "多线程项目.tbs", sProjPath & "\代码\Main.tbs")
File_Copy(APP_ScriptPath & "templet.redis.conf", sProjPath & "\发布目录\templet.redis.conf")
End Select
' 修改工程文件
Dim sProjText As String = File_Load(sProjFile)
Dim Project_Description As String = sProjName
Dim Project_AppPath As String = "发布目录"
Dim Build_File As String = sProjName & ".exe"
Dim Build_Icon As String = "资源\\app.icon"
sProjText = Expand$(sProjText)
File_Save(sProjFile, A2U(sProjText))
These are some simple file copy and modify operations. The OS_GetCommand(4) command gets the value of the MakeParam field in the json file.
Command Tree customization:
The files are in setup\command.json and document.json , and if you use the English version, the files should be changed to command_en.json and document_en.json.
Although the data volume of these two files is very large, but the structure is not complicated, a little understanding is very good, I will list the specific meaning of each field.
Caption (The name of the command displayed in the command tree)
Remark (a short description displayed in the command tree)
Icon (Icon displayed in the command tree)
Visible (Whether it is displayed in the command tree)
Function (Is this a function? If so then he will automatically join the list of grammar prompts, implement mouse hover prompts and auto-complete.)
InsCode (Double-click this command to insert the code into the LzRPA editor.)
InsCodeTop (Same as above, the code will be inserted at the beginning of the file)
InsCodeEnd (Same as above, the code will be inserted at the end of the file)
Templet (Help template, which is a file name in setup\Help, please don't put a suffix, the English version does not need to bring the following "_en")
Help (The data is packaged into a Json string and sent to the AiBot_Help function (JavaScript) of the web page template. After parsing the web page, it forms a help file. If the template is command, the data will be parsed by the IDE for auto-completion and hover prompts.)
10081
Add the extension library to LzRPA:
LzRPA's extended inventory is placed in the Modules directory, each folder is an extension library, CommandEdit.exe is the editor of the extension library Command.json, currently only the Chinese version, of course this program is open source, I will release soon An English version of the source code to the forum.
Within the extended library directory, you must have two files, command.json and setup.json.
Command.json has the same effect as command.json in the setup directory, which is used to add integrated help files to the command tree, as well as data sources that automate code writing such as auto-completion and hover prompts.
Its structure is similar to command.json in the setup directory. You can open and edit it with Modules\CommandEdit.exe.
Setup.json is the configuration file for the extension library. It is also a json file with only a few fields. I will explain the usefulness of these fields one by one.
Keyword1 (The keyword list is the ones in your extension library that need to be colored. This list is used to color the function.)
Keyword2 (The keyword list is the ones in your extension library that need to be colored. This list is used to color the data type.)
Keyword3 (The keyword list is the ones in your extension library that need to be colored. This list is used to color the constants.)
RelyFile (The dependency file of the extension library, which is an array, when its value is not null, these files will be copied to the correct location when compiling or testing the running project.)
PackFile (Which files will be packaged into the exe file and released at runtime. Currently, the corresponding function of this option has not been implemented, so it cannot be used.)
RelyCode (The code that extends the library depends on the code. I am used to writing it in boot.tbs. When the project debugs or compiles, the code will automatically add all the code before it.)
As you can see, the design idea of the extension library is to hope that the developer will hide the technical details, but still can carry out secondary development, and the end user can learn and use it more simply.
In the world we live in, we need more automation in the future. Before that, we should first automate the IDE.
Custom software configuration:
The LzRPA configuration file is stored in the setup\option.json file.
Here you can modify the editor's color, font and other properties, as well as the default keyword coloring configuration.
It's worth noting that there are several key options under the Option section.
AutoClearTracePrint (Whether to clear the previous log before running the script each time.)
CommandListView (The display mode of the command tree: 1 means only the command name; 2 means only the command description; 3 code first displays the command name, then displays the command description; 4 means the command description first, then the command name, the Chinese version defaults to this option. 3, so it seems that the command book is very clear, but the command list I only translated a part, so the English version defaults to 1)
Language (Is the language)
How to add my native language to LzRPA:
Language configuration files are stored in the setup\Language directory. Each json file is equivalent to a new language integration. The file structure can be referenced to en.json, which is the English language configuration file.
In addition to the language configuration of the user interface, you also need to translate the help documentation template (under the setup\Help directory), the command tree (command_%Language%.json and document_%Language%.json in the setup directory), and the extended library command tree ( Command.json for each extension library in the Modules directory).
LzRPA is highly integrated, which means that its amount of data is quite large, so it is difficult to support a new language, but software UI translation is not difficult.
After you have created your own native translation file, remember to modify the language configuration of setup\option.json.
Version 0.97 release:
0.96 originally supported the English user interface, but there are a lot of details to do it unsatisfactory, I concentrated on this aspect in one day.
No matter what version, the directory structure when creating the project is named in English.
Fixed translation issue with bubble prompts for building and running two buttons on the main window toolbar
Added translations for some locations, such as keyword bubble tips
The extension library now also supports loading multi-language command trees (command_en.json)
Command tree function icon update
The Function field in command.json is renamed to Keyword
Support for auto-completion and syntax hinting for more types of keywords is now supported
Keyword Bubbles now supports generating prompts based on different templates.
Keyword bubble hints now support more escapes and Html tags
Keyword bubbles encounter <br> when processing a parameter, add 8 indents, and add 4 indents to other items to ensure overall layout comfort
English multi-tasking warning translation
Insert some comments into the code to add an English translation
File directory structure adjustment, add the English version of the documentation readme.txt
The download address has not changed, it is still downloaded from github, and I uploaded the extension library command tree editor, which can also be downloaded from github.
CommandEdit (C# Source code):https://github.com/CN-xLeaves/LzRPA_CommandEdit