View previous topic :: View next topic |
Author |
Message |
amadeok How do I cheat?
Reputation: 0
Joined: 16 Aug 2016 Posts: 2
|
Posted: Thu Aug 20, 2020 8:13 pm Post subject: Reading values from file or memory |
|
|
Hello,
I'm trying to make a sort of integration between ffmpeg and cheat engine. ffmpeg has a filter cold photosensitivity that is triggered in scenes with a lot of action, or light effects, or chaotic in general. I want to combine that filter with the slow down feature of cheat engine to slow down games in those parts. i have already found in the source code the relevant variable that i will need to trigger the slow down.
I've been trying to use the lua engine to read that value from a written file or directly from memory with read readInteger(), but every time after a few seconds the loop freezes cheat engine and i'm forced to terminate it. i've tried adding a delay but it did not help.
this is the script that i'm using:
a = 1
for a = 1, 9999, +1
do
val = readInteger(0x0034338C)
print (val)
Sleep(10)
end
any help?
thanks
|
|
Back to top |
|
 |
blankTM Cheater
Reputation: 1
Joined: 03 May 2020 Posts: 49
|
Posted: Fri Aug 21, 2020 6:36 am Post subject: Re: Reading values from file or memory |
|
|
Code: |
Thread=createThread(function()
while(true) do
val = readInteger(0x0034338C)
print (val)
Sleep(10)
end
end
)
|
|
|
Back to top |
|
 |
amadeok How do I cheat?
Reputation: 0
Joined: 16 Aug 2016 Posts: 2
|
Posted: Fri Aug 21, 2020 12:07 pm Post subject: Re: Reading values from file or memory |
|
|
blankTM wrote: | Code: |
Thread=createThread(function()
while(true) do
val = readInteger(0x0034338C)
print (val)
Sleep(10)
end
end
)
|
|
Hi thanks for reply. I made a new one,
Code: | val= readInteger(0x00EC338C)
print(val)
Thread=createThread(function()
while(true) do
val= readInteger(0x00EC338C)
if val < 0 then
speedhack_setSpeed(5)
sleep(150)
elseif val > 0 then
speedhack_setSpeed(0.7)
sleep(150)
print(val)
end
end
end) |
I works. I'm seeing that it uses about 10% of cpu, is there any way to reduce the cpu usage? thanks
edit: after testing i realized that the high cpu usage comes when becomes these lines:
if val < 0 then
elseif val > 0 then
any advice?
|
|
Back to top |
|
 |
blankTM Cheater
Reputation: 1
Joined: 03 May 2020 Posts: 49
|
Posted: Tue Aug 25, 2020 7:29 am Post subject: Re: Reading values from file or memory |
|
|
Code: |
Thread=createThread(function()
local speed = 0
while(true) do
local val= readInteger(0x00EC338C)
if val > 0xffff and (val ~ -0x100000000) < 0 then
if speed ~= 5 then
speedhack_setSpeed(5)
speed = 5
end
else if val > 0 then
if speed ~= 0.7 then
speedhack_setSpeed(0.7)
speed = 0.7
end
end
end
sleep(150)
end
end)
|
|
|
Back to top |
|
 |
|