View previous topic :: View next topic |
Author |
Message |
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Wed Jan 25, 2017 6:25 am Post subject: Check & Ask For Active Injections On Close |
|
|
This is more of a annoyance then anything else. I have multiple times closed a CE window with Injections Active that resulted in having to restart the game.
Updated to allow for native CE onclose event to be handled.
--This event closes CE child windows, turns off speedhack & other things. Thanks to mgr.inz for the explanation of why "closeCE" doesnt do all this to begin with. Now if he would only remove the code in his second post. For the sake of confusion.
So Here is a lightweight simple extension to "Ask" what you want to do if
injections are active and the process is attached.
Some Argument info those Interested.
If a process is NOT ACTIVE attached this check wont run.
If you Cancel or Close on the "Ask" will return to Cheat Engine.
Does Not Check on Pointers only Scripts
Turns off Injections in Reverse Order. Child First then Parent.
Enjoi guys I hope this will be helpful
And A Snap Shot of the interface.
_________________
Last edited by akumakuja28 on Fri Jan 27, 2017 7:20 pm; edited 1 time in total |
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Wed Jan 25, 2017 11:12 am Post subject: |
|
|
Nice. Here I slightly changed it (also should have better readability).
Code: | --------------------------------------------------------------------------------
---------- Cheat Engine Check For Active Scripts ------------------------------
--------------------------------------------------------------------------------
-- store orig onClose so CE can properly free some resources
local Ask_Cheats_Off_OrigOnClose = getMainForm().OnClose
local function Ask_Cheats_Off(sender)
local openedProcess = string.sub(getMainForm().ProcessLabel.Caption,10)
local list = getAddressList()
local D = {} -- Table for display (active AA scripts only)
-- check if there is opened process
if readInteger(openedProcess) == nil then Ask_Cheats_Off_OrigOnClose(sender); return caFree end
for i=0,list.Count-1 do
if list[i].Active and (list[i].Type == vtAutoAssembler) then
D[1+#D] = list[i].Description
end
end
if #D > 0 then -- there are active AA scripts
local A = messageDialog(#D.." scripts are still active:\n\n"..table.concat (D,'\n')..
"\n\nDo you wish to deactivate them before close?", mtConfirmation, mbYes, mbNo, mbCancel)
if A == mrYes then
for i=list.Count-1,0,-1 do
list[i].Active = false -- deactivate (and also unfreeze, but, we do not care)
end
Ask_Cheats_Off_OrigOnClose(sender)
return caFree
elseif A == mrNo then
Ask_Cheats_Off_OrigOnClose(sender)
return caFree
end
else -- no active AA script(s)
Ask_Cheats_Off_OrigOnClose(sender)
return caFree
end
end
getMainForm().OnClose = Ask_Cheats_Off |
Edit:
make use of original onClose (so CE can properly free some resources) _________________
Last edited by mgr.inz.Player on Fri Jan 27, 2017 3:01 pm; edited 2 times in total |
|
Back to top |
|
|
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Wed Jan 25, 2017 2:00 pm Post subject: |
|
|
Thank You but that is not easier to read. Only the open process is easier to understand.
I have a PM box. _________________
|
|
Back to top |
|
|
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Wed Jan 25, 2017 3:01 pm Post subject: |
|
|
Hate to have them indentations right notepad++ and not right for CE. That could confuse alot people.
D[1+#D] <---- tht was slick thou i like tht. Please just PM though if feel you would like help me out in learning LUA. _________________
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Wed Jan 25, 2017 3:10 pm Post subject: |
|
|
Quote: | right notepad++ and not right for CE |
Not right for CE? PS: I will try to remember to send you PM next time. _________________
|
|
Back to top |
|
|
|