Posted: Wed Sep 11, 2019 2:53 pm Post subject: Enabling my scripts every time it auto attaches to the game
So auto attach already is super useful. However, when the game auto attaches and my scripts are enabled it doesn't actually change anything in the game. Is there a way to make it so that after about 30 seconds or so after the game is attached the scripts will enable themselves?
t1.OnTimer = function()
openProcess("chrome.exe")
if openProcess then
l1.caption = "chrome.exe ON!"
t1.Enabled=false
t2.Enabled=true
else
t1.Enabled=true
end
end
function Hack1(sender)
local l2 = createLabel(form)
l2.Left = 88
l2.Top = 75
l2.Font.Style = "fsBold"
l2.Font.Size = 14
l2.caption = "Hack1 Enabled!"
end
function Hack2(sender)
local l3 = createLabel(form)
l3.Left = 88
l3.Top = 100
l3.Font.Style = "fsBold"
l3.Font.Size = 14
l3.caption = "Hack2 Enabled!"
end
function Hack3(sender)
local l4 = createLabel(form)
l4.Left = 88
l4.Top = 125
l4.Font.Style = "fsBold"
l4.Font.Size = 14
l4.caption = "Hack3 Enabled!"
end
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
Posted: Thu Sep 12, 2019 3:18 am Post subject:
There is the onProcessOpen event you can use to do your executions when the process is attached to.
Code:
function onOpenProcess(processid):
If this function is defined it will be called whenever cheat engine opens a process.
Note: The the same process might be opened multiple times in a row internally
Note 2: This function is called before attachment is fully done. You can call reinitializeSymbolhandler() to force the open to complete, but it will slow down process opens. Alternatively, you could launch a timer which will run when the opening has finished
As the notes say you can force symbol collection to finish to prevent lookup errors.
You can use other exposed Lua functions to ensure the processid is owned by the specific process you are targeting as well. Check the 'celua.txt' inside of Cheat Engines parent folder for more info on the Lua engine. _________________
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