Posted: Sat Dec 28, 2013 3:03 am Post subject: Game exe attached confimation as "Game loaded" cap
What is the script for showing "Game loaded" when the game exe is started and "Game not loaded" when the process is not attached to the trainer?
I tried this
Code:
function onOpenProcess()
control_setCaption(MyForm.CELabel1, "Game Loaded")
It changes the caption of CELabel1 correctly when game is opened.
But how to make it change to "game not loaded" when game exe is not opened up/user exits the game.
Guess, a timer should be attached that continously checks whether game exe is attached or not and changes the caption accordingly.
check = createTimer(nil,false);
check.Interval = 1000;
check.onTimer = function () local SL=createStringlist(); getProcesslist(SL); for i=0,strings_getCount(SL)-1 do local entry = strings_getString(SL,i); local PID = tonumber('0x'..entry:sub(1,8)); if (getOpenedProcessID() == PID) then MyForm.CELabel1.Caption = "Game Loaded"; return; end end MyForm.CELabel1.Caption = "Game not Loaded" end
check.Enabled = true;
_________________
I'm rusty and getting older, help me re-learn lua.
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
Posted: Sat Dec 28, 2013 3:55 pm Post subject:
Here:
Code:
processname = "Cricket2013.exe"
if customOpenProcess~=nil then customOpenProcess.destroy(); customOpenProcess=nil end
customOpenProcess = createTimer(MyForm);
customOpenProcess.Interval = 100;
customOpenProcess.onTimer = function (timer)
local processExist = ( readInteger(processname)~=nil )
if not processExist then
MyForm.CELabel1.Caption='Game NOT LOADED.'
timer.Interval = 3000;
openProcess(processname)
else
MyForm.CELabel1.Caption='Game loaded.'
timer.Interval = 100;
end
end
With this code above, you can remove those lines (if exists):
- strings_add(getAutoAttachList(), "Cricket2013.exe")
- getAutoAttachList().add("Cricket2013.exe")
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