Difference between revisions of "Lua:autoAssemble"

From Cheat Engine
Jump to navigation Jump to search
(Related Functions)
Line 1: Line 1:
'''function''' autoAssemble(''AutoAssemblerScript'', ''TargetSelf'' OPTIONAL)
+
'''function''' autoAssemble(''AutoAssemblerScript'', ''TargetSelf'' OPTIONAL) ''':''' nil '''-''' boolean
  
 
Runs the given string with Cheat Engine's auto assembler. Returns 'true' on success.
 
Runs the given string with Cheat Engine's auto assembler. Returns 'true' on success.

Revision as of 02:13, 11 March 2017

function autoAssemble(AutoAssemblerScript, TargetSelf OPTIONAL) : nil - boolean

Runs the given string with Cheat Engine's auto assembler. Returns 'true' on success.

Tip: Use '[[ ]]' or '[==[ ]==]' quotes for multiline script.

Function Parameters

Parameter Type Description
AutoAssemblerScript string The script to run with Cheat Engine's auto assembler
TargetSelf boolean If set it will assemble into Cheat Engine itself


Examples

 autoAssemble("{$lua}\n print('Printed Form Auto Assembler Script!')")


 local scriptStr = [==[
   alloc(memExample)
   label(returnHere)
    
   memExample:
     mov eax,123
     jmp returnHere
    
   00400500:
     jmp memExample
     returnHere:
 ]==]
  
 if autoAssemble(scriptStr) then
   print('The auto assembler script was successful.')
 else
   print('There was an error with the auto assembler script.')
 end


 local scriptStr = [==[
   alloc(memExample2)
   memExample2:
     dd (float)364.12458729
     dd (float)12.65594753
     dd (float)50.75331054
     dd 0
     // player base
     dq 0
     // map base
     dq 0
 ]==]
  
 if not autoAssemble(scriptStr, true) then
   return 1, 'There was an error with the auto assembler script.'
 end


See also

Related Functions