Posted: Mon Sep 19, 2016 7:21 am Post subject: Game State in label
Hi.
I can anyone help me to complete this script with timer (I mean is that when game is running timer type in label "game is running" and when game is not running timer type in label "game is not running")
Code:
if openProcess("game.exe") then
CETrainer.StateLabel.caption = "Game is running"
else
CETrainer.StateLabel.caption = "game is not running"
end
-- this is for ce 6.5+
CheckTimer = CheckTimer or createTimer()
CheckTimer.Interval = 5000
CheckTimer.OnTimer = function(tm)
local target = 'game' -- change according to name check method below
local attached = GetProcessList()[GetOpenedProcessID()]
local isTarget = attached and attached:lower():match(target:lower())
-- for more restricted checking use
--local isTarget = attached and attached==target
-- target has to set exactly
local state
if not attached then
state = 'Trainer is not attached to a process'
elseif not isTarget then
state = 'Trainer is attached to a different process: '..process
else
state = process .. ' is running'
end
GetMainForm().Caption = state -- change 'GetMainForm()' to your ui
end
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