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 


A little LUA Help

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

Joined: 20 May 2011
Posts: 1

PostPosted: Fri May 20, 2011 7:30 pm    Post subject: A little LUA Help Reply with quote

I'm very new with LUA


Lets say I have the addresses for HP and HPRegen.


How would I use LUA to change the value of one address based on the value of another? Like:


if (hp < 10)
{
HPRegen = 200;
}


Any help or similar examples would be appreciated.

Wink
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Fri May 20, 2011 9:47 pm    Post subject: Reply with quote

nvm

Last edited by iPromise on Sat May 21, 2011 11:21 am; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Fri May 20, 2011 10:24 pm    Post subject: Reply with quote

How is C++ even remotely close to LUA...
_________________
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25830
Location: The netherlands

PostPosted: Sat May 21, 2011 8:59 am    Post subject: Reply with quote

to "t_o_m" it depends on the context you're in.
Is this for a program/game you're writing yourself, or are you using Cheat Engine's lua interface ?

if cheat engine then use readInteger(address) or readFloat(address) to check if the value is above or below and then use writeInteger(address,value) or writeFloat(address,value) to set the value you want

and probably create a timer that calls your code every few milliseconds

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping


Last edited by Dark Byte on Sat May 21, 2011 9:07 am; edited 2 times in total
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sat May 21, 2011 9:00 am    Post subject: Reply with quote

that's pretty safe for sure. setting up an seh and tearing it back down on function exit, fantastic idea. so each time we do a read, we have function call overhead and expensive setting up and tearing down of seh. just fantastic
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 programming 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