[Lua] Auto Attach to Process

Section's for general approaches on hacking various options in games. No online-related discussions/posts OR warez!
Post Reply
User avatar
TheyCallMeTim13
Administration
Administration
Posts: 980
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 154
Contact:

[Lua] Auto Attach to Process

Post by TheyCallMeTim13 » Tue Apr 17, 2018 3:41 am

https://forum.cheatengine.org/viewtopic ... a28f30c4ac
https://wiki.cheatengine.org/index.php? ... uto_Attach

Code: Select all

--------
-------- 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 by TheyCallMeTim13 on Wed May 02, 2018 6:35 am, edited 8 times in total.

Post Reply

Who is online

Users browsing this forum: No registered users