AutoHotkey Community

It is currently May 26th, 2012, 10:43 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Air Strafing script
PostPosted: September 16th, 2009, 7:36 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2009, 10:22 am 
Offline

Joined: September 5th, 2009, 3:45 pm
Posts: 10
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2009, 4:39 pm 
Thanks man :D


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: JSLover, Miguel, rbrtryn, XstatyK and 58 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