Advertisement
RandaliciousRS

Basics of AHK (Credit Jiklim)

Aug 14th, 2015
6,442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.39 KB | None | 0 0
  1. How To Download and Install AHK
  2.  
  3. I made this guide as some people were interested in this program. It is by far better than the program MouseKeys which , so I would suggest moving over to this as it will be more beneficial. This tutorial will be for Windows, so if you use Mac or Linux then look away.
  4.  
  5. First of all, you will need to download AutoHotkey. This can be found by visiting the website: http://www.autohotkey.com and then clicking the download button. Can be beneficial to install everything in the default directories, but i'm sure that you wont need to change any of the directories.
  6.  
  7. Then once you have done that, make sure it is installed properly by going onto the Start Menu and then selecting All Programs, and it should look something like this: http://i.imgur.com/BBZaTDi.png
  8.  
  9. Then you are ready to follow the next few steps in this text tutorial.
  10.  
  11. How To Use AHK After Installing
  12.  
  13. 1. Find somewhere to store scripts that you use with AutoHotkey. My suggestion is to make a new folder on the desktop and label it correctly so you know what's within, and then move the folder to wherever. Within the folder, you now want to make a new script like so: http://i.imgur.com/z6vS8yX.png
  14.  
  15. 2. Once you have done that, you can now right click and edit the script. There will be already text within, but you don't need it so just delete it. Now you can make your own script. An example of what you would perhaps use a script for to abbreviate your message, typing the same message without Copying and Pasting it, etc. This is done like so:
  16.  
  17. ::X::Y
  18. X = Abbreviation
  19. Y = Outcome of typing abbreviation
  20.  
  21. So an example of this use would be: ::Wuu2::What are you up to?
  22.  
  23. This will mean that whenever you type 'wuu2' like so: http://i.imgur.com/ZsMGItN.png
  24.  
  25. Hitting space will replace 'wuu2' with 'What are you up to?' which as you can tell, is helpful during wars or pking as such
  26.  
  27. 3. After you have made the script, you can then save the script and run it. When it is running, it will appear on the taskbar at the bottom-right hand side of your screen displayed as a letter H with a green box surrounding it, shown here: http://i.imgur.com/fJHsqpB.png
  28.  
  29. Now whenever you type the abbreviation you wanted to use, after you hit space the message you wanted to abbreviate will appear. This can be useful on the forums and within IRC.
  30.  
  31. A second example is if your keyboard has a key or two that is broken. You can use the 'send' command to input a different key to the one you pressed.
  32.  
  33.     F2::
  34.     Send {Escape}
  35.     return
  36.  
  37. This will allow you to use the 'F2' key as an 'Escape' button. This is helpful for when important keys won't work anymore, and gives you more time to either buy a new keyboard or more usage out of your old keyboard.
  38.  
  39. There are many commands: http://www.autohotkey.com/docs/commands.htm and keys: http://www.autohotkey.com/docs/KeyList.htm you can use with AHK.
  40.  
  41. How to use AHK for Runescape
  42.  
  43. Now here's what you are probably looking for. There are several commands that allow AHK to be effective in Runescape. Here's an example of a script I use to Withdraw / Deposit All items, which uses the commands 'MouseMove' and 'Click'. Pressing the 'Grave' key ( ` ) will move the mouse down by 70 pixels, and the other key ( 1 ) is for left clicking.
  44.  
  45.     `::
  46.     MouseMove, 0, 70, 1, R
  47.     return
  48.     1::
  49.     Click
  50.     return
  51.  
  52. A second example is a script to both withdraw/deposit and drop items. For this example, I just added on from my first example, and with trial and error, found the correct amount of pixels to move the mouse down by in order to hover over the next item.
  53.  
  54.     2::
  55.     MouseMove, 0, 35, 1, R
  56.     return
  57.  
  58. And finally, what I would use for superheating. This allows you to click on the spell, and then allows you to move the mouse up and down repetitively by 140 pixels to go from the last ore in your inventory, to the Superheat spell in the magic spellbook, and vice versa. You can change the keys I use to make it more suitable for you (the number/key you change is before the first set of 2 colons.)
  59.  
  60.     4::
  61.     MouseMove, 0, -140, 1, R
  62.     return
  63.     5::
  64.     MouseMove, 0, 140, 1, R
  65.     return
  66.  
  67. You can find out what MouseMove does by going to the commands section on the website, which there is a link to just before this section about AHK usage in Runescape. Alternatively, this is what each section of the command does:
  68.  
  69. MouseMove, X, Y, Speed, R
  70.  
  71. X / Y - The X/Y coordinates to move the mouse to, which can be expressions.
  72.  
  73. Expressions: http://www.autohotkey.com/docs/Variables.htm#Expressions are used to perform one or more operations upon a series of variables, literal strings, and/or literal numbers.
  74.  
  75. Speed - The speed to move the mouse in the range 0 (fastest) to 100 (slowest), which can also be an expression. If no value is set, the default value is 2.
  76.  
  77. R - If this parameter is the letter R, the X and Y coordinates will be treated as offsets from the current mouse position. (The cursor will be moved from its current position by X pixels to the right (left if negative) and Y pixels down (up if negative)).
  78.  
  79.  
  80. Frequently Asked Questions (FAQ's)
  81.  
  82. Q: Will using this program get me banned?
  83.  
  84. A: As long as the script doesn't allow for more than one action per key press, then you won't be banned. AHK is basically MouseKeys but better as you can use it in many different ways. It is advanced enough to do lots of things which are very complex and require vast knowledge of the program to be able to execute. However, as long as you keep to the 1:1 Input:Output rule, you should be fine and won't get banned.
  85.  
  86. Q: Can I run two or more scripts at a time?
  87.  
  88. A: Yes you can. In my opinion, I don't see why you would as you can have more than one command per key. Only problem is that you can't use more than one command per key in Runescape and other games where such macroes that allow more than one command per key is not acceptable.
  89.  
  90. Thank you for reading, and hopefully this works out for you. If you found this helpful, please vote in the poll at the top of this thread, that way I can see if my guides are helpful. Constructive criticism is always advised as it helps improve what I have done. Good luck with improving your performance within RuneScape with this guide, and doing tasks more efficiently!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement