Difference between revisions of "Lua:stringToByteTable"

From Cheat Engine
Jump to navigation Jump to search
(Created page with ''''function''' stringToByteTable(''String'') Converts a string to a byte table. === Function Parameters === {|width="85%" cellpadding="10%" cellpadding="5%" cellspacing="0" bo…')
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''function''' stringToByteTable(''String'')
+
[[Category:Lua]]
 +
'''function''' stringToByteTable(''String'') ''':''' table
  
 
Converts a string to a byte table.
 
Converts a string to a byte table.
Line 35: Line 36:
  
  
== See also ==
+
{{LuaSeeAlso}}
* [[Lua]]
 
* [[Help_File:Script engine|Script engine]]
 
  
 
=== Related Functions ===
 
=== Related Functions ===
* [[readBytes]]
+
* [[ansiToUtf8]]
* [[readInteger]]
+
* [[utf8ToAnsi]]
* [[readQword]]
+
* [[translate]]
* [[readPointer]]
+
{{ReadWriteMemory}}
* [[readFloat]]
 
* [[readDouble]]
 
* [[readString]]
 
* [[writeBytes]]
 
* [[writeInteger]]
 
* [[writeQword]]
 
* [[writeFloat]]
 
* [[writeDouble]]
 
* [[writeString]]
 
* [[readBytesLocal]]
 
* [[readIntegerLocal]]
 
* [[readQwordLocal]]
 
* [[readPointerLocal]]
 
* [[readFloatLocal]]
 
* [[readDoubleLocal]]
 
* [[readStringLocal]]
 
* [[writeBytesLocal]]
 
* [[writeIntegerLocal]]
 
* [[writeQwordLocal]]
 
* [[writeFloatLocal]]
 
* [[writeDoubleLocal]]
 
* [[writeStringLocal]]
 
* [[wordToByteTable]]
 
* [[dwordToByteTable]]
 
* [[qwordToByteTable]]
 
* [[floatToByteTable]]
 
* [[doubleToByteTable]]
 
* [[wideStringToByteTable]]
 
* [[byteTableToWord]]
 
* [[byteTableToDword]]
 
* [[byteTableToQword]]
 
* [[byteTableToFloat]]
 
* [[byteTableToDouble]]
 
* [[byteTableToString]]
 
* [[byteTableToWideString]]
 

Latest revision as of 00:07, 25 January 2018

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]