Difference between revisions of "Lua:Class:TableFile"

From Cheat Engine
Jump to navigation Jump to search
(Created page with 'TableFile '''class''': ('''Inheritance''': ''Object'') Class for Cheat Engine Table Files (CE Form->Menu->Table) Table files can be added from the Cheat Engine form. …')
 
Line 24: Line 24:
 
  local tableFile = findTableFile('PlayerBaseHook.CEA')
 
  local tableFile = findTableFile('PlayerBaseHook.CEA')
 
  if tableFile ~= nil then
 
  if tableFile ~= nil then
local stringStream = createStringStream()
+
  local stringStream = createStringStream()
stringStream.Position = 0 -- if not set before using 'copyFrom' the 'StringStream' object will be inconsistent.
+
  stringStream.Position = 0 -- if not set before using 'copyFrom' the 'StringStream' object will be inconsistent.
stringStream.copyFrom(tableFile.Stream, tableFile.Stream.Size)
+
  stringStream.copyFrom(tableFile.Stream, tableFile.Stream.Size)
fileStr = stringStream.DataString
+
  fileStr = stringStream.DataString
stringStream.Destroy()
+
  stringStream.Destroy()
 
  end
 
  end
  

Revision as of 06:00, 11 March 2017

TableFile class: (Inheritance: Object)

Class for Cheat Engine Table Files (CE Form->Menu->Table)

Table files can be added from the Cheat Engine form.

  • CE Form->Menu->Table->Add file

Properties

Name : string
The table file's name.
Stream : MemoryStream
The table file's underlying MemoryStream object.

Methods

saveToFile(filePath)
Saves the TableFile to the given file path.
getData() : MemoryStream
Returns the table file's underlying MemoryStream object.

Examples

local fileStr = nil
local tableFile = findTableFile('PlayerBaseHook.CEA')
if tableFile ~= nil then
  local stringStream = createStringStream()
  stringStream.Position = 0 -- if not set before using 'copyFrom' the 'StringStream' object will be inconsistent.
  stringStream.copyFrom(tableFile.Stream, tableFile.Stream.Size)
  fileStr = stringStream.DataString
  stringStream.Destroy()
end

See also

Related Functions

Related Classes