AHK Help Needed...

Anyone good with AHK that might be able to help me?

Hey Cymiryc,

This is for spamming button 1 2 3 & 4 while you hold one of those buttons down.

{
$1::
Loop
{
if not GetKeyState(“1”, “P”)
break
Send 1
sleep 4
}
return
}
{
$2::
Loop
{
if not GetKeyState(“2”, “P”)
break
Send 2
sleep 4
}
return
}
{
$3::
Loop
{
if not GetKeyState(“3”, “P”)
break
Send 3
sleep 4
}
return
}
{
$4::
Loop
{
if not GetKeyState(“4”, “P”)
break
Send 4
sleep 4
}
return
}

Cheers,

Darkramz

Hey Tim,

Thanks but i might have baited you wrongly, my bad :slight_smile:

I am looking for a little help in introducing mod keys into my macros because AHK seems to ignore Shift/Ctrl/Alt key presses when i use my AHK script.

I am a lefty so mouse is in left hand while i use my numpad keys for jump and attacking… might be a strange setup for most but i am comfortable with it.

While i use the arrow keys for moving etc as wsad i use Numpad1 for my main attack… if i hold the key down and press shift, the shift event is ignored so doesn’t send it to WoW/GS-E… if i use hardware keys (always left of the keyboard Cry) or my Naga keys, the shift is enforced and the macros fire so i know it’s AHK that’s causing the problem.

I just dont know how to force AHK to understand the key press.

This is the current script i made…

#ifWinActive World of Warcraft
$numpad1::
if getkeystate(“ScrollLock”,“T”)
{
Loop
{
if getkeystate(“numpad1”,“P”)=0
break
Send {=}
RandSleep(50,120)
}
}
else
Send {numpad1}
return
$numpad2::
if getkeystate(“ScrollLock”,“T”)
{
Loop
{
if getkeystate(“numpad2”,“P”)=0
break
Send {-}
RandSleep(50,120)

	}
}
else	
	Send {numpad2}

return
$numpad3::
if getkeystate(“ScrollLock”,“T”)
{
Loop
{
if getkeystate(“numpad3”,“P”)=0
break
Send {0}
RandSleep(50,120)

	}
}
else	
	Send {numpad3}

return

RandSleep(x,y) { ;creates a variable with an X and Y
Random, rand, %x%, %y% ;Uses the Random function to generate x and y
Sleep %rand% ;makes the %rand% value the sleep time
}

Hey Cymiryc

You gave me this:

$+2::
   Loop  
   {
    if (not GetKeyState("2", "P") and not GetKeyState("Shift", "P"))
      break
     Send +2
     sleep 100
    }
return
$+3::
   Loop  
   {
    if (not GetKeyState("3", "P") and not GetKeyState("Shift", "P"))
      break
     Send +3
     sleep 100
    }
return
!2::
   Loop  
   {
    if (not GetKeyState("2", "P") and not GetKeyState("Alt", "P"))
      break
     Send !2
     sleep 100
    }
return
$!3::
   Loop  
   {
    if (not GetKeyState("3", "P") and not GetKeyState("Alt", "P"))
      break
     Send !3
     sleep 100
    }

It appears to fire off mod:alt

I will do more testing

I think i have found the problem. It seems to be more that it’s the Numberpad itself thats causing the problem.
If i were to hold down shift while using it, shift+numpad1 becomes NumpadEnd so it changes the entire function of the key.

It’s still ignored because then i would need to change [mod:shift] to [mod:NumPadEnd]

I will just look for alternative keys to get used to or keep procs on another keybind for now :slight_smile: