Jump to content

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

Help with toggle on/off



  • Please log in to reply
4 replies to this topic
Sander
  • Members
  • 3 posts
  • Last active: May 23 2013 03:57 PM
  • Joined: 23 May 2013

Hi there

 

Right now I'm using this script, I can start it by pressing F8, but i can't toggle it off/ pause it again? help!

toggle = 0
#MaxThreadsPerHotkey 2

F8::
    Toggle := !Toggle
     While Toggle{
        Send, {2}
        Sleep 1750
        Send {3}
        Sleep 1000
        Send {5}
        Sleep 1310
        Send {5}
        Sleep 1310
        Send {5}
        sleep 2500
    }
return


Hameed
  • Members
  • 8 posts
  • Last active: May 28 2013 06:55 PM
  • Joined: 17 May 2013

Try this:

toggle = 0
#MaxThreadsPerHotkey 2

F8::
    KeyWait, F8
    Toggle := !Toggle
     While Toggle{
        Send, {2}
        Sleep 1750
        Send {3}
        Sleep 1000
        Send {5}
        Sleep 1310
        Send {5}
        Sleep 1310
        Send {5}
        sleep 2500
    }
return


Sander
  • Members
  • 3 posts
  • Last active: May 23 2013 03:57 PM
  • Joined: 23 May 2013

Didnt work :(



JMeneses
  • Members
  • 161 posts
  • Last active: Oct 30 2015 02:10 PM
  • Joined: 17 Feb 2011
✓  Best Answer

Sorry for my English
I'm not expert but I think AHK # MaxThreadsPerHotkey 2 only supports 2 wireless hotkey

Try this to see if it is what you want

#MaxThreadsPerHotkey 20
#singleinstance force

Loop {

    times := ""
    While Toggle { 
      
      times .= "+"
      Tooltip % "(A) Send 2  - Toggle: " Toggle " " times
      Sleep 1750
      If !Toggle
       Break

      times .= "+"
      Tooltip % "(B) Send 3 - Toggle: " Toggle " " times
      Sleep 1000
      If !Toggle
       Break

      times .= "+"
      Tooltip % "(C) Send 5 - Toggle: " Toggle " " times
      Sleep 1310
      If !Toggle
       Break

      times .= "+"
      Tooltip % "(D) Send 5 - Toggle: " Toggle " " times
      Sleep 1310
      If !Toggle
       Break
    
      times .= "+"
      Tooltip % "(E) Send 5- Toggle: " Toggle " " times
      sleep 2500
      If !Toggle
       Break
    }
    ToolTip
}
Return

F8::(Toggle:=!Toggle)
esc::ExitApp



Sander
  • Members
  • 3 posts
  • Last active: May 23 2013 03:57 PM
  • Joined: 23 May 2013

 

Sorry for my English
I'm not expert but I think AHK # MaxThreadsPerHotkey 2 only supports 2 wireless hotkey

Try this to see if it is what you want

#MaxThreadsPerHotkey 20
#singleinstance force

Loop {

    times := ""
    While Toggle { 
      
      times .= "+"
      Tooltip % "(A) Send 2  - Toggle: " Toggle " " times
      Sleep 1750
      If !Toggle
       Break

      times .= "+"
      Tooltip % "(B) Send 3 - Toggle: " Toggle " " times
      Sleep 1000
      If !Toggle
       Break

      times .= "+"
      Tooltip % "(C) Send 5 - Toggle: " Toggle " " times
      Sleep 1310
      If !Toggle
       Break

      times .= "+"
      Tooltip % "(D) Send 5 - Toggle: " Toggle " " times
      Sleep 1310
      If !Toggle
       Break
    
      times .= "+"
      Tooltip % "(E) Send 5- Toggle: " Toggle " " times
      sleep 2500
      If !Toggle
       Break
    }
    ToolTip
}
Return

F8::(Toggle:=!Toggle)
esc::ExitApp

 

 

Helped me on the way to solving it :) Heres is what works for me! Thanks

toggle = 0
#MaxThreadsPerHotkey 20

F8::
    Toggle := !Toggle
     While Toggle{
        Send, {2}
        Sleep 1750
        If !Toggle
         Break
        Send {3}
        Sleep 1000
        If !Toggle
         Break
        Send {5}
        Sleep 1310
        If !Toggle
         Break
        Send {5}
        Sleep 1310
        If !Toggle
         Break
        Send {5}
        sleep 2500
        If !Toggle
         Break
    }
return