View previous topic :: View next topic |
Author |
Message |
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
|
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 |
|
|
|