Jump to content


Photo

The AutoHotKey Thread


  • Please log in to reply
145 replies to this topic

#1 Skyhoof

Skyhoof

    Don Flamenco

  • Members
  • 369 posts

Posted 18 May 2008 - 04:07 PM

AutoHotKey is a free, open-source utility for Windows. It is available at AutoHotkey. The program is not banned by Blizzard. However, several of its abilities are prohibited by Blizzard so use it wisely.

With AHK, you can:

  • Spam a spell or macro by holding down a single key
  • Control characters on multiple accounts
  • Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or keyboard macro by hand or use the macro recorder.
  • Create hotkeys for keyboard, joystick, and mouse. Virtually any key, button, or combination can become a hotkey.
  • In addition to the typical Control, Alt, and Shift modifiers, you can use the Windows key and the Capslock key as modifiers.

Guides

Duel-Boxing.com:
The Guide

Frequently Asked Questions

* How is it different than the Logitech G15 Keyboard?
It's free. The keyboard is $80.

* Since Blizzard implemented a spell que, why not just recast the spell prior to the end of the current cast? Why should I use AHK?
Many people forget to start the next cast. Also, this relieves pounding on your keyboard, which could help those with carpal tunnel and other repetitive motion injuries.

* Will using this program get my account banned?

AHK is not a program prohibited by Blizzard. However, some of its functions are prohibited by Blizzard. It's very similar to the policy on the G15 keyboard. You cannot use AHK or the G15 keyboard to spam a single key -- even if you are sitting at the keyboard and just want to prevent your finger from falling off. However, there has been no blue post prohibiting using AHK to multi-box. And as always, you can use a G15 keyboard to see who is talking in vent, have more keys to bind to macros, etc.

Here's the best blue response I've seen so far on the issue:

WoW Forums -> Seeking Blue clarification: key repeating

Hello Blizzard,

After unsuccessfully attempting to get clarification via an in-game ticket, I would like to see if the rules can be clarified regarding key repeating software. In light of recent bans, it is unclear what is or isn't allowed, and bearing in mind the majority of players want to follow the rules, it would be of great help if a statement could be made regarding key repeating software.

Previously, the apparent community understanding had been: if it doesn't automate gameplay, and requires you to be present at the keyboard playing the game, then it is legal. It seems with recent bans, this may not actually be the case.

My specific question is: is it okay to use software (or hardware drivers, or external hardware devices) that continually repeat ("spam") a key bound in-game to a macro or ability while another key is held down and while a player is present at the keyboard playing the game? For Hunters, for instance, spamming our shot rotation macro. I'm sure other classes have similar needs, perhaps not 10-20 times per second like a Hunter, but the same idea. Many aspects of the game make key spamming desirable, but is it legitimate to use external drivers/software to achieve it?

I'd love to not have to break my keyboard, fingers, and wrist to achieve maximum DPS, but I would also hate to wake up one morning and find I was banned for using a repeater. Please help myself and other Hunters follow the rules :)


This is not okay. One hardware function = one action, according to standard macro rules. A hardware function is a keypress (including press/release) associated with movement and an ability/item. Obviously, our default macro rules enable you to use 'modifying' trinkets or abilities, such as nature's swiftness, plus a single spell all in a single press.

To clarify: No, you may not use hardware or software to auto-spam your shot rotations - period.


The G15 has been supported by Blizzard in the past, I must have missed it when they changed their minds. :(


I use a G15. Using the G15 macro functions to create macros which incorporate delays, or otherwise use multiple abilities that each have a global cooldown on a single keypress has never been supported. It is automation, and is against our policies listed here:

Terms of Use, Part 4, Section B
WoW -> Legal -> Terms of Use

How To Stay In The Game (Part 2 of 2)
http://us.blizzard.c...articleId=21507

This thread in our CS Forum Information Haven!, to which I've replied previously, may help illuminate the issue for you:

G15 Keyboard Legality
WoW Forums -> Need official response regarding Logitech G15
WoW Forums -> G15 keyboard and bans

The G15 may have the ability to continually activate an ability as long as you keep the key pressed but that is not a function that is permitted by our policies.


Scripts
To do anything with AHK you need to write a script. So far I've found a simple script that will allow you to repeat a spell or macro by holding down one key. I hope others will post more advanced scripts in the thread.

#ifWinActive World of Warcraft
{
$2::
   Loop  
   {
    if not GetKeyState("2", "P")
      break
     Send 2 
     sleep 1
    }
return
$3::
   Loop  
   {
    if not GetKeyState("3", "P")
      break
     Send 3 
     sleep 1
    }
return
}

EDIT: Script was found online, not written by me

#2 Flamingcloud

Flamingcloud

    Great Tiger

  • Members
  • 768 posts

Posted 18 May 2008 - 05:46 PM

Very Very nice, this should in theory reduce cast lag to near 0. If you remove the sleep command it spams 2 about twice as fast. =)

Edit: The script has difficulties running if you eliminate the sleep command entirely but you can set Sleep 0, which will advance the script by one timeslice.

#3 Tehehe

Tehehe

    Von Kaiser

  • Members
  • 95 posts

Posted 18 May 2008 - 06:56 PM

Before any of you use this to quick-mash your dps button, you may want to take a look at this post:
Stopcasting, Quartz, and Patch 2.3 | Altitis

#4 Flamingcloud

Flamingcloud

    Great Tiger

  • Members
  • 768 posts

Posted 18 May 2008 - 07:03 PM

Before any of you use this to quick-mash your dps button, you may want to take a look at this post:
Stopcasting, Quartz, and Patch 2.3 | Altitis


I am gonna test this right now but I think it is very likely that post is not accurate.

#5 Flamingcloud

Flamingcloud

    Great Tiger

  • Members
  • 768 posts

Posted 18 May 2008 - 07:24 PM

As I expected not remotely accurate.. Spamming with autohotkey got me 55.55 bolts in 2 minutes, not spamming using quartz got me 52.28 bolts. Spamming without autohotkey got me 55.55 bolts. Perfect world is 55.8 bolt(tooltip reads 2.15 cast time) so I have an effective cast lag of 0.01, which is probably smaller than the margin of error in my 2 minute test (casting starting no perfectly on time, and me not gauging the fractional shadowbolt properly).

Conclusion: Spamming via either method is the best, but using autohotkey means your finger doesn't get sore.

Edit: my actual cast time is 2.153 when calculated out without chopping, so 55.73 shadowbolts would be perfect cast. Putting the macro (with sleep 0 tested only) at 0.0072seconds cast lag. A test at 10-15 minutes would become far more accurate for comparing the three methods, but I am not willing to do the test.

#6 Tymir

Tymir

    Von Kaiser

  • Members
  • 88 posts

Posted 18 May 2008 - 07:33 PM

From my testing the above article is incorrect, the temporary global cooldown does not prevent spell requests being sent to the server (atleast not anymore). Also if a spell's cast time is equal to or less than the GCD you don't even observe the temporary GCD.

#7 insi9nia

insi9nia

    Von Kaiser

  • Members
  • 28 posts

Posted 18 May 2008 - 07:53 PM

Control characters on multiple accounts


I would like to see a sample script for this please.
eg: Autolooting on the secondary character, without having to alt-tab from the first.
Maniq loves me.
That is awesome.

#8 Tymir

Tymir

    Von Kaiser

  • Members
  • 88 posts

Posted 18 May 2008 - 08:04 PM

Enter any key for X.

WinGet, wowid, List, World of Warcraft
~x::
KeyWait 1
IfWinActive, World of Warcraft
{
ControlSend,, x, ahk_id %wowid1%
ControlSend,, x, ahk_id %wowid2%

Is that was what you were looking for?

#9 Golasus

Golasus

    Glass Joe

  • Members
  • 1 posts

Posted 18 May 2008 - 08:06 PM

This is the script I use to 2 box, it uses the numeric keypad to control my secondary charater. my primary character doesnt have any keys bound to the numpad. I have had no problems with it at all. I did not write this just modifed the keys i wanted to use for my needs. Ive been running it for around 5 months or so, im pretty sure if you keep to the 1 button press = 1 action done rule you will not run in to trouble with blizzard.


; Wow Duel Account Helper Version: .02a 
; Language:       English 
; Platform:       AutoHotkey Script 
; Author:         Sorn 
; NOTES: Written for the Duel-Boxing.com forums, Send PM or post in the Autohotkey thread for assistance or suggestions 
; 
; Script Function: 
;   Allows you to play two copies of WOW at the same time 
; 

;Tell user what is about to happen 
SplashTextOn, 325, , Preparing to find your Main and Clone windows of WoW. 
Sleep, 2000 
SplasHtextoff 

;Grab unique window ID's 
WinGet, wowid, List, World of Warcraft 

; Minimize All WOW windows 
WinMinimize, ahk_id %wowid1% 
WinMinimize, ahk_id %wowid2% 

;Determine Main and Clone Windows 
WinActivate, ahk_id %wowid1% 

MsgBox, 4,, Is this your WOW Main window? (press Yes or No) 
IfMsgBox Yes 
   idMain = %wowid1% 
else 
   idMain = %wowid2% 

If idMain = %wowid1% 
{ 
   idClone = %wowid2% 
} else { 
   idClone = %wowid1% 
} 

;Activate All WOW windows 
WinActivate, ahk_id %idMain% 
WinActivate, ahk_id %idClone% 


;*** Special Functions *** 


; ******************* 
; *** Numpad 0-6  *** 
; ******************* 
#IfWinActive, World of Warcraft 
   ~Numpad0:: 
   ControlSend,,{Numpad0 down}{Numpad0 up},  ahk_id %idClone% 
return 

#IfWinActive, World of Warcraft 
   ~Numpad1:: 
   ControlSend,,{Numpad1 down}{Numpad1 up},  ahk_id %idClone% 
return 

#IfWinActive, World of Warcraft 
   ~Numpad2:: 
   ControlSend,,{Numpad2 down}{Numpad2 up},  ahk_id %idClone% 
return 

#IfWinActive, World of Warcraft 
   ~Numpad3:: 
   ControlSend,,{Numpad3 down}{Numpad3 up},  ahk_id %idClone% 
return 

#IfWinActive, World of Warcraft 
   ~Numpad4:: 
   ControlSend,,{Numpad4 down}{Numpad4 up},  ahk_id %idClone% 
return 

#IfWinActive, World of Warcraft 
   ~Numpad5:: 
   ControlSend,,{Numpad5 down}{Numpad5 up},  ahk_id %idClone% 
return 

#IfWinActive, World of Warcraft 
   ~Numpad6:: 
   ControlSend,,{Numpad6 down}{Numpad6 up},  ahk_id %idClone% 
return

#IfWinActive, World of Warcraft 
   ~Numpad7:: 
   ControlSend,,{Numpad7 down}{Numpad7 up},  ahk_id %idClone% 
return

#IfWinActive, World of Warcraft 
   ~Numpad8:: 
   ControlSend,,{Numpad8 down}{Numpad8 up},  ahk_id %idClone% 
return

#IfWinActive, World of Warcraft 
   ~Numpad9:: 
   ControlSend,,{Numpad9 down}{Numpad9 up},  ahk_id %idClone% 
return

#IfWinActive, World of Warcraft 
   ~NumpadDot:: 
   ControlSend,,{NumpadDot down}{NumpadDot up},  ahk_id %idClone% 
return

#IfWinActive, World of Warcraft 
   ~Numpadadd:: 
   ControlSend,,{Numpadadd down}{Numpadadd up},  ahk_id %idClone% 
return


#10 Chaostheoryx

Chaostheoryx

    Von Kaiser

  • Members
  • 37 posts

Posted 18 May 2008 - 08:16 PM

The author states in the comment section, "Spamming will become counter-productive with the new system, and I expect noticeably so if your average latency is above 150ms (as you get twice that amount since the signal needs a round-trip)." This is madness. '150ms latency' refers to a 150ms round-trip time, not 300.

I don't believe his diagrams show the whole picture, either. The nature of cast mechanics are largely theoretical since we can't see the code ourselves. The true test of any theory is whether it allows one to make accurate predictions. The one prediction that I see coming from this theory is that "spamming will result in a larger penalty than timing." However, I have anecdotal and measured data from numerous subjects which counters this assertion flatly.

Fact 1: Casting interval as measured by LagInfo | World of Warcraft Addons | Curse (records the time between client-side cast completion and cast start) is drastically reduced in all observed cases using AHK over manual timing. For consecutive casts of the same spell, an interval of 0ms can be achieved reliably.

Fact 2: Manually parsing combat logs in Excel, the interval between CAST_START messages have shown intervals consistently well below round-trip time. Test results here: http://elitistjerks....0-post1654.html

Anecdote 1: Using AHK with a 4:1 spell rotation I was able to achieve 2k DPS as an elemental shaman w/o 4-set bonus (=http://wowwebstats.com/bvswaybvv5rdo?s=15245,15359).

There is no observable "spam penalty."

#11 Guest_Altitis_*

Guest_Altitis_*
  • Guests

Posted 18 May 2008 - 09:17 PM

There is no observable "spam penalty."


Any more. When I wrote the initial post, end of October last year, the behaviour was consistent with both Slouken's explanations and what was observable and measurable on the PTR first (and had been confirmed by other EJ readers back in the day), and made it to live.
It was quite an issue with in particular to rogues and warriors in PvP, and they fixed the mechanism a couple of weeks later, in 2.3.2 if memory serves. There's even a trace you can find on youtube of a couple of videos made specifically around exploiting the mechanism while it lasted.

Things change in the game. Not placing specific mechanism posts in their accurate code timeframe may produce funky results.

#12 Macblade

Macblade

    Piston Honda

  • Members
  • 239 posts

Posted 18 May 2008 - 11:13 PM

#ifWinActive World of Warcraft
{
$2::
   Loop  
   {
    if not GetKeyState("2", "P")
      break
     Send 2 
     sleep 1
    }
return
$6::
   Loop  
   {
    if not GetKeyState("6", "P")
      break
     Send 6 
     sleep 1
    }}
return


Just to interject with a nub question. I'm not very familiar with writting code, but would the above code loop both the "2" key and the "6" key?

#13 Chaostheoryx

Chaostheoryx

    Von Kaiser

  • Members
  • 37 posts

Posted 18 May 2008 - 11:57 PM

Yes. If you press and hold '2' (not numpad 2, that's a different key) it will repeatedly send 222222 with a 1ms interval. The same applies for 6. Each is independent in that you could delete the $6:: line and down as long as you close any open brackets. To change the number, you would simple replace all three 2's or all three 6's. I wrote this just by looking at the AHK documentation so I suspect there are more clever methods and additions people will come up with.

#14 Chlor

Chlor

    Glass Joe

  • Members
  • 8 posts

Posted 19 May 2008 - 12:07 AM

Just to interject with a nub question. I'm not very familiar with writting code, but would the above code loop both the "2" key and the "6" key?


Not at the same time it won't. The script snipped above just has 'autofire' enabled for the '2' and the '6' keys, you can easily just remove the lower portion and change the key for the upper portion if you use say '4' as your main nuke.

To remove the 'That ability is not ready yet' spam you should put the following into your main nuke macro:

#showtoolip <Spell>
/console Sound_EnableSFX 0
/run UIErrorsFrame:Hide()
/cast <Spell>
/run UIErrorsFrame:Clear()
/run UIErrorsFrame:Show()
/console Sound_EnableSFX 1

(I'm sure this could be shortened to two or three lines but it works for me and I have the spare macro space)

This disables error message sounds, then hides the error frame, then (attempts to) cast the spell. Once done, it clears the error frame and un-hides it then turns error sounds back on.

All you'll hear with this macro is the clicking sounds of a button being pressed. As some have said in the Elemental Shaman thread, you might see some added latency if you have other spells and/or trinkets included in this macro for some reason.

#15 Macblade

Macblade

    Piston Honda

  • Members
  • 239 posts

Posted 19 May 2008 - 01:10 AM

I'm just curiuos what sort of processing power this program and the macro to remove the error message and sound might add. Is it unnoticeable, because it seems that at some point you are asking your computer to do more things than you were asking it to do before, so at some point it would seem that it would have to slow down your computer...

#16 wyldbill

wyldbill

    Piston Honda

  • Members
  • 123 posts

Posted 19 May 2008 - 03:54 AM

(I'm sure this could be shortened to two or three lines but it works for me and I have the spare macro space)


It can: remove the calls to hide and show the errors frame, leave only the one to clear the errors frame. Be warned that you're also clearing some other messages that echo to that frame: range, out of ammo, Feign Death resisted, to name a few. Some of these messages will be presented by a combat-text mod (parrot, mik's scrolling battle text, SCT, et cetera) but others will not be copied by such an addon.

We use the same trick to clear the UIErrorsFrame in the hunter shot rotation macro(s) and long since removed the unnecessary calls to hide & show the frame.

#17 Guest_7Sam_*

Guest_7Sam_*
  • Guests

Posted 19 May 2008 - 06:05 PM

Here is an AutoHotkey Guide made by the community of Duel-Boxing.com:
The Guid

As for Blizzard's stand in regards to this software, I can confirm that Skyhoof's saying is correct and if you seek proof then check out the following post.

#18 Squishalius

Squishalius

    Glass Joe

  • Members
  • 14 posts

Posted 21 May 2008 - 08:23 PM

Not being sure what to think I posted on the Blizzard CS forums.

WoW Forums -> Scripting & Macros

To me the CS person was pretty clear but... I have just looked a bit deeper into the TKA forums and have seen a lot of people discussing Autohotkey but nobody saying "DO NOT USE!" Having also a Hunter I can see where they would surely want this level of functionality.

So at this point I'm pretty damn confused. Are all those Hunters who are most likely using Autohotkey at this point risking action or was the Blizz CS drone just saying no without really understanding what was being said?

#19 Octaviann

Octaviann

    Piston Honda

  • Members
  • 121 posts

Posted 21 May 2008 - 10:25 PM

The general rule is, so long as one key press stays one key press, you're okay. That means that holding a key and having it push repeatedly is sort of a grey area, since the goal is to prevent you from pushing a key and walking away. I would say that it's okay, but if you're ever told in-game not to do it, then clearly you should stop. Using autohotkey for other purposes, like multiboxing, et cetera, is perfectly legal, and this is documented. I'd go with the general rule of something like "Holding to push the same key repeatedly is okay, as is pushing single keys once, but putting in time delays or pushing multiple keys repeatedly when not holding is not okay."

By the way, the Blizzard CMs and GMs aren't always the sole voice of authority. Sometimes they don't have access to all of the information and can give conflicting replies. If you ever really, truly want to find out Blizzard's stance on an issue like this, send them an email and see what they say.

#20 Praetorian

Praetorian

    Mike Tyson

  • ♦ Administrators
  • 27,801 posts

Posted 22 May 2008 - 12:02 AM

The reality is that a lot of things are against the letter of their policy, but are unenforceable unless abused. You're never going to find a CM or CS rep who says "Sure, using X application to automate multiple keystrokes is fine!" because it'd leave them in a bad spot when it comes to enforcement. Holding down the 2 key to spam "2" really rapidly instead of breaking your keyboard and tiring out your hand by mashing it really rapidly are functionally indistinguishable. If you are running software that Blizzard bans ("third-party apps" -- basically specific bots, other things that hook into the WoW app, etc.) then you will be banned no matter what you use them for -- simply running that software is a violation of the ToU. If a given application (AHK, or the G15 software, etc.) isn't one that is inherently bannable, then it all boils down to what you use it for. If you hit a script that makes you jump every 2 minutes and use it to afk in BGs, then you're basically botting and you will get banned if caught. If you use a hotkey that hides your UI, takes a screenshot, and then redisplays your UI with a single keypress, you won't get banned. It isn't realistic nor a worthwhile use of Blizzard's time to hunt down people who press a key once and have it try to cast fireball many times a second, as compared with people who wear out their fireball key spamming it, as compared with people who bind it to "mousewheel up" and spend the whole raid spinning their mousewheel to generate numerous rapid inputs.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users