Page 1 of 1

Auto attaches to the process matching "processName"

Posted: Sat Aug 20, 2022 9:10 pm
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()