Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Need Simple 1 Button Script


  • Please log in to reply
5 replies to this topic
mikestewart395
  • Members
  • 2 posts
  • Last active: Dec 29 2017 07:23 PM
  • Joined: 30 Jan 2015

I started reading up on this at work today, and was excited to use AHK in WOW. I use a macro for button one and tried using several Rapidfire scripts. Nothing worked right. I just need a script that presses 1 about 4 times a second. Would someone please help me and link me a script. This is one I tried

 

#ifWinActive World of Warcraft

{ $1:: Loop { if not GetKeyState("1", "P") break Send 1 sleep 18 } return }

 

It compiled and loaded fine, but would only spam 1 if my pointer was over the 1 button on the action bar in game. I want to press and hold down 1 and have it spam. Sorry, I'm new to this.



Jenie
  • Members
  • 15 posts
  • Last active: Sep 27 2015 04:57 PM
  • Joined: 31 Jan 2015

Not sure if that is what you're looking for but here it is..  :)

 

#IfWinActive World of Warcraft
$1::
GetKeyState, state, 1, P
if state = D

Loop
{
Send {1}
Sleep, 250
Send {1}
Sleep, 250
Send {1}
Sleep, 250
Send {1}
Sleep, 250
return
}
#IfWinActive

 



mikestewart395
  • Members
  • 2 posts
  • Last active: Dec 29 2017 07:23 PM
  • Joined: 30 Jan 2015

That worked perfectly , thank you. Is there a way to add button 2 to something like this or do I have to run 2 Hotkeys?



Jenie
  • Members
  • 15 posts
  • Last active: Sep 27 2015 04:57 PM
  • Joined: 31 Jan 2015

Glad it worked.. Just add it below it  :shy:

#IfWinActive World of Warcraft
$1::
GetKeyState, state, 1, P
if state = D

Loop
{
Send {1}
Sleep, 250
Send {1}
Sleep, 250
Send {1}
Sleep, 250
Send {1}
Sleep, 250
return
}

$2::
GetKeyState, state, 2, P
if state = D

Loop
{
Send {2}
Sleep, 250
Send {2}
Sleep, 250
Send {2}
Sleep, 250
Send {2}
Sleep, 250
return
}
#IfWinActive


Jenie
  • Members
  • 15 posts
  • Last active: Sep 27 2015 04:57 PM
  • Joined: 31 Jan 2015
This script unlike the previous one will stop sending immediately once you release the key. 
SetKeyDelay, 250 ; Keystroke is sent four times per second
#MaxHotkeysPerInterval 200 ; Rate of hotkey activations beyond which a warning dialog will be displayed.
                                                ; Increase it to delay the warning message.


$1::
GetKeyState, state, 1, P
if state = D
Loop
{
Send {1}
return
}


$2::
GetKeyState, state, 2, P
if state = D
Loop
{
Send {2}
return
}


Jenie
  • Members
  • 15 posts
  • Last active: Sep 27 2015 04:57 PM
  • Joined: 31 Jan 2015

 Xtra has suggested the right way for the second script I posted.  :)

$2::
Loop
{
GetKeyState, state, 2, P
if state = U
Break
Send, 2
}
return

or

$2::
while GetKeyState("2","P")
{
Send, 2
Sleep, 10
}
return