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 


Linking Hotkey to button in a ce trainer (need help)
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Sat May 28, 2016 5:14 pm    Post subject: Reply with quote

Those numbers aren't integers. As I said before, use writeFloat or writeDouble if it's a different value type.

If you double click on the "address" field of a memory record that's a pointer, the "Change address" window should appear. The very bottom editbox is the base address. The one above that is the first offset. The next one, the second offset, etc.
Code:
writeFloat("[[baseAddress]+firstOffset]+secondOffset", 3.14)

If it's not working, make sure your offsets are in the right order. Post a picture of that box if you're not sure.

_________________
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 May 28, 2016 5:29 pm    Post subject: Reply with quote

lothe23 wrote:
ParkourPenguin wrote:
In that case, it's better to write to those addresses directly.
Code:
function CEButton1Click(sender)
  writeInteger(0x0412A020, 100)
  writeInteger(0x0412A024, -4000)
  writeInteger(0x0412A028, -40)
end

Use writeFloat or writeDouble if it's a different data type.


Okay, writeInteger(Pointer, Value)

How do i write the pointer correctly instead of an adress? :p


And it is float values so it should be writeFloat right?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Sat May 28, 2016 5:39 pm    Post subject: Reply with quote

Correct.

Try testing it between posts.

_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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