Difference between revisions of "Lua:autoAssembleCheck"
Jump to navigation
Jump to search
(→Related Functions) |
m (Added CodeBox Template.) |
||
| Line 1: | Line 1: | ||
[[Category:Lua]] | [[Category:Lua]] | ||
| − | + | {{CodeBox|'''function''' autoAssembleCheck(''text'', ''enable'', ''targetself'')}} | |
| − | '''function''' autoAssembleCheck('' | ||
| − | Checks the script for syntax errors. Returns true on | + | Checks the given Auto Assembler script for syntax errors. |
| − | + | Returns '''true''' on success, or '''false''' with an error message on failure. | |
| − | |||
=== Function Parameters === | === Function Parameters === | ||
| − | + | {|width="85%" cellpadding="5%" cellspacing="0" border="0" | |
| − | {|width="85 | ||
!align="left"|Parameter | !align="left"|Parameter | ||
!align="left"|Type | !align="left"|Type | ||
| − | ! | + | !align="left"|Description |
|- | |- | ||
| − | | | + | | text |
| − | | | + | | String |
| − | |The script to | + | | The Auto Assembler script to validate. |
|- | |- | ||
| − | | | + | | enable |
| − | | | + | | Boolean |
| − | |If | + | | If set, checks the [ENABLE] part of the script. |
|- | |- | ||
| − | | | + | | targetself |
| − | | | + | | Boolean |
| − | |If | + | | If true, checks the script as if assembling into Cheat Engine itself. |
|} | |} | ||
| + | === Example === | ||
| + | <pre> | ||
| + | local script = [[ | ||
| + | alloc(newmem,1024) | ||
| + | label(returnhere) | ||
| + | ... | ||
| + | ]] | ||
| − | + | local ok, err = autoAssembleCheck(script, true, false) | |
| − | + | if ok then | |
| − | + | print("Script is valid") | |
| − | + | else | |
| − | + | print("Syntax error:", err) | |
| − | + | end | |
| − | + | </pre> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
| − | + | {{Assembly}} | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Revision as of 00:18, 5 December 2025
| <> Function function autoAssembleCheck(text, enable, targetself) |
Checks the given Auto Assembler script for syntax errors. Returns true on success, or false with an error message on failure.
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| text | String | The Auto Assembler script to validate. |
| enable | Boolean | If set, checks the [ENABLE] part of the script. |
| targetself | Boolean | If true, checks the script as if assembling into Cheat Engine itself. |
Example
local script = [[
alloc(newmem,1024)
label(returnhere)
...
]]
local ok, err = autoAssembleCheck(script, true, false)
if ok then
print("Script is valid")
else
print("Syntax error:", err)
end
See also
| Lua |
| Script Engine |
Related Functions
| autoAssemble |
| autoAssembleCheck |
| disassemble |
| splitDisassembledString |
| getInstructionSize |
| getPreviousOpcode |
| registerAssembler |
| unregisterAssembler |