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 


Simple button problem

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Sat Jun 11, 2016 9:14 am    Post subject: Simple button problem Reply with quote

Hello, i just want to make two simple button that changes two 4byte values onpress. However im clearly doing something wrong since it does not work.

Code:
function CEButton1Click(sender)
  writeInteger("[game.exe+18E0E38]", 1746150)
  writeInteger("[game.exe+18E1048]", 0)
end
function CEButton2Click(sender)
  writeInteger("[game.exe+18E0E38]", 1746150)
  writeInteger("[game.exe+18E1048]", 1)
end


CEButtonxClick is added to both buttons[/code]
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sat Jun 11, 2016 9:25 am    Post subject: Reply with quote

The first parameter of the writeInteger function is an address. If you include the square brackets, that's dereferencing that address and writing the value into the dereferenced address. In other words, if that's not a L1 pointer with the offset being 0, then remove those square brackets.

Otherwise, check to make sure those addresses are correct and that those functions are assigned to the buttons' OnClick events.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Sat Jun 11, 2016 9:30 am    Post subject: Reply with quote

ParkourPenguin wrote:
The first parameter of the writeInteger function is an address. If you include the square brackets, that's dereferencing that address and writing the value into the dereferenced address. In other words, if that's not a L1 pointer with the offset being 0, then remove those square brackets.

Otherwise, check to make sure those addresses are correct and that those functions are assigned to the buttons' OnClick events.


Oh im stupid, thank you!
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 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