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 


I'm doubtful about "memoryrecord_freeze"

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
richardnunes
How do I cheat?
Reputation: 0

Joined: 12 Feb 2017
Posts: 2

PostPosted: Sun Feb 12, 2017 11:00 pm    Post subject: I'm doubtful about "memoryrecord_freeze" Reply with quote

I have a script that every X seconds changes the value of an address, but my game sometimes ends up changing that value too.

Using the "activate" box I can lock the value so that my game can not change it, but doing so my script also can not change the value anymore.

I tried using the "memoryrecord_freeze" and "memoryrecord_unfreeze" commands and they even managed to lock it through the script, but it also ends up blocking changes to values made by the script.

Is there any way for my script to make changes and at the same time block changes made by my game?
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Mon Feb 13, 2017 5:10 am    Post subject: Reply with quote

CE has a feature to copy the value of a memory record (SHADOW MR) to another freezing memory record (TARGET MR).
To do this manually:

1. make sure both TARGET MR and SHADOW MR address is valid, ie. not showing ?? etc.
2. freeze TARGET MR,
3. set Value of TARGET MR to SHADOW MR's Description surrounded by ().
4. SHADOW MR don't need to freeze
5. SHADOW MR's description should be unique

now any update on SHADOW MR will be transfer to TARGET MR.

if TARGET MR is unfroze, step 3 has to make again to have same effect.

For OP case, may alloc some memory and set the address to a SHADOW MR, then update value on SHADOW MR when step 3 has effect.

The attached ct has a sample to do it by lua script.
To test, attach some process, activate 1st mr, open memory view at address __
Update at __+10 will transfer to __+20.

bye~

ADDED:
I'm not sure when CE has this feature, should be at least work for ce 6.5+.



shadowFreeze.CT
 Description:

Download
 Filename:  shadowFreeze.CT
 Filesize:  2.28 KB
 Downloaded:  722 Time(s)


_________________
- Retarded.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Feb 13, 2017 4:22 pm    Post subject: Reply with quote

Intead of freezeing address, you can use such Lua script (embedded in AA script):
Code:
[ENABLE]
{$Lua}
if syntaxcheck then return end

if FreezeHealthTimer==nil then
  FreezeHealthTimer=createTimer(nil,false)
end

FreezeHealthTimer.Interval = 50
local readInteger,writeInteger=readInteger,writeInteger
FreezeHealthTimer.setOnTimer(
  function ()
    local val = readInteger('addressOfMAXHealth')
    if val then
      writeInteger('addressOfHealth', val)
    end
  end
)

FreezeHealthTimer.Enabled = true
{$Asm}

[DISABLE]
{$Lua}
if syntaxcheck then return end
FreezeHealthTimer.Enabled = false
{$Asm}


Of course you can use readFloat or readDouble instead of readInteger

_________________
Back to top
View user's profile Send private message MSN Messenger
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