| View previous topic :: View next topic |
| Author |
Message |
PurpleZ How do I cheat?
Reputation: 0
Joined: 28 Nov 2022 Posts: 2
|
Posted: Mon Nov 28, 2022 6:16 am Post subject: Check if game is active |
|
|
Thanks for the great board it helps me many times
I have wirte a Trainer for Titan Quest but if i write a code to check if the game.exe is active...
... the problem is that after open the Trainer is instantly ONLINE
With other Programs like calc.exe it works only not with TQ.exe
| Code: |
getAutoAttachList().add("TQ.exe")
gPlaySoundOnAction=false
test.show()
local timer = createTimer(nil, false)
timer.OnTimer = function(timer)
if OpenProcess("TQ.exe") then
test.CELabel2.Caption = "ONLINE"
test.CELabel2.Font.Color = clLime
else
test.CELabel2.Caption = "OFFLINE"
test.CELabel2.Font.Color = clRed
end
end
timer.Interval = 1000
timer.Enabled = true
|
|
|
| Back to top |
|
 |
Frouk Grandmaster Cheater
Reputation: 5
Joined: 22 Jun 2021 Posts: 510
|
Posted: Mon Nov 28, 2022 8:22 am Post subject: Re: Check if game is active |
|
|
| PurpleZ wrote: | Thanks for the great board it helps me many times
I have wirte a Trainer for Titan Quest but if i write a code to check if the game.exe is active...
... the problem is that after open the Trainer is instantly ONLINE
With other Programs like calc.exe it works only not with TQ.exe
| Code: |
getAutoAttachList().add("TQ.exe")
gPlaySoundOnAction=false
test.show()
local timer = createTimer(nil, false)
timer.OnTimer = function(timer)
if OpenProcess("TQ.exe") then
test.CELabel2.Caption = "ONLINE"
test.CELabel2.Font.Color = clLime
else
test.CELabel2.Caption = "OFFLINE"
test.CELabel2.Font.Color = clRed
end
end
timer.Interval = 1000
timer.Enabled = true
|
|
| Code: |
function IsAttachedTo(procName)
local stat = {
ATTACH_PROCESS_NOT_DETECTED = 0,
ATTACH_PROCESS_DETECTED = 1,
ATTACH_PROCESS_ATTACHED = 2,
}
local status = GetProcessStatus(procName)
return status == stat.ATTACH_PROCESS_ATTACHED
end
function IsAttached()
return IsAttachedTo("GAME.exe")
end
function GetProcessStatus(procName)
local stat = {
ATTACH_PROCESS_NOT_DETECTED = 0,
ATTACH_PROCESS_DETECTED = 1,
ATTACH_PROCESS_ATTACHED = 2,
}
if getProcessIDFromProcessName(procName) == getOpenedProcessID() then
return stat.ATTACH_PROCESS_ATTACHED
elseif getProcessIDFromProcessName(procName) == 0 or getProcessIDFromProcessName(procName) == nil then
return stat.ATTACH_PROCESS_NOT_DETECTED
elseif getProcessIDFromProcessName(procName) ~= 0 then
return stat.ATTACH_PROCESS_DETECTED
end
end
function AttachTo(procName)
local stat = {
ATTACH_PROCESS_NOT_DETECTED = 0,
ATTACH_PROCESS_DETECTED = 1,
ATTACH_PROCESS_ATTACHED = 2,
}
local status = GetProcessStatus(procName)
if status == stat.ATTACH_PROCESS_NOT_DETECTED then
return false
elseif status == stat.ATTACH_PROCESS_ATTACHED then
return true
elseif status == stat.ATTACH_PROCESS_DETECTED then
openProcess(procName)
return true
end
end
function Attach()
return AttachTo('GAME.exe')
end |
use those functions that i made and implement it in your code
|
|
| Back to top |
|
 |
PurpleZ How do I cheat?
Reputation: 0
Joined: 28 Nov 2022 Posts: 2
|
Posted: Mon Nov 28, 2022 9:43 am Post subject: |
|
|
Thanks for your help. I found the issue!
the script is looking for a process called TQ.exe
The name of the trainer is "trainer_tq.exe" the script find a process with tq.exe in the name.
i renamed my trainer and now it works :p
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25813 Location: The netherlands
|
Posted: Tue Nov 29, 2022 5:16 am Post subject: |
|
|
| Code: |
if readInteger(process)==nil then showMessage('process is closed') end
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
|