Difference between revisions of "Lua:registerAutoAssemblerTemplate"

From Cheat Engine
Jump to navigation Jump to search
(Created page with 'Category:Lua '''function''' registerAutoAssemblerTemplate(''name'',''function'') Registers a template to be used with the auto assembler window template menu Returns an ID …')
 
m (Reverted edits by This content is not available (Talk) to last revision by Dark Byte)
 
(4 intermediate revisions by 2 users not shown)
Line 19: Line 19:
 
|-
 
|-
 
|function
 
|function
|function(script, sender): ID
+
|function(script, sender)
 
|The function called when the user picks the script.  (script is a StringList object. sender is a frmAutoInject object)
 
|The function called when the user picks the script.  (script is a StringList object. sender is a frmAutoInject object)
 
|}
 
|}
 
  
 
== Examples ==
 
== Examples ==
 
  registerAutoAssemblerTemplate('Better AOBScan script generator',function(script, sender)
 
  registerAutoAssemblerTemplate('Better AOBScan script generator',function(script, sender)
 
   print("Do something with the script")
 
   print("Do something with the script")
 +
  script.add('//this is added by my script. Your script was '..script.Count..' lines long before this was added')
 +
  script.add(string.format("//%.8x is the address you had selected in the disassembler", getMemoryViewForm().DisassemblerView.SelectedAddress))
 
  end )
 
  end )
 
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}

Latest revision as of 15:08, 18 March 2019

function registerAutoAssemblerTemplate(name,function)

Registers a template to be used with the auto assembler window template menu

Returns an ID you can use with unregisterAutoAssemblerTemplate


Function Parameters[edit]

Parameter Type Description
name String The command string it self
function function(script, sender) The function called when the user picks the script. (script is a StringList object. sender is a frmAutoInject object)

Examples[edit]

registerAutoAssemblerTemplate('Better AOBScan script generator',function(script, sender)
 print("Do something with the script")
 script.add('//this is added by my script. Your script was '..script.Count..' lines long before this was added')
 script.add(string.format("//%.8x is the address you had selected in the disassembler", getMemoryViewForm().DisassemblerView.SelectedAddress))
end )

See also[edit]

Related Functions[edit]