Lua:stringToByteTable

From Cheat Engine
Revision as of 20:07, 24 January 2018 by TheyCallMeTim13 (talk | contribs) (moved stringToByteTable to Lua:stringToByteTable)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

function stringToByteTable(String) : table

Converts a string to a byte table.


Function Parameters[edit]

Parameter Type Description
String string The string to convert to a byte table


Examples[edit]

 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[edit]

Related Functions[edit]