Two thoughts:
By the way, you MUST return from a label. Else it'll continue to read everything underneath until it hits a return. It may not seem so at first, but when gets reeeeally problematic after a while. You should also refer to this when using the ampersand:
Lastly, my proposed 'fix' to the script (Very much like Earl's). I see nothing severely wrong with it, so it's probably language settings, hardware or AHK installation messing up else.
If nothing works, report it to the AHK forums.
- Try to compile the script and see if it's any different. If it works, there's something wrong with your AHK library. Make sure you're using the latest version and the version best fit for your OS. You should download the installer from here: http://ahkscript.org/
autohotkey.com has for a long time been unchanged and unsupported, so despite recently changing I wouldn't trust it.
- Ooor it may be an issue with your keyboard matrix. It should affect more than just AHK scripts in such case though. It may also be that you're using a keyboard language unfit for the keyboard layout. Also, it should work fine without brackets as long as you properly exit the label with return. (Assuming you're not working with functions/methods).
Refer to this to check input language: http://windows.microsoft.com/en-us/wind ... ard-layout
By the way, you MUST return from a label. Else it'll continue to read everything underneath until it hits a return. It may not seem so at first, but when gets reeeeally problematic after a while. You should also refer to this when using the ampersand:
http://ahkscript.org/docs/Hotkeys.htm#comboYou can define a custom combination of two keys (except joystick buttons) by using " & " between them. In the below example, you would hold down Numpad0 then press the second key to trigger the hotkey:
In the above example, Numpad0 becomes a prefix key; but this also causes Numpad0 to lose its original/native function when it is pressed by itself. To avoid this, a script may configure Numpad0 to perform a new action such as one of the following:Code:Numpad0 & Numpad1::MsgBox You pressed Numpad1 while holding down Numpad0. Numpad0 & Numpad2::Run Notepad
The presence of one of the above custom combination hotkeys causes the release of Numpad0 to perform the indicated action, but only if you did not press any other keys while Numpad0 was being held down. In v1.1.14+, this behaviour can be avoided by applying the tilde prefix to either hotkey.Code:Numpad0::WinMaximize A ; Maximize the active/foreground window. Numpad0::Send {Numpad0} ; Make the release of Numpad0 produce a Numpad0 keystroke. See comment below.
Lastly, my proposed 'fix' to the script (Very much like Earl's). I see nothing severely wrong with it, so it's probably language settings, hardware or AHK installation messing up else.
Code:
#NoEnv
#SingleInstance force
SendMode Input
SetWorkingDir %A_ScriptDir%
!q::
Send t/elm{enter}
Send t/siren{enter}
return
!e::
Send t/m **You hear sirens along with red and blue flashing lights in your mirrors.**{enter}
Send t/m This is San Andreas State Police. Please pull your vehicle over to the side of the road. All occupants remain seated.{enter}
return
!1::
Send t/m **[AIRHORN] You can see flashing emergency lights, indicating you to pull over.**{enter}
Send t/m This is San Andreas State Police. Please move aside of the road and let us pass.{enter}
return
End & 1::
Send t/ame rapidly stretches out his forearm towards the duty-belt, enfolding the handle of his 45 Beretta Caliber Pistol, unclipping it, switching the safety to off position.{enter}
return
End & 2::
Send t/ame downlifts his palm whilst dragging his 45 Beretta Caliber Pistol down to his belt, clipping it back whilst moving the safety to ON.{enter}
return
End & 3::
Send t/ame rapidly stretches out his forearm towards the duty-belt, enfolding the handle of his Remington 870, unclipping it, switching the safety to off position.{enter}
return
End & 4::
Send t/ame downlifts his palm whilst dragging his Remington 870 down to his belt, clipping it back whilst moving the safety to ON.{enter}
return
End & 5::
Send t/ame rapidly unholsters his Tazer X26 from his duty-belt, upholding it forwards.{enter}
return
End & 6::
Send t/ame downlifts his palm whilst dragging his Tazer X26 to his belt, clipping it back whilst moving the safety to ON.{enter}
return
End & 9::
Send t/me downlifts his dominant wrist, withdrawing a pair of metal handcuffs from his belt, hoisting them towards the suspect, allocating them onto the wrists, locking them in position.{enter}
return
End & 7::
Send t/stinger{enter}
return
End & 8::
Send t/rstinger{enter}
return
!9::
Send t/carmusic http://slusham.com/radio/city.m3u{enter}
return
!0::
Send t/carmusic stop{enter}
return
If nothing works, report it to the AHK forums.