Difference between revisions of "Auto Assembler:LUA ASM"

From Cheat Engine
Jump to navigation Jump to search
(See also)
 
(One intermediate revision by one other user not shown)
Line 22: Line 22:
 
  -- This is Lua code.
 
  -- This is Lua code.
 
  print('Hello')
 
  print('Hello')
 +
if memrec then
 +
  print('This is memoryrecord '..memrec.description)
 +
end
 
  {$asm}
 
  {$asm}
 
  // This is Auto Assembler code
 
  // This is Auto Assembler code
 
  00123ABC:
 
  00123ABC:
 
   db 90 90 90
 
   db 90 90 90
 
  
 
== See also ==
 
== See also ==
 
* [[Cheat_Engine:Auto Assembler|Auto Assembler]]
 
* [[Cheat_Engine:Auto Assembler|Auto Assembler]]
 +
* [[Auto_Assembler:Commands|Auto Assembler Commands]]
  
 
=== Related Commands ===
 
=== Related Commands ===

Latest revision as of 00:31, 13 January 2018

Auto Assembler {$lua}

Auto Assembler {$asm}

Auto assembler scripts support section written in Lua.You can start such a section using the {$lua} keyword, and end it with {$asm}. The return value of such a function (if it returns a value at all) will be interpreted as normal auto assembler commands. When syntax checking, the lua sections get executed. To make sure your lua script behaves properly in those situations, check the "syntaxcheck" boolean. If it's true, then do not make permanent changes. e.g:

if syntaxcheck then return end

Of course, if your script is meant to generate code, do make it return code so that it passes the initial syntax check. (e.g label definitions etc...)

Command Parameters[edit]

<none>


Examples[edit]

{$lua}
-- This is Lua code.
print('Hello')
if memrec then
  print('This is memoryrecord '..memrec.description)
end
{$asm}
// This is Auto Assembler code
00123ABC:
  db 90 90 90

See also[edit]

Related Commands[edit]