Posted: Sun Oct 25, 2015 2:32 pm Post subject: Script that executes once process is found
Hi, could anyone hook me up or create a basic Lua code what automaticly, instantly executes a script once a process has been found? Everytime I start the game it shall execute "showMessage("Process found!") even when I re-open the game, so I don't have to close CE and execute again.
function onOpenProcess(processid)
showMessage("Proccess ID " .. tostring(processid) .. " Found!")
end
This function is called before attachment is fully done, so you could call reinitializeSymbolhandler() to force attachment to complete if needed. It could also run more than once, so be warned.
If you want CE to find a certain process automatically, then add this:
Code:
gameName = "certain_game.exe"
function checkForProcess()
if getOpenedProcessID() ~= getProcessIDFromProcessName(gameName) then
openProcess(gameName)
end
end
if openProcessT and openProcessT.destroy then openProcessT.destroy() end
openProcessT = nil
openProcessT = createTimer(nil,true)
openProcessT.setInterval(1000)
openProcessT.setOnTimer(checkForProcess)
_________________
I don't know where I'm going, but I'll figure it out when I get there.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum