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 


How to read 2bytes in lua script?

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

Joined: 09 Mar 2012
Posts: 7

PostPosted: Thu Nov 02, 2017 8:49 am    Post subject: How to read 2bytes in lua script? Reply with quote

in the lua script

"readbytes"in fact is read 1 byte
"readInteger"in fact is read 4 bytes


How to read 2bytes in lua script?

==========
function shuaxinClick(sender)
control_setCaption(CETrainer.shengao,readBytes("[PrincessMaker.exe+AE6C8]+1ab",2,true))
end
==========
this code can not work to show the real value
Back to top
View user's profile Send private message
ParkourPenguin
Grandmaster Cheater Supreme
Reputation: 54

Joined: 06 Jul 2014
Posts: 1814
Location: Arcadian Suburbia

PostPosted: Thu Nov 02, 2017 10:04 am    Post subject: Reply with quote

celua.txt:
Quote:
readSmallInteger(address) : Reads a 16-bit integer from the specified address

_________________
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
cancandodo
How do I cheat?
Reputation: 0

Joined: 09 Mar 2012
Posts: 7

PostPosted: Thu Nov 02, 2017 10:05 am    Post subject: Reply with quote

this code work correct!

function shuaxinClick(sender)
local bt=readBytes("[PrincessMaker.exe+AE6C8]+1ab",2,true)
control_setCaption(CETrainer.shengao,byteTableToWord(bt))
end

then

how to write 2 Bytes to Address?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 120

Joined: 09 Jun 2013
Posts: 3260

PostPosted: Thu Nov 02, 2017 6:29 pm    Post subject: Reply with quote

Perhaps readSmallInteger has a corresponding writeSmallInteger...
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