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 


two speed hack codes wont work

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Redogg
Cheater
Reputation: 0

Joined: 16 Feb 2015
Posts: 27

PostPosted: Sat Sep 26, 2015 12:34 pm    Post subject: two speed hack codes wont work Reply with quote

hey
i tried to use this code by darkbytes to make slow hack and speed hack in one trainer but for some reason only one is working

Code:
lastSpeed=1;

function checkKeys(timer)
  if (isKeyPressed(VK_CAPITAL)) then
    if lastspeed ~= 0.3 then
      speedhack_setSpeed(0.3)
      lastSpeed=0.3
    end
  else
    if lastspeed ~= 1 then
      speedhack_setSpeed(1)
      lastSpeed=1
    end
  end

end

t=createTimer(nil)
timer_setInterval(t, 100)
timer_onTimer(t, checkKeys)
timer_setEnabled(t, true)


lastSpeed=1;

function speedhack(timer)
  if (isKeyPressed(VK_MBUTTON)) then
    if lastspeed ~= 15 then
      speedhack_setSpeed(15)
      lastSpeed=15
    end
  else
    if lastspeed ~= 1 then
      speedhack_setSpeed(1)
      lastSpeed=1
    end
  end

end

t=createTimer(nil)
timer_setInterval(t, 100)
timer_onTimer(t, speedhack)
timer_setEnabled(t, true)
Back to top
View user's profile Send private message
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Sat Sep 26, 2015 12:50 pm    Post subject: Reply with quote

'Cause you're overwriting the first timer with the second by setting them both in "t"?
_________________
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25807
Location: The netherlands

PostPosted: Sat Sep 26, 2015 1:04 pm    Post subject: Reply with quote

overriding t shouldn't be an issue.

your timer unsets the speedhack when the key is not pressed(caps lock can set it to 0.3, but because the middle mousebutton isn't doewn it sets it to 1), merge the scripts into one function instead

_________________
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
View user's profile Send private message MSN Messenger
Redogg
Cheater
Reputation: 0

Joined: 16 Feb 2015
Posts: 27

PostPosted: Sat Sep 26, 2015 2:05 pm    Post subject: Reply with quote

Dark Byte wrote:
overriding t shouldn't be an issue.

your timer unsets the speedhack when the key is not pressed(caps lock can set it to 0.3, but because the middle mousebutton isn't doewn it sets it to 1), merge the scripts into one function instead

i got it thanks
Code:
lastSpeed=1;

function checkKeys(timer)
  if (isKeyPressed(VK_CAPITAL)) then
    if lastspeed ~= 0.3 then
      speedhack_setSpeed(0.3)
      lastSpeed=0.3
    end
  else
    if lastspeed ~= 1 then
      speedhack_setSpeed(1)
      lastSpeed=1
    end
  if (isKeyPressed(VK_MBUTTON)) then
    if lastspeed ~= 15 then
      speedhack_setSpeed(15)
      lastSpeed=15
    end
  else
    if lastspeed ~= 1 then
      speedhack_setSpeed(1)
      lastSpeed=1
    end
  end
  end
end


btw how do i get directx hook? its possible to do it with cheat engine?
i want to create a crosshair in dx9 game, when i tried to do it, its crashed my game
theres anyway to create a crosshair on dx9 game?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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