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 


Adding Hex numbers to Base Address?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Hyperglyph
Newbie cheater
Reputation: 0

Joined: 12 Jan 2017
Posts: 12

PostPosted: Mon Feb 20, 2017 9:21 pm    Post subject: Adding Hex numbers to Base Address? Reply with quote

Trying to convert my trainer to an AoB-based code instead of static addresses since I've noticed the statics are changing when the game updates.

I'd planned to find an AoB, get its address and then add offsets for all the 12 or so other address that I need.

So far, this is what I have:
Code:

local AoB = AOBScan("big long string of bytes")
local BaseAddress = AoB[0]
writeInteger(BaseAddress,0) --This works fine.
readInteger(BaseAddress-0x45B64) --This doesn't work at all


That's a stripped version of the general idea, but for the life of me I can't figure out why the readInteger isn't working. I've tried putting it in quotes, brackets, removing the 0x, converting it to decimal, assigning a separate variable (i.e. NewAddress=BaseAddress-0x45B64) and using that (i.e. readInteger(NewAddress)) but nothing's working.

Printed values keep telling me that BaseAddress-0x45B64 is 1.#INF... which I know isn't right.

So, what IS the correct syntax?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 118

Joined: 09 Jun 2013
Posts: 3198

PostPosted: Mon Feb 20, 2017 10:07 pm    Post subject: Reply with quote

Either or
Code:
tonumber(BaseAddress,16)-0x45B64
BaseAddress.."-45B64"
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