November 23, 2024, 11:14:26 pm

Author Topic: Inventory AutoHotKey script - easily modifiable  (Read 1900 times)

0 Members and 1 Guest are viewing this topic.

Offline Vyvanne

  • Global Moderator
  • Shaman
  • *****
  • Posts: 153
  • Total likes: 15
  • Formerly Elsha-of-IEL
    • View Profile
  • B.net Account: Vyvanne
  • Coins: 100
  • Country: USA
  • Race: Undead
Inventory AutoHotKey script - easily modifiable
« on: November 29, 2018, 01:57:19 pm »
I've had a couple requests for the script I use for inventory hotkeys, so here it is below. It's very easily modifiable to whatever keys you want to use. AHK scripting is pretty straightforward and easy to learn, I have no programming background/experience and was able to understand things pretty quickly.

Basically what I created was a very simple script that substitutes a keypress to map to the numpad key.  I'll flesh this out later and add some pictures for the visual learners, but hopefully it should be understandable in text.

Wc3's inventory hotkeys use the numpad as we all know-

78
45
12

These six numpad buttons correspond to each slot.  The system I use should be familiar to moba players, it's what is used in Dota and I assume in League as well- alt + hotkey = numpad key.

I use Q, alt Q, alt W, alt E, alt A, alt S, and alt D. 

-Important links-
https://autohotkey.com/docs/Hotkeys.htm
https://autohotkey.com/docs/KeyList.htm

Useful links to understanding the syntax of the code and making it as clean as possible - for instance, !A means using the hotkey alt + A. 


Code: [Select]
; Inventory Keys:
 
F5::
Suspend, Toggle
 
Q::SendInput, {Numpad7}
!Q::SendInput, {Numpad8}
!A::SendInput, {Numpad4}
!W::SendInput, {Numpad5}
!D::SendInput, {Numpad1}
!E::SendInput, {Numpad2}
 

Copy the code into a notepad file and save it as a .AHK extension and name it whatever you like.  A program like Notepad++ is far infinitely better than Windows notepad and makes organizing things very nice.  Run it whenever you're playing Wc3, but remember to close the script down if you're doing other things (or even more importantly other games that use those hotkeys!)



The net result is that if I press F5, it starts and ends the script - this is a very useful thing to have for those of you who want to substitute a regular letter instead of using a letter + modifier (ctrl A and alt A instead of just A, for instance).

If you don't have this toggle and you do use regular letters for hotkeys, then it will mess up your chatting. I really like mine because it doesn't affect my chat except if the word has the letter Q in it. So "require" looks like "re7uire." 

Let me know if anyone has questions or issues adapting this script for your own. I'll continue to flesh out this post with some images later for ez understanding.

Cheers.
« Last Edit: November 29, 2018, 02:02:38 pm by Vyvanne »
All knowledge is worth having.
That which yields, is not always weak.

Offline IWANTWC4

  • Tauren
  • ****
  • Posts: 253
  • Total likes: 24
    • View Profile
  • B.net Account: DONALD-TRUMP
  • Coins: 100
  • Country: USA
  • Race: Random
Re: Inventory AutoHotKey script - easily modifiable
« Reply #1 on: November 30, 2018, 12:05:08 pm »
Thanks I'll see if I can figure it out next time I get on wc3.