Lua:autoAssembleCheck

From Cheat Engine
Revision as of 00:18, 5 December 2025 by Leunsel (talk | contribs) (Added CodeBox Template.)
Jump to navigation Jump to search
<> 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