AHK help: Keeps opening my bags - solved

I’m pretty sure it’s my code since it works just fine when I use the 3 button instead of a mouse button.

can anyone tell me what I’m doing wrong?

#ifWinActive World of Warcraft ; Only run if window ‘World of Warcraft’ is active
{
$XButton1:: ; If e is pressed
$^XButton1:: ; If e+control is pressed
$+XButton1:: ; If e+shift is pressed
$!XButton1:: ; If e+alt is pressed
Loop ; If any of the above is true then loop below
{
if not GetKeyState(“XButton1”, “P”) ; If E is not pressed then break the loop
break
if GetKeyState(“LCtrl”, “P”) ; If left control is pressed then send control+e
Send ^XButton1
else if GetKeyState(“LShift”, “P”) ; If left shift is pressed then send shift+e
Send +XButton1
else if GetKeyState(“LAlt”, “P”) ; If left alt is pressed then send alt+e
Send !XButton1
else
Send XButton1 ; If XButton1 is pressed with no other modifiers send XButton1
sleep 20 ; Time in milliseconds between key repeats
}
return
}

thanks for your help guys! i figured it out!
when i had the script running, if i tried to bind my mouse button it showed that i was trying to bind “X, B, u, t, t, o, n, 1” all in that order…
here’s my new/working script:

#ifWinActive World of Warcraft ; Only run if window ‘World of Warcraft’ is active
{
$XButton1:: ; If e is pressed
$^XButton1:: ; If e+control is pressed
$+XButton1:: ; If e+shift is pressed
$!XButton1:: ; If e+alt is pressed
Loop ; If any of the above is true then loop below
{
if not GetKeyState(“XButton1”, “P”) ; If E is not pressed then break the loop
break
if GetKeyState(“LCtrl”, “P”) ; If left control is pressed then send control+e
Send ^{XButton1}
else if GetKeyState(“LShift”, “P”) ; If left shift is pressed then send shift+e
Send +{XButton1}
else if GetKeyState(“LAlt”, “P”) ; If left alt is pressed then send alt+e
Send !{XButton1}
else
Send {XButton1} ; If XButton1 is pressed with no other modifiers send XButton1
sleep 20 ; Time in milliseconds between key repeats
}
return
}

Moving this out of the GSE area as it has nothing to do with GSE.

1 Like

Edited title to reflect AHK help.

1 Like

thanks for your assistance guys

Mate I don’t use AHK and you need help from someone who does. Not a lot more I can do except put it somewhere where someone who knows what you need will see it.

i wasn’t being sarcastic with thanking you… i genuinely was thanking you for the help lol

1 Like

i dont know your specific bag binds but , pls, before you troubleshoot the script you have just - try putting the following line into AHK . i use it as the first line.
, it should be active as long as the script is running , . so put everything you have currently in a new set of brackets and let this be the highest priority command .

SetCapsLockState, Alwaysoff
{
your entire script
}

if it works for your bag opening closing problem , i recommend living with the fact that you cannot use caps lock with or without the window active and just close AHK when u arent playing or if u must use caps lock . it is also reality that with this line of code , Caps Lock button is no longer a potential keybind to use in game . its ok i promise
Turbo-mode of a key without caps lock active , can become turbo-CapsLock presses , if Caps lock is on . to tolerate this quirk of Caps Lock’s hegemony, simply press caps lock to reverse symptoms of the quirk ( i used to open chat, press caps lock , close chat if caps lock is a keybind u dont wanna cast . this reverses the turbo-ing of the caps lock key if it is always being Sent for some reason with any other key you use)
but really eventually i just learned i would never need caps lock again becaause it was such a headache .

.
.
ok if it is not a shift-modifier problem that is one-shot fixed by obliterating the caps lock key like i mentioned above

SetCapsLockState, Alwaysoff
{
your entire script
}

troubleshoot the interface in game instead of the AHK b4 you edit your good work on AHK :slight_smile:

  • have you removed keybinds in game for the “open backpack; open bag 2,3,…” and “open all bags” ? Shift-B is default to open all bags and the F12,11,10,… default to open one at a time .

  • next - delete the Neuron actionbar called “Bag Bar 1”

  • then turn off any addons that change the layout of your Bags . see if problem persists.

  • if so, turn off addons that “easy confirm” , “easy Milling / prospecting / disenchanting” etc .

  • ((if using Neuron for a bag bar & an addon that removes the default inventory behavior altogether , , adjust the Bar States to reflect the mod keys appropriate to opening bags - but note that the “visibility toggles” are only going to affect the Bag Bar, not the opening/closing of a bag… Use the Bar States to control how Neuron handles the Bag bar if it is your only access to your Bag Bar slots . ))

thanks for your help, also, how do you do the fancy quote section for sharing code?