View previous topic :: View next topic |
Author |
Message |
cancandodo Advanced Cheater Reputation: 0
Joined: 09 Mar 2012 Posts: 67
|
Posted: Thu Nov 02, 2017 8:49 am Post subject: How to read 2bytes in lua script? |
|
|
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 |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4314
|
Posted: Thu Nov 02, 2017 10:04 am Post subject: |
|
|
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 |
|
|
cancandodo Advanced Cheater Reputation: 0
Joined: 09 Mar 2012 Posts: 67
|
Posted: Thu Nov 02, 2017 10:05 am Post subject: |
|
|
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 |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Nov 02, 2017 6:29 pm Post subject: |
|
|
Perhaps readSmallInteger has a corresponding writeSmallInteger...
|
|
Back to top |
|
|
movss Cheater Reputation: 0
Joined: 10 Feb 2018 Posts: 38
|
Posted: Sat Feb 10, 2018 3:50 pm Post subject: |
|
|
先转换成bytes,再写入?
|
|
Back to top |
|
|
OldCheatEngineUser Whateven rank Reputation: 20
Joined: 01 Feb 2016 Posts: 1587
|
Posted: Sun Feb 11, 2018 2:38 am Post subject: |
|
|
yeah send them my greetings
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Feb 11, 2018 2:46 am Post subject: |
|
|
Code: | readSmallInteger(address) : Reads a 16-bit integer from the specified address
readSmallInteger, readInteger, readSmallIntegerLocal, readIntegerLocal
can also have second boolean parameter. If true, value will be signed. |
So:
writeSmallInteger also handles signed and unsigned values.
For example:
Code: | writeSmallInteger('400500',33536)
writeSmallInteger('400500',-32000) |
will write the same two bytes at address 400500.
_________________
|
|
Back to top |
|
|
|