View previous topic :: View next topic |
Author |
Message |
dantirya How do I cheat? Reputation: 0
Joined: 17 May 2019 Posts: 4
|
Posted: Fri May 17, 2019 11:02 am Post subject: using CE to output a variable continuously |
|
|
Hello!
I'm wondering if its possible to use CE to read an internal variable on another process and output its value to a text file every few seconds?
Seems to me like this is something CE can do but I'm rather at a loss as to where to start trying to make this happen.
Thanks for your time! |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Fri May 17, 2019 12:07 pm Post subject: Re: using CE to output a variable continuously |
|
|
dantirya wrote: | ... use CE to read an internal variable on another process |
Maybe, you meant 'on a process'.
This is a sample to print out the score changed on The Windows game, Solitaire.
Said, I already have an address for score value and I want to know score change every 5 seconds.
Code: | local al = AddressList or getAddressList()
local mr1 = al.getMemoryRecordByDescription("No Description")
if not mr1 then error("Memrecs do not exist!!!") end
function hack1()
val = mr1.Value
val = tonumber(val)
if val <= 0 then
t.enabled = false
print('Value = '..val)
else
print(os.date()..' | value = '..val) -- show changed value each 5 seconds and his changed time
end
end
t = createTimer()
t.interval = 5000
t.onTimer = hack1
t.enabled = true
|
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
dantirya How do I cheat? Reputation: 0
Joined: 17 May 2019 Posts: 4
|
Posted: Fri May 17, 2019 8:22 pm Post subject: |
|
|
If I'm following the code correctly that will output the value to.... the console? |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Fri May 17, 2019 9:11 pm Post subject: |
|
|
Yes. I just give you sample and thought made improvisation. Next code, to save the result to a text file.
Code: | local al = AddressList or getAddressList()
local mr1 = al.getMemoryRecordByDescription("No Description")
if not mr1 then error("Memrecs do not exist!!!") end
local stringlist = createStringlist()
local path = TrainerOrigin or getMainForm()
local myfile = path .. "\\myresult.txt"
function hack1()
val = mr1.Value
val = tonumber(val)
if val <= 0 then
t.enabled = false
stringlist.saveToFile(myfile)
else
stringlist.add(os.date()..' | value = '..val)
print(os.date()..' | value = '..val)
end
end
t = createTimer()
t.interval = 5000
t.onTimer = hack1
t.enabled = true |
It will give results as text file contains:
Code: | 05/18/19 10:02:58 | value = 38
05/18/19 10:03:03 | value = 36
05/18/19 10:03:08 | value = 36
05/18/19 10:03:13 | value = 34
05/18/19 10:03:18 | value = 34
05/18/19 10:03:23 | value = 32
05/18/19 10:03:28 | value = 32
05/18/19 10:03:33 | value = 30
05/18/19 10:03:38 | value = 30
05/18/19 10:03:43 | value = 28
05/18/19 10:03:48 | value = 28
05/18/19 10:03:53 | value = 26
05/18/19 10:03:58 | value = 26
05/18/19 10:04:03 | value = 24
05/18/19 10:04:08 | value = 24
05/18/19 10:04:13 | value = 22
.. and so on till 0 |
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
dantirya How do I cheat? Reputation: 0
Joined: 17 May 2019 Posts: 4
|
Posted: Tue May 21, 2019 1:21 am Post subject: |
|
|
thank you for the examples! |
|
Back to top |
|
|
dantirya How do I cheat? Reputation: 0
Joined: 17 May 2019 Posts: 4
|
Posted: Tue May 21, 2019 9:26 pm Post subject: |
|
|
I don't fully understand the stringlist.add method and the stringlist class isn't well documented on the cheatengine wiki
is it possible to destructively overwrite the output instead of appending to the end of the file? |
|
Back to top |
|
|
|