| View previous topic :: View next topic |
| Author |
Message |
Dumb Guest
|
Posted: Sun May 10, 2009 5:30 pm Post subject: Faster than "sleep 1"? |
|
|
I'm looking for a script where when space is pressed, it can press space faster than it does in something like this:
| Code: | *~$Space::
Sleep 200
Loop
{
GetKeyState, SpaceState, Space, P
If SpaceState = U
break
Sleep 1
Send, {Blind}{Space}
}
Return
|
The purpose of this is a "bunny hop" script for Counter-Strike: Source. It jumps rapidly, and when combined with strafing that I can easily do, it allows the player to move faster than he would if he simply walked. This works decently, but many times I'm finding it not efficient enough. If anyone could make one that would do so faster, or point me in the right direction to make my own, I'd appreciate it.
If it's not possible to do a loop faster than what I already have, just delete the thread. I don't know much about programming, so bear with me.[/code] |
|
| Back to top |
|
 |
Jex
Joined: 01 Aug 2008 Posts: 101
|
Posted: Sun May 10, 2009 5:47 pm Post subject: |
|
|
"Sleep 0" is faster then "Sleep 1"
And removing Sleep altogether is fastest. _________________ Woot.
Please read forum etiquette |
|
| Back to top |
|
 |
Yandols
Joined: 29 Dec 2008 Posts: 29 Location: Malaysia
|
Posted: Mon May 11, 2009 10:35 am Post subject: |
|
|
| If im not mistaken theres "sleep 0.1" "sleep 0.01" "sleep 0.001" but i don't think theres more. |
|
| Back to top |
|
 |
Tseik
Joined: 09 Oct 2008 Posts: 180 Location: Finland
|
Posted: Mon May 11, 2009 11:55 am Post subject: |
|
|
| Code: | *~$Space::
SetKeyDelay, 0
Sleep 200
Loop
{
GetKeyState, SpaceState, Space, P
If SpaceState = U
break
Send, {Blind}{Space}
}
Return |
_________________ was i wrong, it makes me a very sad panda! |
|
| Back to top |
|
 |
Guest
|
Posted: Mon May 11, 2009 9:09 pm Post subject: |
|
|
| sleep -1 |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Tue May 12, 2009 11:43 am Post subject: |
|
|
| Yandols wrote: | | If im not mistaken | You are. Even Sleep 1 typically sleeps for at least 10ms.
| Dump wrote: | | many times I'm finding it not efficient enough | The only way that you could jump as fast as that can send Space is if the game is hogging all CPU resources, leaving none for the script to operate. If you try the script with Notepad, you should see it sends keystrokes much faster than you could jump. It seems more likely that the script is sending Space (press and release) too fast for the game to detect. In that case, increase the duration of each press via SetKeyDelay. |
|
| Back to top |
|
 |
|