View previous topic :: View next topic |
Author |
Message |
Matt GT Newbie cheater Reputation: 0
Joined: 21 Dec 2017 Posts: 14
|
Posted: Sat Jan 20, 2018 1:33 am Post subject: Very Huge CPU Usage [90%] |
|
|
Why everytime i use this script:
Code: | function reopenProcessThreadFunc(thread,processName)
thread.name = '"reopenProcessThread"'
while true do
if readInteger(processName)== nil then
if openProcess(processName) then
autoAssemble([[
"Growtopia.exe"+123A4F:
db 90 90
]])
synchronize(function () UDF1.BanBypass.Caption ='Ban Bypass : Running' end)
else
synchronize(function () UDF1.BanBypass.Caption ='Ban Bypass : Not Running' end)
end
end
end
end
createNativeThread(reopenProcessThreadFunc,"Growtopia.exe") |
it consumes like 90% of my cpu but when im not using it, its not consuming
a big amount of cpu usage
_________________
im a n00v at cheat engine |
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 54
Joined: 01 Oct 2008 Posts: 941
|
Posted: Sat Jan 20, 2018 2:04 am Post subject: |
|
|
May add
within the eternal while loop so the thread will not continuously run non stop, ie. sleep pause the thread execution once a while.
_________________
- Retarded. |
|
Back to top |
|
|
Matt GT Newbie cheater Reputation: 0
Joined: 21 Dec 2017 Posts: 14
|
Posted: Sat Jan 20, 2018 2:43 am Post subject: |
|
|
panraven wrote: | May add
within the eternal while loop so the thread will not continuously run non stop, ie. sleep pause the thread execution once a while. |
where should i add it
_________________
im a n00v at cheat engine |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sat Jan 20, 2018 4:28 am Post subject: |
|
|
Quote: | May add
Code:
sleep(1000)
within the eternal while loop |
The "loop" start here :
Code: | while true do
...
-- until close by end
end |
so you can try to add sleep(1000)
Code: | while true do
if readInteger(processName)== nil then
if openProcess(processName) then
autoAssemble([[
"Growtopia.exe"+123A4F:
db 90 90
]])
sleep(1000) ---- here
synchronize(function () UDF1.BanBypass.Caption ='Ban Bypass : Running' end)
sleep(1000) ----- or here
else
synchronize(function () UDF1.BanBypass.Caption ='Ban Bypass : Not Running' end)
sleep(1000) ----- or here
end
end
sleep(1000) ----- or here
end |
just try
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sat Jan 20, 2018 10:35 am Post subject: |
|
|
because it's repeatedly doing it as fast as possible, and there's no reason for it to, as mentioned you can use sleep to let the processor do other work for awhile instead.
Alternatively you can use a timer rather than createThread
Code: | local t = createTimer()
t.OnTimer = function(timer)
local processName = 'Growtopia.exe'
if readInteger(processName) == nil then
if openProcess(processName) then
autoAssemble([["Growtopia.exe"+123A4F:
db 90 90]])
-- why is this in synchronize?
synchronize(function () UDF1.BanBypass.Caption ='Ban Bypass : Running' end)
else
-- why is this in synchronize?
synchronize(function () UDF1.BanBypass.Caption ='Ban Bypass : Not Running' end)
end
end
end
t.Interval = 1000 -- run once every 1000 milliseconds / 1 second |
if you don't want to have to change the function every time because you're creating a library or something like that then you could still use a timer via closures (though createNativeThread may be the simpler option)
Code: | -- library function
function getReopenProcessFunc(processName, success, failure)
-- return function with access to the values given
return function(timer)
if readInteger(processName) == nil then
if openProcess(processName) then
if type(success) == 'function' then return success(processName) end
else
if type(failure) == 'function' then return failure(processName) end
end
end
end
end
-- an unnecessary wrapper to avoid user needing to timer lol
function setReopenProcessFunc(processName, success, failure)
local t = createTimer()
t.OnTimer = getReopenProcessFunc('Growtopia.exe', success, fail)
t.Interval = 1000 -- run once every 1000 milliseconds / 1 second
return t
end
-- user code
local success = function(processName)
local bypassScript = [["Growtopia.exe"+123A4F:
db 90 90]]
autoAssemble(script)
-- why is this in synchronize?
synchronize(function () UDF1.BanBypass.Caption ='Ban Bypass : Running' end)
end
local fail = function(processName)
-- why is this in synchronize?
synchronize(function () UDF1.BanBypass.Caption ='Ban Bypass : Not Running' end)
end
local reopenProcessTimer = setReopenProcessFunc('Growtopia.exe', success, fail)
|
|
|
Back to top |
|
|
|