View previous topic :: View next topic |
Author |
Message |
LastExceed Expert Cheater Reputation: 1
Joined: 05 Nov 2014 Posts: 130
|
Posted: Sat Nov 19, 2016 4:36 am Post subject: how do I write 2bytes (short integer) ? |
|
|
I know the is writeInteger() for 4bytes and writeQword() for 8bytes, but how do I write 2bytes as a short integer without making use of the address list? and while we're at it, how do read 2bytes? (same questions for 1byte)
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Sat Nov 19, 2016 4:53 am Post subject: |
|
|
writeBytes(address, wordToByteTable(value))
byteTableToWord(readBytes(address, 2,true))
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping
Last edited by Dark Byte on Sat Nov 19, 2016 5:04 am; edited 2 times in total |
|
Back to top |
|
|
LastExceed Expert Cheater Reputation: 1
Joined: 05 Nov 2014 Posts: 130
|
Posted: Sat Nov 19, 2016 4:54 am Post subject: |
|
|
Dark Byte wrote: | writeBytes(wordToByteTable(value)) |
Where do i specify the address?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Sat Nov 19, 2016 5:04 am Post subject: |
|
|
fixed it
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
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: Sat Nov 19, 2016 7:24 am Post subject: |
|
|
Code: | function readWord(a)
local lowerhalf,higherhalf = readBytes(a,2)
return lowerhalf~=nil and ((higherhalf << 8) + lowerhalf) or nil
end
function writeWord(a,v)
return writeBytes(a,v & 0xFF,v >> 8 & 0xff) > 0
end |
or
Code: | function readWord(a)
local bt = readBytes(a,2,true)
return bt~=nil and byteTableToWord(bt) or nil
end
function writeWord(a,v)
return writeBytes(a,wordToByteTable(v)) > 0
end |
Code: | writeWord(address,value)
readWord(address) |
_________________
|
|
Back to top |
|
|
cancandodo Advanced Cheater Reputation: 0
Joined: 09 Mar 2012 Posts: 62
|
Posted: Thu Nov 02, 2017 10:01 am Post subject: |
|
|
function shuaxinClick(sender)
local bt=readBytes("[PrincessMaker.exe+AE6C8]+1ab",2,true)
control_setCaption(CETrainer.shengao,byteTableToWord(bt))
end
this code work correct!
|
|
Back to top |
|
|
|