Difference between revisions of "Lua:debugger onBreakpoint"

From Cheat Engine
Jump to navigation Jump to search
m
 
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
 
'''function debugger_onBreakpoint'''()
 
'''function debugger_onBreakpoint'''()
  When a breaking breakpoint hits (that includes single stepping) and the lua function debugger_onBreakpoint() is defined it will be called and the global variables EAX, EBX, .... will be filled in
+
 
  Return 0 if you want the userinterface to be updated and anything else if not (e.g You continued from the breakpoint in your script)
+
When a breaking breakpoint hits (that includes single stepping) and the lua function debugger_onBreakpoint() is defined it will be called and the global variables EAX, EBX, .... will be filled in.
 +
 
 +
Return 0 if you want the user interface to be updated and anything else if not (e.g You continued from the breakpoint in your script).
  
 
<pre>
 
<pre>

Latest revision as of 09:07, 22 June 2020

function debugger_onBreakpoint()

When a breaking breakpoint hits (that includes single stepping) and the lua function debugger_onBreakpoint() is defined it will be called and the global variables EAX, EBX, .... will be filled in.

Return 0 if you want the user interface to be updated and anything else if not (e.g You continued from the breakpoint in your script).

Example:

function debugger_onBreakpoint()

  local value=EAX
  if (value ==0x0C93E004 ) then  -- break condition
    return 0                     --break
  else
    return 1                     -- continue without breaking
  end
end

debug_setBreakpoint(0x0040CEA6)  -- called if the above condition is true. And it will set breakpoint at 0x0040CEA6


See also[edit]