AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Air Strafing script

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Fr0sTbY7eX
Guest





PostPosted: Wed Sep 16, 2009 6:36 am    Post subject: Air Strafing script Reply with quote

I am clueless at the moment. I have spent a good hour trying to do this on my own until I came here :/ I was wondering if I could get a script that just loops leftarrow and rightarrow like so it would go > < > <> < but with a break time I could edit the gaps between each change of direction? If possible bind it to the Left ALT button. Sorry to ask for an entire script.
Back to top
dwinar



Joined: 05 Sep 2009
Posts: 10

PostPosted: Wed Sep 16, 2009 9:22 am    Post subject: Reply with quote

This is what can be found in the AHK Help file but adjusted to your needs. If you have any question, just ask. Have fun.

Code:

#MaxThreadsPerHotkey 3
LAlt::  ; Left Alt hotkey (change this hotkey to suit your preferences).
#MaxThreadsPerHotkey 1
if KeepLoopRunning  ; This means an underlying thread is already running the loop below.
{
    KeepLoopRunning := false  ; Signal that thread's loop to stop.
    return  ; End this thread so that the one underneath will resume and see the change made by the line above.
}
; Otherwise:
KeepLoopRunning := true
Loop
{
    ; The next lines are the action you want to repeat (update them to suit your preferences):
   Send {Right}
   Sleep 1500 ; Gives you time for your editting the gaps, 1000 = 1 second (change to whatever you want)
   Send {Left}
   Sleep 1500
    ; But leave the rest below unchanged.
    if not KeepLoopRunning  ; The user signaled the loop to stop by pressing Win-Z again.
        break  ; Break out of this loop.
}
KeepLoopRunning := false  ; Reset in preparation for the next press of this hotkey.
return
Back to top
View user's profile Send private message
Fr0sTbY7eX
Guest





PostPosted: Wed Sep 16, 2009 3:39 pm    Post subject: Reply with quote

Thanks man Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group