Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Cheat engine speedhack with timer.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
fenixx3
How do I cheat?
Reputation: 0

Joined: 24 Oct 2015
Posts: 3

PostPosted: Sat Oct 24, 2015 6:09 am    Post subject: Cheat engine speedhack with timer. Reply with quote

Hello!

I wanted to ask - Is there a script that allows cheatengine's speedhack to stop for a certain time and then start again?

I would be very thankful if someone could help me.

Thanks!

_________________
hype
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 154

Joined: 06 Jul 2014
Posts: 4752

PostPosted: Sat Oct 24, 2015 11:03 am    Post subject: Reply with quote

You could use speedhack_setSpeed(value) and sleep(milliseconds).
i.e.:
Code:
speedhack_setSpeed(1) --disables speedhack
sleep(1000) --waits for 1 second
speedhack_setSpeed(2) --enables speedhack

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
fenixx3
How do I cheat?
Reputation: 0

Joined: 24 Oct 2015
Posts: 3

PostPosted: Sat Oct 24, 2015 12:00 pm    Post subject: Reply with quote

ParkourPenguin wrote:
You could use speedhack_setSpeed(value) and sleep(milliseconds).
i.e.:
Code:
speedhack_setSpeed(1) --disables speedhack
sleep(1000) --waits for 1 second
speedhack_setSpeed(2) --enables speedhack
°

Looks good, thanks - but what about the timer?
For now it only works manually by pressing the execute button.

Is there a way to set start-stop-start (function)... after a certain time (like after 120 sec) ?

Sorry for stupid questions, only today started to check cheat engine for the first time :/

_________________
hype
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 154

Joined: 06 Jul 2014
Posts: 4752

PostPosted: Sat Oct 24, 2015 12:37 pm    Post subject: Reply with quote

You can make a hotkey for it, like F1 for example:
Code:
function pauseSpeedhack()
  speedhack_setSpeed(1)
  sleep(1000)
  speedhack_setSpeed(2)
end
createHotkey(pauseSpeedhack, VK_F1)

Other key codes can be found here.

If you'd like it to run periodically every 120 seconds, then:
Code:
function pauseSpeedhack()
  speedhack_setSpeed(1)
  sleep(1000)
  speedhack_setSpeed(2)
end

if t and t.destroy then t.destroy() end
t = nil
t = createTimer(nil,true)
t.setInterval(120000)
t.setOnTimer(pauseSpeedhack)

Note that the timer's interval acts independent of any delays in the function it's running. AKA: It doesn't matter how long the delay is between stopping and starting the speedhack, the timer will run that function every 120 seconds.

To disable the timer, open up the Lua Engine (memory viewer, Tools -> Lua Engine), then call t.destroy() then set t=nil.
Edit: or you could just call t.setEnabled(false) if you want to re-enable it from there w/ t.setEnabled(true).

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
fenixx3
How do I cheat?
Reputation: 0

Joined: 24 Oct 2015
Posts: 3

PostPosted: Sat Oct 24, 2015 2:14 pm    Post subject: Reply with quote

That's just what I needed, thank you very much for your time and simple explanations! Smile
_________________
hype
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites