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 


Put address-value in another address with lua hotkey macro?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials
View previous topic :: View next topic  
Author Message
adaptusaaf
Advanced Cheater
Reputation: 0

Joined: 13 Jan 2008
Posts: 52

PostPosted: Fri Sep 04, 2015 7:26 pm    Post subject: Put address-value in another address with lua hotkey macro? Reply with quote

Code:
function main()
if isKeyPressed(VK_U) then
   writeInteger("10CAD73C", 900)
end
end
t = createTimer(nil, false)  -- create a Timer object and assign it to variable t
timer_onTimer(t, main)   -- When the timer ticks, call the function main
timer_setInterval(t, 50) -- Sets the tickrate of the timer in milliseconds
timer_setEnabled(t, true) -- Turns the timer on


The above is my working lua script
Instead of putting "900" as the value in the address 10CAD73C, I'd rather have it dynamically update to be whatever the value of another address is, the address of 10CAD748.

writeInteger("10CAD73C", "10CAD748")
doesn't seem to work

does anything work for this?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Sep 04, 2015 8:00 pm    Post subject: Reply with quote

Code:
writeInteger("10CAD73C", readInteger("10CAD748"))
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 Tutorials -> LUA Tutorials 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 cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites