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 


If else statement

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

Joined: 06 Mar 2021
Posts: 4

PostPosted: Tue Apr 19, 2022 2:35 am    Post subject: If else statement Reply with quote

Hi, I wanted to do a simple thing.

What i wanted to do is: Always check if value at specific address (0019FAD4 for example) is 1000, if 1000 then change to 100 and will keep doing it like an auto script.

I have no knowledge in assembler so i don't know how to achieve such thing, can anyone tell me how to do it?
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1069
Location: 0x90

PostPosted: Tue Apr 19, 2022 3:42 am    Post subject: Reply with quote

You can achieve this with Lua:
Code:

[ENABLE]
{$LUA}
if syntaxcheck then return end

-- Destroy the timer if it exists
if timer then timer.destroy(); timer = nil end

timer = createTimer(getMainForm())
timer.Interval = 100
timer.OnTimer = function()
                  local val = readInteger(0x0019FAD4)
                  if val == 1000 then
                     writeInteger(0x0019FAD4, 100)
                  end
                end

{$ASM}
[DISABLE]
{$LUA}
timer.destroy()
timer = nil
Back to top
View user's profile Send private message
oazumi29
How do I cheat?
Reputation: 0

Joined: 06 Mar 2021
Posts: 4

PostPosted: Tue Apr 19, 2022 10:21 am    Post subject: Reply with quote

LeFiXER wrote:
You can achieve this with Lua:


Thank you so much!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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