0

I have a hard time figuring this one out. I am new to Lua.

Basically I have found a base pointer in Cheat Engine. Now I would like use Lua, to print the history of how base pointer's value changes over time.

For example when I start the script, and the base pointer value is 55555, then Lua prints for example into notepad.exe

55555

when it changes to 66666, it breaks the line and prints 66666, so it looks like

55555

66666

Any idea on how to achieve it?

Andy Andy
  • 279
  • 4
  • 7
  • 17

1 Answers1

0

You can't print into Notepad, at least not without some serious COM programming which you aren't going to do (barring heroic measures) from Lua.

You could print to the console. Or you could print to a text file and watch it for changes with a tool like Baretail. To print to the console, in the Lua distro's example host, you simply say:

print(55555) 

To print to a file, you open the file and write to it:

local f = io.open('myfile.txt')
f:write(66666)

Or set the file to the default output file:

io.output('myfile.txt')
io.write(77777)
Mud
  • 28,277
  • 11
  • 59
  • 92
  • Thanks. And what about coding this function itself? I just hanged my PC by creating a loop which basically after analyzing came down to if n > n then print n :-) – Andy Andy Jun 27 '14 at 08:28