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 codes

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Meiyoh
Master Cheater
Reputation: 1

Joined: 14 Mar 2015
Posts: 402

PostPosted: Fri Sep 25, 2015 9:37 am    Post subject: Conditional codes Reply with quote

How to make conditional codes

Say

If value on address 12345678 equal to 2C then execute code / cheat
if Value on address 12345678 less than 2C then execute code / cheat

etc

You know what I mean.
Thanks.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4706

PostPosted: Fri Sep 25, 2015 11:58 am    Post subject: Reply with quote

Pretty sure these should work.

Example in assembly:
Code:
[ENABLE]
alloc(newmem, 100)
label(lessthan)
label(return)

registersymbol(newmem)

newmem:
  mov eax, 12345678
  cmp [eax],2C
  jl lessthan
  jne return
  //code to execute if they're equal
  //example:
  luacall(equalCheat())
  jmp return
lessthan:
  //code to execute if value at 12345678 is less than 2C
  //example:
  luacall(lessThanCheat())
return:

[DISABLE]
unregistersymbol(newmem)
dealloc(newmem)


Example in Lua:
Code:
bytes = readBytes(0x12345678,1)
if bytes == 0x2C then
   --do cheats here
elseif bytes < 0x2C then
   --do cheats here
end

_________________
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
Meiyoh
Master Cheater
Reputation: 1

Joined: 14 Mar 2015
Posts: 402

PostPosted: Fri Sep 25, 2015 2:31 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Pretty sure these should work.

Example in assembly:
Code:
[ENABLE]
alloc(newmem, 100)
label(lessthan)
label(return)

registersymbol(newmem)

newmem:
  mov eax, 12345678
  cmp [eax],2C
  jl lessthan
  jne return
  //code to execute if they're equal
  //example:
  luacall(equalCheat())
  jmp return
lessthan:
  //code to execute if value at 12345678 is less than 2C
  //example:
  luacall(lessThanCheat())
return:

[DISABLE]
unregistersymbol(newmem)
dealloc(newmem)


Example in Lua:
Code:
bytes = readBytes(0x12345678,1)
if bytes == 0x2C then
   --do cheats here
elseif bytes < 0x2C then
   --do cheats here
end


Well. Thanks Smile
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