View previous topic :: View next topic |
Author |
Message |
parthekos How do I cheat? Reputation: 0
Joined: 27 Jun 2014 Posts: 5
|
Posted: Fri Jun 27, 2014 6:35 am Post subject: Tracking value change |
|
|
I would like use Lua, to print the history of how base pointer's value changes over time(on it's own, i do not intend to change the value manually).
Let's say that the xxxxxxx address has value 10.
i want the script to print the 10 to the console and wait until this 10 changes.
when xxxxxxx value grows to for example 25, i want it to print the 25 in new line.
So far I got this, but it freezes upon opening output console.
Code: | local address = "4A3AD230"
local current = readInteger(address)
print(current)
repeat
sleep(1)
local new = readInteger(address)
if new ~= current then
print(new)
current = new
end
until i_get_bored |
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Fri Jun 27, 2014 8:36 am Post subject: |
|
|
Code: | local address = "4A3AD230"
local current = readInteger(address)
print(current)
local timer = createTimer(nil,false);
timer.onTimer = function(sender)
local newvalue = readInteger(address);
if (current~= newvalue) then
current = newvalue;
print(current);
end
end
timer.Interval = 1;
timer.Enabled = true; |
_________________
|
|
Back to top |
|
|
parthekos How do I cheat? Reputation: 0
Joined: 27 Jun 2014 Posts: 5
|
Posted: Fri Jun 27, 2014 8:51 am Post subject: |
|
|
This is just perfect. Is there any way to write those values to a .txt file or maybe keep the console minimzed? Because the console window forces itself onto top of the screen on each value change.
Last edited by parthekos on Fri Jun 27, 2014 9:22 am; edited 2 times in total |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Fri Jun 27, 2014 9:08 am Post subject: |
|
|
view->show on print
and you could use the lua io library to write the results to file
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
parthekos How do I cheat? Reputation: 0
Joined: 27 Jun 2014 Posts: 5
|
Posted: Fri Jun 27, 2014 9:23 am Post subject: |
|
|
just noticed that when the value of an address go way over into high number like 5555555555, then the integer displayed in the console goes into negative (i.e. instead of displaying 678432678423 it displays -32415521). It works corretly on low values though.
Address value type is 4 bytes. I have tried changing the integer in the script to readBytes(address, 4) but it returns ~200ish value.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Fri Jun 27, 2014 9:31 am Post subject: |
|
|
an address value type of 4 can never contain the value 678432678423 which is a 5 byte value at least
anyhow, if the 4 byte value is smaller than 0, then just add the 4 byte max value to it (4294967296) to get the unsigned version
Code: |
if current<0 then
current=4294967296+current
end
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
parthekos How do I cheat? Reputation: 0
Joined: 27 Jun 2014 Posts: 5
|
Posted: Fri Jun 27, 2014 9:47 am Post subject: |
|
|
Well it does the job. However I would like to ask if there is any way to make the interval even lower? I assume that "1" stands for 1 second interval which sometimes seems to stack 2-3 value changes into one(i.e. skips those values and doesn't print them). Tried 0.1/0,1/0/false but without success.
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Fri Jun 27, 2014 9:57 am Post subject: |
|
|
Code: | local address = "4A3AD230"
local current = readInteger(address)
print(current);
createNativeThread(function()
while true do
local newvalue = readInteger(address);
if (current~= newvalue) then
current = newvalue;
print(current);
end
end); |
Fastest way to read that I know..
If that doesn't suit enough, look into breakpoints, and store values.
_________________
|
|
Back to top |
|
|
parthekos How do I cheat? Reputation: 0
Joined: 27 Jun 2014 Posts: 5
|
Posted: Fri Jun 27, 2014 10:13 am Post subject: |
|
|
DaSpamer wrote: | Code: | local address = "4A3AD230"
local current = readInteger(address)
print(current);
createNativeThread(function()
while true do
local newvalue = readInteger(address);
if (current~= newvalue) then
current = newvalue;
print(current);
end
end); |
Fastest way to read that I know..
If that doesn't suit enough, look into breakpoints, and store values. |
Unexpected symbol near ) at line 11. Tried to work around in 20 different ways, guess I don't understand Lua at all
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Fri Jun 27, 2014 11:52 am Post subject: |
|
|
There needs to be an extra "end" after print
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
|