---- TheyCallMeTim13
---- Writes a zero terminated string to the given address.
----
---- writeStringZT(address, text)
---- writeStringZT(address, text, wideChar)
----
---- Parameters:
---- address : number - string :
---- The address to write to.
---- text : string :
---- The string to write to memory.
---- wideChar (optional): boolean :
---- Set to true for wide character strings.
function writeStringZT(address, text, wideChar)
address = getAddressSafe(address)
if not address then return end
writeString(address, text, wideChar)
local len = #text
if wideChar then len = len * 2 end
writeBytes(address + len, { 0x00, 0x00 })
end
registerLuaFunctionHighlight('writeStringZT')
----
---- Writes a zero terminated string to the given address targeting the CE process.
----
---- writeStringLocalZT(address, text)
---- writeStringLocalZT(address, text, wideChar)
----
---- Parameters:
---- address : number - string :
---- The address to write to.
---- text : string :
---- The string to write to memory.
---- wideChar (optional): boolean :
---- Set to true for wide character strings.
function writeStringLocalZT(address, text, wideChar)
address = getAddressSafe(address, true)
if not address then return end
writeStringLocal(address, text, wideChar)
local len = #text
if wideChar then len = len * 2 end
writeBytesLocal(address + len, { 0x00, 0x00 })
end
registerLuaFunctionHighlight('writeStringLocalZT')