View previous topic :: View next topic |
Author |
Message |
microsoftv Advanced Cheater Reputation: 0
Joined: 07 Apr 2016 Posts: 82 Location: U.S
|
Posted: Fri Oct 07, 2016 2:26 pm Post subject: Key press lasts too long |
|
|
When doing the script
Code: | createHotkey(function(hk)
if ballx > p1x then
keyDown(VK_RIGHT)
sleep(1)
keyUp(VK_RIGHT)
elseif ballx < p1x then
keyDown(VK_LEFT)
sleep(1)
keyUp(VK_LEFT)
return
end
end, VK_Q) |
The code works, but when the ballx is < or > it's still pressing the other key instead of what it should for about 4 times, and it also presses it multiple times when i only want it to press once for if ballx is < press Left once, > press right once, etc.
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Fri Oct 07, 2016 3:38 pm Post subject: |
|
|
Use doKeyPress() instead of keyDown(), sleep(), and keyUp()?
|
|
Back to top |
|
|
microsoftv Advanced Cheater Reputation: 0
Joined: 07 Apr 2016 Posts: 82 Location: U.S
|
Posted: Fri Oct 07, 2016 3:52 pm Post subject: |
|
|
Zanzer wrote: | Use doKeyPress() instead of keyDown(), sleep(), and keyUp()? |
Thanks for replying, but I already tried that and it didn't work.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Fri Oct 07, 2016 4:22 pm Post subject: |
|
|
Look into:
Code: |
setGlobalKeyPollInterval(integer): Sets the global keypoll interval. The interval determines the speed of how often CE checks if a key has been pressed or not. Lower is more accurate, but eats more cpu power
setGlobalDelayBetweenHotkeyActivation(integer): Sets the minimum delay between the activation of the same hotey in milliseconds. Affects all hotkeys that do not set their own minimum delay
|
e.g:
setGlobalKeyPollInterval(1)
setGlobalDelayBetweenHotkeyActivation(1)
Or set those delay on the hotkeys themselves (property DelayBetweenActivate )
(It will eat up some cpu power)
_________________
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 |
|
|
|