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 


Keeping a Value the Same with Lua?

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

Joined: 17 Jul 2013
Posts: 1

PostPosted: Wed Jul 17, 2013 4:02 pm    Post subject: Keeping a Value the Same with Lua? Reply with quote

While I am not new to programming or Lua, I have never used Lua in the cheat-engine environment before. I'm also very bad at using cheat engine, and can barely change my ammo in a game. However, I managed to find the address of health in the game. How would I make a Lua script that automatically sets that value to 100 every second?

Help would be greatly appreciated. Sorry if I'm posting this in the section.

_________________
I'm a noob c:
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Wed Jul 17, 2013 5:03 pm    Post subject: Reply with quote

Code:
function setValue()
  writeFloat(address,100.0)
end

timer = createTimer(nil,false)
timer.Interval = 1000 -- milliseconds
timer.OnTimer = setValue
timer.Enabled = true




Of course you must change above to your needs.

address parameter can be, e.g. :
"modulename+1145" (string, module name and offset, offset in hex)
"401145" (string, address in hex)
0x00401145 (numeric, address in hex)
4198725 (numeric, address )


instead of writeFloat you may use writeInteger, it depends on what value type you found.


Better start reading tutorials.

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