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 _________________
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