New AHK scripts to easy change key and ms speed :) 17/11-24 (Update)

any way this can work with a Middle Mouse button? to hold it down?

Keybind1 := “MButton” should work.

Its definitely doing something… now when i hold middle mouse its actually opening up my BAG, Talent Screen, Friend UI etc

Any ideas?

Most likely cause of the modifiers on the script. Alot of the creators on here use shift, ctrl and alt.
Since the middle mouse button doesn’t behave like a typical keyboard key in games, sending it with modifiers can causes unwanted in-game behavior
If you open the script and find this line:

    if GetKeyState("LCtrl", "P")
        Send ^{%Keybind1%}
    else if GetKeyState("LShift", "P")
        Send +{%Keybind1%}
    else if GetKeyState("LAlt", "P")
        Send !{%Keybind1%}
    else
        Send {%Keybind1%}

Then replace all of that with this:

Send {%Keybind1%}

That should solve it.

this is what i currently have
#ifWinActive World of Warcraft ; Only run if the ‘World of Warcraft’ window is active
HandleKeybind:
Loop ; Loop to handle the keybind functionality
{
if not GetKeyState(Keybind1, “P”) ; If the key is not pressed, break the loop
break
else
Send %Keybind1% ; Send the key without modifiers
Sleep %Speed% ; Use the Speed variable for sleep duration

    }
return

Still does the same thing… Now if i do
#ifWinActive World of Warcraft ; Only run if the ‘World of Warcraft’ window is active
HandleKeybind:
Loop ; Loop to handle the keybind functionality
{
Send %Keybind1% ; Send the key without modifiers
}
I’m in a endless loop, and im essentially stuck lol

return

I’ve modified this one for you so just copy everything below into the .ahk edit and replace EVERYTHING with this:

toggle := false ; Initialize toggle state as false
Keybind1 := “MButton” ; Middle Mouse Button as the keybind
Speed := 100 ; Define the sleep duration (speed) in milliseconds

F9:: ; Toggle key (F9)
toggle := !toggle ; Switch between true and false
ToolTip % toggle ? Keybind1 " on" : Keybind1 " off" ; Show tooltip indicating state
if toggle
{
Hotkey, % “$” Keybind1, HandleKeybind, On
}
else
{
Hotkey, % “$” Keybind1, HandleKeybind, Off
}
SetTimer, RemoveToolTip, -1000 ; Remove tooltip after 1 second
return

#ifWinActive World of Warcraft ; Only run if the ‘World of Warcraft’ window is active
HandleKeybind:
Loop ; Loop to handle the keybind functionality
{
if not GetKeyState(Keybind1, “P”) ; If the key is not pressed, break the loop
break
Send %Keybind1% ; Send the key without modifiers
Sleep %Speed% ; Use the Speed variable for sleep duration
}
return

RemoveToolTip:
ToolTip
return

if i wonted to hold key 2 down to start and release to finish does the script do that for me ? thank u in advanced

Yes, that is exactly what this AHK script does :slight_smile: No script should have a Toggle ON/OFF for running as that would be Automation.
So this script does this:

  1. You hold down 2 and it will repeat that key.
  2. You release the key and it will stop.

Important that you change the key modifier to 2 if thats the button you want to use. There is a “Readme” that explains it simply :slight_smile:
Just right click the AHK after downloading,

  1. click “Edit” or open in - Notepad
  2. Find where it says Keybind1 := “1”
  3. Change the 1 to a 2 so it will say “Keybind1 := “2”
  4. Save and done!

Then you run it with AutoHotKey :slight_smile:
It also only works inside of World of Warcraft, so it wont “spam” that key if you type outside of the game :slight_smile:

brillant thank u so much xxx