Register
  • Quick AutoHotKey Guide to Background Prospecting and Milling Legitimately

    AutoHotKey has been around for ages now but I've always been so hesitant to get involved with it since it is so very well known for it's automation ability which is against Blizzard's ToS or EULA, but over the last year or two it has become extremely popular via the huge multi-boxing community.

    I know the Wind Traders and some others have discussed the use of AutoHotKey several times now, some touching on the slightly more illegitimate uses, which has again caused me to shy away from it slightly. The other day a discussion popped up on the forums about using AHK legitimately for milling/prospecting and Jenzali posted a neat little simple script that can be used.

    I gave it a try and it works wonderfully, so I'm writing a quick guide to help anyone else interested focus on the purely legitimate uses of AHK.


    This tutorial will help you setup AutoHotKey to send the keypress "=" into World of Warcraft every time there is movement on your mouse, even if you are busy browsing the internet with wow in the background.

    Alright well head over to the AHK Download Page and download the appropriate version for you. You can choose between the .exe file or a zip file as well.

    Start up the installation wizard, accept the ToS and select Main Program and Script Compiler as components to install. Continue through the basic installation and skip showing the help file unless you really want to.

    When you start it up the first time it will give you a message saying "To help you get started, would you like to create a sample script in the My Documents folder?". Click Yes.

    It will now open a notepad file which is the script, it has some basic instructions to help you understand it. Delete it all and replace it with this script:

    Code:
    #persistent
    coordmode, mouse, screen
    
    
    mousegetpos, sx, sy
    
    
    settimer, check, 4000
    return
    
    ;*** Pause Script ***
    ~=::Pause
    
    check:
    mousegetpos, cx, cy
    if (cx != sx or cy != sy)
    {
      ; mouse has moved, calculate by how much
      if (cx > (sx+2) or cx < (sx-2) or cy > (sy+2) or cy < (sy-2))
      {
        ControlSend,,1,World of Warcraft
        mousegetpos, sx, sy ; get new mouse position
      }  
    }      
    return
    Credits go to Jenzali for the script - I only added a pause script keybind and modified it to send the keypress every 4 seconds rather than 1 second since it takes about 2.5-3 seconds on average to prospect and loot. Added 1 extra second because I don't want to spam the command too quickly. You can change the line "settimer, check, 4000' down to 3000 if you want it quicker.

    The red = is what pauses and unpauses the script. Replace it with what ever you want.
    The red 1 is the keypress it sends to wow. Replace it with what ever you want.

    Once you have the script pasted in there save the file and close it. You will now need to start AHK again (the first time was it just set it all up etc). Every time you modify the script you need to restart AHK or select "reload this script" from it's menu that you will see in a second.

    When you start it up again now, it should start automatically running and you will see a green and white "H" icon in the bottom left hand corner of your screen. Right click it and you will see the following options:


    The only ones you need to know are:
    • Reload This Script - reloads the script currently chosen, must use it if you make any edits while the script is loaded.
    • Edit This Script - opens up that text file again allows you to make quick changes.
    • Pause Script - pauses the script (will show a tick next to the option) and prevents it from running. I do this when I run out of ore/herbs and need to fetch more or have to clear bag spaces etc. It's pointless to have the script running when you have nothing to process. Click the option again to start it again.
    • Exit - yeah use your imagination.


    What we are doing here IS perfectly legitimate and allowed. It has been confirmed over and over again. HOWEVER Blizzard DOES use their own form of Automation (ironic isn't it?) in order to detect cheaters. As far as I can find there has been no case where a player has been banned/suspended for using AHK (because wow can't detect it and it's also legitemate).

    But if you are seen sitting in the middle of SW for 10 hours only prospecting at exactly even times, then it's possible that someone might report you or Blizzard will pick up the precise prospect every 4 seconds for 10 hours EVERY TIME - which is impossible by human hands for that kind of precision. Hence they may think you are fully automating it and send you a temporary or permanent ban. A quick email explaining what you were doing will get you unbanned within no time.

    In order to prevent something like this though, I would recommend opening up a ticket with something along the lines of:

    Hello there, I would like to use a macro that sends a keystroke to WoW whenever I move my mouse, but wish to check whether it is ok first.

    It requires me to be at the computer, and each keystroke is the direct and immediate result of a human action, me moving my mouse (one-to-one). If I am not at the computer, nothing is sent.

    I am wondering if this is legal or if it will get me banned?

    Thanks for your time and for such a great game.
    So that you can get a personal GM response saved on your account chat logs. If you do get banned simply tell Blizzard that you DID check with GM staff and the conversation is in your chat logs with them. You could maybe record the day/time/gm name etc when the GM does contact you in a txt file somewhere on your computer so you can tell them to go look at the chat logs on the 9th of September at 22:35PM server time between you and GM Zaveloolipop.

    Funnily enough, my first thought to try and reduce the change of an accidental ban was to add some kind of "cooldown" or random timer between key presses. @Stede helped me with some of that code causing it to a slight random delay but have since taken it out because there is some rather cloudy information that adding automatic delays to this legitimate process can turn it into a bannable action. Stede and I both think that the example which refers to this delay being bannable is used a bit out of context and that it probably isn't so, but just to be safe rather don't add anything like that.

    Another feature that I wish to add but haven't bothered to look into yet is getting AHK to send the keypress to only ONE of my multiple wow clients open. It is possible but I can't be bothered to figure out how to do it just yet.

    Quote Originally Posted by Parog View Post
    Going for a few meetings in 5 minutes so I can't help all that much, but here's what you'll need.

    AutoHotkey Guide - Dual-Boxing.com

    ^ To get a list of your process ID running by the name of World of Warcraft.

    To assign a variable to each process id so you can send the keys to a specific client.

    idMain and idClone are variable names you can change.

    ^ from your original script. Instead of specifying a window name, use the variable name for whatever window you'd like instead of World of Warcraft.

    It's all in the Wiki page.
    Again thank you to:
    @Jenzali for triggering the discussion and providing the script.
    @Stede for his insight, expertise and patience in our discussion on IRC.
    Parog from MMOwned for pointing me in the right direction for when I do eventually want to get AHK to only send to specific wow windows.
    This article was originally published in forum thread: Quick AutoHotKey Guide to background prospecting and milling legitimately started by Sinshroud View original post
    Comments 73 Comments
    1. Sinshroud's Avatar
      Sinshroud -
      Quote Originally Posted by Anbieter View Post
      I did unpause, I even deleted the whole sequence as a test, but it still doesn't work.

      Or maybe my whole approach is wrong. I created a prospecting macro and put it on "1" in my game bar (using standard GUI), so that when I press 1, my char is prospecting ore. Using this script should do the same just moving my mouse, right?
      Yes, if you manually go ingame and press 1 on your keyboard and it prospects ore, then with the script it should work too provided you are moving your mouse.
    1. Anbieter's Avatar
      Anbieter -
      Only it doesn't. Which is too bad
    1. Snodeath's Avatar
      Snodeath -
      The multiple account thing is going to be huge. If I could level my alt while milling on my other toon it would be huge. Now it should send that key stroke to all WoWs you have open. My thought off hand is to have it press an odd key you don't normally use.
    1. Bubbletown's Avatar
      Bubbletown -
      Great post.I've been using autohetkey for years (well, sinds december 2008 actually) to mill and prospect for me automaticly. I know this is against the ToS but I know for sure Blizzard doesnt ban for it (Like on Saturdays I sometimes get an inventory full of herbs, enable AHK and go to the bar and come back 8 hours later with the macro still running, never got any infraction from Blizzard)
    1. Wheatbicks's Avatar
      Wheatbicks -
      This is copy pasted from the emailed ticket response to a ticket I put in today, it was a cut copy of your sample ticket. sorry I have no screeny.

      Hello, Thank you for contacting the Game Master Department, I hope all is well today! You had let us know of an issue with using your mouse to Macro keystrokes. Ideally as long as the program or macro requires a player to control the character (by being present at the keyboard/mouse) then it should be okay to use. If it automates keystrokes with no player interaction to it, then this would be grounds for a botting program which is prohibited. I may not be able to give a definate yes or no since I personally do not know much of the progam you are using. Though I might recommend posting your idea on the tech forums for other players to help you determine if this can be used in game. If this response did not resolve your issue thoroughly please hit "Need more help" or contact wowgm@blizzard.com. If no further help is needed you can just click "Message Read" to close the window. Take Care, Game Master Collaech
    1. Faid's Avatar
      Faid -
      I decided to try this running two accounts simultaneously. However, when running two WoW clients it seems to only send the command to whatever window is currently active, the one '"tabbed out" does not receive the command.

      Any thoughts on what may fix this?

      Edited to add: I've looked over the dual-boxing.com site and while they have some things that look promising I'm not sure how to plug them into the provided script so that the 4 second delay remains.

      Basically my goal is that I could be on my main window raiding on Faid in WoW while I have the other account running in the background milling due to the mouse movements or key presses.
    1. Furyio's Avatar
      Furyio -
      Is it possible to also have this work for posting glyphs, and creating glyphs through TSM?

      I'm hunting the web but can't find anything, wonder if anyone here has had any joy?

      Basically at the moment I'm clicking to craft each glyph in TSM and clicking to post eahc glyph through TSM on the AH.

      Having it setup that when the screen are open ( AH post and craft) when I move my mouse for it to click , would be amazing and a massive bonus.

      anyone had any joy with this?
    1. Sinshroud's Avatar
      Sinshroud -
      This is my process:

      I queue up a bunch of glyphs in TSM to be crafted and then head over to the AH and start the TSM shopping module for crafting mats.
      Set AHK to press 1 every 1 second and then keybind this macro to 1:

      /click TSMShoppingDestroyingBuyButton
      /click TSMShoppingGeneralBuyButton
      /click TSMAucPostButton
      /click TSMAucCancelButton
      /click TSMShoppingDealfindingBuyButton
      /click TSMCraftNextButton
      It's a macro that does a bunch of diff things, I highlighted the one that is important here. Keep in mind occasionally TSM will buy overpriced items so use at own risk. Also if TSM runs out of mats to buy it will ask you to manually skip that item.

      Once you have bought everything head over to your mailbox and take them out.

      If you are doing something like milling or prospecting, keybind the milling/prospecting macros to 1 (there are macros listed in the professions forum section here).

      When you want to craft, open up the TSM crafting for that profession and set AHK to use the macro again (I usually set it to 3-4 seconds)

      /click TSMShoppingDestroyingBuyButton
      /click TSMShoppingGeneralBuyButton
      /click TSMAucPostButton
      /click TSMAucCancelButton
      /click TSMShoppingDealfindingBuyButton
      /click TSMCraftNextButton
      This time you are using the TSMCraftNextButton macro. Keep in mind sometimes if you are out of mats and then acquire them, or suddenly interrupt the crafting, it may require you to manually click once on the name of the item to be crafted in the right hand column to get it going again.
    1. Dbn's Avatar
      Dbn -
      I tried this by prospecting elementium while playing other games, works great! I won't anymore concencrate on that, just doing it on backround. This is REAL quality of life improvement for goblins! +rep!
    1. Xane's Avatar
      Xane -
      This ought to work with multiple clients

      Code:
      ;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% 
      } 
       
      #persistent
      coordmode, mouse, screen
       
      mousegetpos, sx, sy
       
      settimer, check, 4000
      return
       
      check:
      mousegetpos, cx, cy
      if (cx != sx or cy != sy)
      {
      ;mouse has moved, calculate by how much
      if (cx > (sx+2) or cx < (sx-2) or cy > (sy+2) or cy < (sy-2))
        {    
          ControlSend,, 1, ahk_id %idMain% 
          ControlSend,, 1, ahk_id %idClone%  
          mousegetpos, sx, sy ; get new mouse position
        }  
      }      
      return
      Edit: Confirmed, this script works well and allows for dynamic choosing of which is the main client.
    1. Sinshroud's Avatar
      Sinshroud -
      @Xane, I presume then let's say I only want to send the command to my second wow client I just remove the line "ControlSend,, 1, ahk_id %wowid1%" ?
      Is wowid2 always the client that I opened second or is there a way to check?
    1. Snodeath's Avatar
      Snodeath -
      There is a way to assign which is the main client. I'd look at this code from AutoHotkey Guide - Dual-Boxing.com
      Code:
      ;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% 
      }
      I haven't tested it, but it looks like it asks for user input to determine the main WoW window.
      This may not be necessary though, why not just send both WoWs a key press that you would never (or rarely) use. I use "[" for it.
    1. Xane's Avatar
      Xane -
      @Sinshroud , I have yet to test that. I will get back later today. What I plan to do though is send "." to both clients and if I want to Mill/Prospect on both then I move the neccesary macro the the bar with the "." keybind, and if I want to mill on only one, I move it back again. This gives me control over what and when I mill/prospect.
    1. Kathroman's Avatar
      Kathroman -
      @Sinshroud & @Xane - you need to run the following code first in the script

      Code:
      WinGet, wowid, List, World of Warcraft
      As per the AHK Dual Boxing Guide that @Snodeath linked.

      Snodeath's code doesn't look like it copied properly, since the actual command you want seems to be buried under a comment, so don't copy it verbatim. Also, the rest of it is unnecessary - if you just use that command, it will assign variables to each "World of Warcraft" window you have open, in order of appearance on your taskbar, I believe.
    1. looptroop's Avatar
      looptroop -
      hey nice guide sinshroud as always keep up the good work.

      if i have 2 screens and watch a video on the 2nd screen and prospect on the other one by pressing my prospect macro, it's not that different from this method though. both ways are easy and require me to be in front of the computer

      what do you guys think about the following scenario: I use this script so that whenever my mouse moves, the prospecting macro is pressed ingame. Now I get a fan, turn it on, install it close to my mouse so it automatically moves it every few seconds. Meaning: I built a physical, mechanical construction which moves my mouse automatically = I don't have to be in front of the computer. Is this legal or illegal then? Can blizzard even tell the difference? What do you guys think?
    1. Marahdeka's Avatar
      Marahdeka -
      I talked to a GM about this type of programs and he told me it's illegal
      Attachment 242
      Attachment 243
    1. Bellatrix's Avatar
      Bellatrix -
      I really liked this idea so I decided to contact a GM about and actually got a response within 10 minutes.



      Uploaded with ImageShack.us


      So I'm going to assume it's safe.
    1. Thanateros's Avatar
      Thanateros -
      Quote Originally Posted by Marahdeka View Post
      I talked to a GM about this type of programs and he told me it's illegal
      There are many different posts by different GMs. And as far as i am concerned, it doesn't matter if i move the mouse or if i push a button - i could easily configure the program to react to every mouse click. Fact is: If i got a wireless mouse with special buttons, and i configure one special button with "1" and "1" is the keystroke for an ingame macro to prospect / mill / DE, then i can easily sit on the couch and watch a movie while pressing the special button every 5 seconds. That is not that different from what we are doing here.

      Ofc. AutoIt can be used for automation. A co-worker used it to write his own bot (for another free-to-play game, just out of boredom since we're both programmers and into that stuff ^^). And it's not ok to use complete automisation. But it is allowed to duplicate (or multiplicate) keystrokes - that's what multiboxers are doing all of the time. They are sending one keystroke to multiple windows. And that IS allowed.

      So the only TRICKY thing here is about mouse MOVEMENT instead of keystrokes. Not the rest. So honestly, i don't think the GM in your screenshot did really know what he was talking about.
    1. Bellatrix's Avatar
      Bellatrix -
      Quote Originally Posted by Thanateros View Post
      So the only TRICKY thing here is about mouse MOVEMENT instead of keystrokes. Not the rest. So honestly, i don't think the GM in your screenshot did really know what he was talking about.
      It's probably true he didn't. The main reason for the ticket was just for it to show up in the logs, if I get banned for this, that I did ask a GM if it was legal and was told it was okay.

      Although with the mouse movement the process is slower than me just watching TV and hitting 1 of my number pad.
    1. dexwest's Avatar
      dexwest -
      @Sinshroud - I sent your GM note to my GM also, and got a very similar response to everyone else.

      I then realized that you are either leaving out a VERY large point or you avoided telling the GM's the truth all together. Your first sentence says you are using a macro to send a keystroke to wow, but that is not true. You are using AHK, a non-blizzard application to send that keystroke to WOW. I kind of wonder if you put that part in the message if you would get a very different response?