Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

basic loop script with break key.


  • Please log in to reply
3 replies to this topic
indukt
  • Members
  • 2 posts
  • Last active: Oct 12 2009 03:33 PM
  • Joined: 12 Oct 2009
Basically, I want to have a key 'R' start the loop and the key "P" to stop it. I want to have it send the line 3 and 4 continually. Any help would be appreciated. Thank you.

Loop
{
Send 1
Sleep, 7000
}

  • Guests
  • Last active:
  • Joined: --
r::

Loop,

{

Send 1

Sleep 7000

}



p::exitapp


indukt
  • Members
  • 2 posts
  • Last active: Oct 12 2009 03:33 PM
  • Joined: 12 Oct 2009
Works great. Thank you very much.

AHKIsTheBest
  • Members
  • 19 posts
  • Last active: Jan 18 2011 10:13 AM
  • Joined: 20 Jun 2009
Also, to be able to press "r" again later...

r::
  $stop := 0
  Loop, 
  { 
    Send 1 
    Sleep 7000 
    if ($stop)
    {
      return
    }
  }

p:: $stop := 1

And you probably need "#MaxThreadsPerHotkey 2" or the "p" will never fire.