View previous topic :: View next topic |
Author |
Message |
Reclaimer Shawn Advanced Cheater Reputation: 0
Joined: 09 Jun 2015 Posts: 77
|
Posted: Sun Aug 28, 2016 4:49 pm Post subject: Getting readInteger to read a two byte value |
|
|
So, I have a part of my script that requires me to read a 2 byte value, and then uses this result to decide what to do next. I was using readIneteger, and it reads 4 bytes, therefore messing up when the code activates. I also tried using readBytes as well. This is what I put my code as:
Code: |
readBytes("Some Address",2,0)
|
This is basically the final part of my code.
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Aug 28, 2016 5:31 pm Post subject: |
|
|
We're almost done with our script?!
Code: | local b1, b2 = readBytes("SomeAddress", 2, false)
local value = b2 * 256 + b1 |
Code: | local value = byteTableToWord(readBytes("SomeAddress", 2, true)) |
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Mon Aug 29, 2016 4:05 am Post subject: |
|
|
readInteger() & 0xffff
_________________
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 |
|
|
|