Difference between revisions of "Lua:writeString"

From Cheat Engine
Jump to navigation Jump to search
m
m (Added CodeBox Template.)
 
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
'''function''' writeString(''Address'', ''Text'', [''WideChar'']) ''':''' Boolean
+
{{CodeBox|'''function''' writeString(''Address'', ''Text'', [''WideChar'']) ''':''' Boolean}}
  
 
Writes a string to the specified address in the currently opened (target) process.   
 
Writes a string to the specified address in the currently opened (target) process.   

Latest revision as of 23:02, 4 December 2025

<> Function

function writeString(Address, Text, [WideChar]) : Boolean

Writes a string to the specified address in the currently opened (target) process. Set WideChar to true to write the string as widechar (UTF-16/Unicode). Returns true on success.

Function Parameters[edit]

Parameter Type Description
Address Integer or CEAddressString The address in the target process to write to.
Text String The string to write.
WideChar Boolean (optional) Set to true to write as a widechar (UTF-16/Unicode) string. Default is false (ASCII/ANSI).

Returns[edit]

Boolean — true if the write was successful, false otherwise.

Examples[edit]

-- Write an ASCII string to address 0x123456
local success = writeString(0x123456, "Hello, world!")
print("Write successful:", success)

-- Write a widechar (Unicode) string to a CEAddressString
writeString("game.exe+1234", "Unicode Text", true)

See also[edit]

Lua
Script Engine

Related Functions[edit]

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