Difference between revisions of "Lua:onOpenProcess"

From Cheat Engine
Jump to navigation Jump to search
(Created page with 'Category:Lua '''event''' onOpenProcess(''processId'') If this function is defined it will be called whenever cheat engine opens a process. :Note: The same process might be o…')
 
m (Reverted edits by This content is not available (Talk) to last revision by TheyCallMeTim13)
 
(3 intermediate revisions by 2 users not shown)
Line 20: Line 20:
 
<pre>
 
<pre>
 
function onOpenProcess(processId)
 
function onOpenProcess(processId)
print(string.format('Process opened: %d', processId))
+
    print(string.format('Process opened: %d', processId))
 
end
 
end
 
</pre>
 
</pre>
Line 32: Line 32:
 
* [[Lua:getProcessIDFromProcessName|getProcessIDFromProcessName]]
 
* [[Lua:getProcessIDFromProcessName|getProcessIDFromProcessName]]
 
* [[Lua:createProcess|createProcess]]
 
* [[Lua:createProcess|createProcess]]
 +
* [[Lua:openFileAsProcess|openFileAsProcess]]

Latest revision as of 19:07, 18 March 2019

event onOpenProcess(processId)

If this function is defined it will be called whenever cheat engine opens a process.

Note: The same process might be opened multiple times in a row internally
Note: This function is called before attachment is fully done. You can call reinitializeSymbolhandler() to force the open to complete, but it will slow down process opens. Alternatively, you could launch a timer which will run when the opening has finished

Function Parameters[edit]

Parameter Type Description
processId number The ID of the process that was opened

Examples[edit]

function onOpenProcess(processId)
    print(string.format('Process opened: %d', processId))
end

See also[edit]

Related Functions[edit]