AutoHotkey Community

It is currently May 26th, 2012, 7:41 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Faster than "sleep 1"?
PostPosted: May 10th, 2009, 6:30 pm 
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]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 10th, 2009, 6:47 pm 
Offline

Joined: August 2nd, 2008, 12:31 am
Posts: 101
"Sleep 0" is faster then "Sleep 1"
And removing Sleep altogether is fastest.

_________________
Woot.

Please read forum etiquette


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 11th, 2009, 11:35 am 
Offline

Joined: December 29th, 2008, 9:49 am
Posts: 29
Location: Malaysia
If im not mistaken theres "sleep 0.1" "sleep 0.01" "sleep 0.001" but i don't think theres more.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 11th, 2009, 12:55 pm 
Offline

Joined: October 9th, 2008, 6:04 am
Posts: 180
Location: Finland
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 11th, 2009, 10:09 pm 
sleep -1


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 12th, 2009, 12:43 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Azevedo, over21, perlsmith, Yahoo [Bot] and 65 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group