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 


Conditional Commands

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

Joined: 14 Apr 2018
Posts: 8

PostPosted: Sat Apr 14, 2018 5:44 pm    Post subject: Conditional Commands Reply with quote

Not sure if this was answered before but I checked a few other topicd and not a single one of those that I checked answered my question or what I needed.

My question would be, how can I allow Cheat Engine to change a value when a specific value is being written to an address? For example I want the value at the address 2091E019 to be 04 when the address of 20A2BC31 gets the value 32. What if I want two conditions or more in order to change the value stored some where else. Thanks to whoever wants to be of help.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sat Apr 14, 2018 5:53 pm    Post subject: Reply with quote

Use Lua.
Code:
if readInteger(0x20A2BC31) == 32 then
  writeInteger(0x2091E019, 4)
end

A timer can periodically call this code. If the value changes often and you don't want to miss it, put the code in a callback to a breakpoint.

Code injection is also an option.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
TheRunner
How do I cheat?
Reputation: 0

Joined: 14 Apr 2018
Posts: 8

PostPosted: Sat Apr 14, 2018 8:46 pm    Post subject: Reply with quote

That did what I wanted it to do, but I wonder if there is a way to keep this code running? For example I want it to replace the value at that address each and every time that 32 is being written, without having to click for it.
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sat Apr 14, 2018 8:54 pm    Post subject: Reply with quote

TheRunner wrote:
That did what I wanted it to do, but I wonder if there is a way to keep this code running? For example I want it to replace the value at that address each and every time that 32 is being written, without having to click for it.

ParkourPenguin wrote:
...A timer can periodically call this code. If the value changes often and you don't want to miss it, put the code in a callback to a breakpoint.

Code injection is also an option.


http://wiki.cheatengine.org/index.php?title=Lua:Class:Timer

http://wiki.cheatengine.org/index.php?title=Lua#Debugger

http://wiki.cheatengine.org/index.php?title=Tutorials:Auto_Assembler:Injection_full

_________________
Back to top
View user's profile Send private message Visit poster's website
TheRunner
How do I cheat?
Reputation: 0

Joined: 14 Apr 2018
Posts: 8

PostPosted: Sat Apr 14, 2018 8:58 pm    Post subject: Reply with quote

I never used Lua before, so I am hoping that I can see how the full code would look like with the timer. I would not know at what part to place the timer.
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sat Apr 14, 2018 9:34 pm    Post subject: Reply with quote

http://wiki.cheatengine.org/index.php?title=Lua_Basics
_________________
Back to top
View user's profile Send private message Visit poster's website
TheRunner
How do I cheat?
Reputation: 0

Joined: 14 Apr 2018
Posts: 8

PostPosted: Sat Apr 14, 2018 10:13 pm    Post subject: Reply with quote

Can you stop sending me to links? All I need is what I asked, I have seen these before but I cannot seem to follow them.
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 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