LUA Auto Attach to Process

TheyCallMeTim13

Wiki Monster
Talents
Fearless Donors
Mar 3, 2017
418
46
28
#1
https://forum.cheatengine.org/viewtopic.php?t=529853&sid=2e3817b3d8c461b1d0e678a28f30c4ac
https://wiki.cheatengine.org/index.php?title=Tutorials:Lua:Setup_Auto_Attach
Lua:
--------
-------- Auto Attach to Process
--------
PROCESS_NAME = 'Game.exe'
local autoAttachTimer = nil
local autoAttachTimerInterval = 100
local autoAttachTimerTicks = 0
local autoAttachTimerTickMax = 5000

local function autoAttachTimer_tick(timer)
    if getProcessIDFromProcessName(PROCESS_NAME) ~= nil then
        timer.destroy()
        openProcess(PROCESS_NAME)
    elseif autoAttachTimerTickMax > 0 and autoAttachTimerTicks >= autoAttachTimerTickMax then
        timer.destroy()
    end
    autoAttachTimerTicks = autoAttachTimerTicks + 1
end

autoAttachTimer = createTimer(MainForm)
autoAttachTimer.Interval = autoAttachTimerInterval
autoAttachTimer.OnTimer = autoAttachTimer_tick
 
Last edited:
Top Bottom