Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Disable a MemoryRecord without executing the disable part

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 77

PostPosted: Mon Jul 13, 2015 11:55 am    Post subject: Disable a MemoryRecord without executing the disable part Reply with quote

Hi.

If i use openProcess() to reopen a closed process, the enabled MemoryRecord's stay active. If i change active to false, the disable part get execute. How can i cheange it to false without executing the disable part??

greez from gunny
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Jul 13, 2015 5:11 pm    Post subject: Reply with quote

Code:
local script = record.Script
record.Script = nil
record.Active = false
record.Script = script

or
Code:
if STOP_EXECUTION == true then
  assert(false)
end
...
openProcess()
STOP_EXECUTION = true
for each_record do
  record.Active = false
end
STOP_EXECUTION = false
Back to top
View user's profile Send private message
sir-gunny
Advanced Cheater
Reputation: 0

Joined: 15 Mar 2012
Posts: 77

PostPosted: Wed Jul 15, 2015 10:18 am    Post subject: Reply with quote

Zanzer wrote:
Code:
if STOP_EXECUTION == true then
  assert(false)
end
...
openProcess()
STOP_EXECUTION = true
for each_record do
  record.Active = false
end
STOP_EXECUTION = false


I dont understand this code. Can you explain it to me please?

EDIT:

Do you mean somethink like this:?
Code:
function _blub()
 local AddressList = getAddressList()
 local MemRecCount = AddressList.Count
 local STOP_EXECUTION, MemRec
 local iProcessName = getProcessIDFromProcessName("calc.exe")
 openProcess(iProcessName)
 for i=0, MemRecCount-1 do
     MemRec = AddressList.getMemoryRecord(i)
     if MemRec.Active == true then
        assert(false,i+1)
     end
 end
end
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Wed Jul 15, 2015 4:54 pm    Post subject: Reply with quote

Code:
function _blub()
 local AddressList = getAddressList()
 local MemRecCount = AddressList.Count
 local MemRec
 local iProcessName = getProcessIDFromProcessName("calc.exe")
 openProcess(iProcessName)
 for i=0, MemRecCount-1 do
     MemRec = AddressList.getMemoryRecord(i)
     if MemRec.Active == true then
        local script = MemRec.Script
        MemRec.Script = nil
        MemRec.Active = false
        MemRec.Script = script
     end
 end
end
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites