Auto attaches to the process matching "processName"

A forum dedicated to use and support LUA for Cheat Engine.


Post Reply
User avatar
bbfox
Table Master
Table Master
Journeyman Hacker
Journeyman Hacker
Posts: 365
Joined: Sat Jul 23, 2022 8:59 am
Answers: 0
x 772

Auto attaches to the process matching "processName"

Post by bbfox »

Code: Select all

local targetProcessName = "Game.exe"

local function autoAttach()
  local timer = createTimer()
  timer.Interval = 1000
  timer.OnTimer = function()
    if getProcessIDFromProcessName(targetProcessName) ~= nil then
      openProcess(targetProcessName)
      print("Attached to: " .. targetProcessName)
      timer.destroy()
    end
  end
end

--autoAttach()


Post Reply