Difference between revisions of "Lua:stringToByteTable"
Jump to navigation
Jump to search
m (moved stringToByteTable to Lua:stringToByteTable) |
|
(No difference)
| |
Revision as of 00:07, 25 January 2018
function stringToByteTable(String) : table
Converts a string to a byte table.
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| String | string | The string to convert to a byte table |
Examples
local bt = stringToByteTable('player.weapons.rifle')
bt[#bt + 1] = 0
writeBytes('00123ABC', bt)
Code:
local bt = stringToByteTable('test')
for i, v in ipairs(bt) do
print(i - 1, string.format('%02X', v))
end
Output:
0 74 1 65 2 73 3 74
See also
| Lua |
| Script Engine |
Related Functions
| Read Functions |
|---|
| readBytes |
| readSmallInteger |
| readInteger |
| readQword |
| readPointer |
| readFloat |
| readDouble |
| readString |
| Read Functions (Local Process) |
| readBytesLocal |
| readIntegerLocal |
| readQwordLocal |
| readPointerLocal |
| readFloatLocal |
| readDoubleLocal |
| readStringLocal |
| Write Functions |
| writeBytes |
| writeSmallInteger |
| writeInteger |
| writeQword |
| writeFloat |
| writeDouble |
| writeString |
| Write Functions (Local Process) |
| writeBytesLocal |
| writeIntegerLocal |
| writeQwordLocal |
| writeFloatLocal |
| writeDoubleLocal |
| writeStringLocal |
| Byte Table Conversions (Value → Byte Table) |
| wordToByteTable |
| dwordToByteTable |
| qwordToByteTable |
| floatToByteTable |
| doubleToByteTable |
| stringToByteTable |
| wideStringToByteTable |
| Byte Table Conversions (Byte Table → Value) |
| byteTableToWord |
| byteTableToDword |
| byteTableToQword |
| byteTableToFloat |
| byteTableToDouble |
| byteTableToString |
| byteTableToWideString |