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 


How to "if \ than \ else" >_<

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

Joined: 24 Apr 2018
Posts: 1

PostPosted: Tue Apr 24, 2018 6:59 am    Post subject: How to "if \ than \ else" >_< Reply with quote

Hello!
I'm novice in lua and I can't figure out how to write a "if \ than \ else". >_<

The task is:
If address referenced by the pointer = 100 than freeze it.
If this address = 1000 or 0 than unfreeze it.

How to do this in Lua? I read the entire section, but did not find a function that would help me.
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Tue Apr 24, 2018 7:46 am    Post subject: Reply with quote

I really think if you "read the entire section" you would know how to do this, and a LOT more.
But basically:
use a timer or thread with a loop
read value
check value
write to value based on check

http://wiki.cheatengine.org/index.php?title=Lua:Class:Timer
http://wiki.cheatengine.org/index.php?title=Lua:Class:Thread
http://wiki.cheatengine.org/index.php?title=Lua#Reading
http://wiki.cheatengine.org/index.php?title=Lua#Writing

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