| View previous topic :: View next topic |
| Author |
Message |
AnthIste Guest
|
Posted: Sat Jun 09, 2007 5:48 pm Post subject: Help toggling a loop on/off with 1 hotkey |
|
|
if I try the following:
| Code: |
$F1::
loop{
F1:: <<<ERROR ON THIS LINE
break
send ^v
send {enter}
}
|
I get the error "duplicate hotkey not allowed" or something similar. I can sorta understand why I get this error, but I cant get around it. All I would like to achieve is to switch a loop on/off by tapping F1. I'm stumped.
If anyone has any ideas please help me out here, thanks |
|
| Back to top |
|
 |
Micahs
Joined: 01 Dec 2006 Posts: 460
|
Posted: Sat Jun 09, 2007 6:40 pm Post subject: |
|
|
Try this:
| Code: | SetTimer,looper,500 ;whatever rate you want
Return
looper:
If(fOne)
{ send ^v
send {enter}
}
Return
$F1::
fOne := !fOne
Return |
You are getting multiple hotkey errors because you are creating multiple references to F1:: _________________

Last edited by Micahs on Sat Jun 09, 2007 6:41 pm; edited 1 time in total |
|
| Back to top |
|
 |
jps
Joined: 02 Sep 2006 Posts: 279 Location: Scotland
|
Posted: Sat Jun 09, 2007 6:41 pm Post subject: |
|
|
| GetKeyState |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
|
| Back to top |
|
 |
AnthIste Guest
|
Posted: Mon Jun 11, 2007 1:14 pm Post subject: |
|
|
thanx 4 all the help guys
Il try out all the suggestions and see what works |
|
| Back to top |
|
 |
|