daily pastebin goal
10%
SHARE
TWEET

WC3-tyg-Inventory.AHK

-wtvr- May 7th, 2017 (edited) 5,453 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;;;HOW TO SETUP;;; First download and install Autohotkey.com (very simple)
  2. ;;;;;Then Create New Autohotkey Script and copy this into the new .AHK file
  3. ;;;;;OR simply download this file, rename and erase .ahk.TXT to just .AHK
  4. ;;;;;Place in your WC3 folder and create shortcut on desktop
  5. ;;;;;Usually requires right-click and setting to Run as Admin
  6. ;;;;;German Keyboards can Switch NumPad 8 from Y to Z at the bottom
  7. ;;;;;In WC3 press NumLock to pause Script on/off for chat
  8. ;;;;;Now your Invetory hotkeys are switched to TYGHBN
  9. ;;;;;Also disables WinKey or Alt+QQ from closing your game
  10. ;;;;;If mouse supports extra buttons can be remapped at bottom
  11.  
  12.  
  13. #SingleInstance force       ;force a single instance
  14. #HotkeyInterval 0       ;disable the warning dialog if a key is held down
  15. #InstallKeybdHook       ;Forces the unconditional installation of the keyboard hook
  16. #UseHook On         ;might increase responsiveness of hotkeys
  17. #MaxThreads 20          ;use 20 (the max) instead of 10 threads
  18. SetBatchLines, -1       ;makes the script run at max speed
  19. SetKeyDelay , -1, -1        ;faster response (might be better with -1, 0)
  20. ;Thread, Interrupt , -1, -1 ;not sure what this does, could be bad for timers
  21. SetTitleMatchMode Regex
  22. SetDefaultMouseSpeed, 0 ;Move the mouse faster for mouse moving commands
  23.  
  24. IfExist, Warcraft III.exe
  25.   menu, tray, Icon, Warcraft III.exe, 1, 1
  26.  
  27. ;;;;; Variables ;;;;;
  28. bInChatRoom := False
  29. bHealthBarOn := False
  30. Return ; End Auto-Execute Section
  31.  
  32. ; AutoCast Function
  33. AutoCast(iSpellQWERHotkey)
  34. {
  35.   MouseGetPos, iMousePosX, IMousePosY
  36.   if (iSpellQWERHotkey == 1)
  37.   {
  38.     iMouseGotoX := A_ScreenWidth*4//5
  39.     iMouseGotoY := A_ScreenHeight*4//5
  40.   }
  41.   else if (iSpellQWERHotkey == 2)
  42.   {
  43.     iMouseGotoX := A_ScreenWidth*4//5
  44.     iMouseGotoY := A_ScreenHeight*22//25
  45.   }
  46.   else if (iSpellQWERHotkey == 3)
  47.   {    iMouseGotoX := A_ScreenWidth*4//5
  48.     iMouseGotoY := A_ScreenHeight*19//20
  49.   }
  50.   else if (iSpellQWERHotkey == 4)
  51.   {
  52.     iMouseGotoX := A_ScreenWidth*17//20
  53.     iMouseGotoY := A_ScreenHeight*4//5
  54.   }
  55.   else if (iSpellQWERHotkey == 5)
  56.   {
  57.     iMouseGotoX := A_ScreenWidth*17//20
  58.     iMouseGotoY := A_ScreenHeight*22//25
  59.   }
  60.   else if (iSpellQWERHotkey == 6)
  61.   {
  62.     iMouseGotoX := A_ScreenWidth*17//20
  63.     iMouseGotoY := A_ScreenHeight*19//20
  64.   }
  65.   else if (iSpellQWERHotkey == 7)
  66.   {
  67.     iMouseGotoX := A_ScreenWidth*9//10
  68.     iMouseGotoY := A_ScreenHeight*4//5
  69.   }
  70.   else if (iSpellQWERHotkey == 8)
  71.   {
  72.     iMouseGotoX := A_ScreenWidth*9//10
  73.     iMouseGotoY := A_ScreenHeight*22//25
  74.   }
  75.   else if (iSpellQWERHotkey == 9)
  76.   {
  77.     iMouseGotoX := A_ScreenWidth*9//10
  78.     iMouseGotoY := A_ScreenHeight*19//20
  79.   }
  80.   else if (iSpellQWERHotkey == 10)
  81.   {
  82.     iMouseGotoX := A_ScreenWidth*19//20
  83.     iMouseGotoY := A_ScreenHeight*4//5
  84.   }
  85.   else if (iSpellQWERHotkey == 11)
  86.   {
  87.     iMouseGotoX := A_ScreenWidth*19//20
  88.     iMouseGotoY := A_ScreenHeight*22//25
  89.   }
  90.   else if (iSpellQWERHotkey == 12)
  91.   {
  92.     iMouseGotoX := A_ScreenWidth*19//20
  93.     iMouseGotoY := A_ScreenHeight*19//20
  94.   }
  95.   Click, Right, %iMouseGotoX%, %iMouseGotoY%
  96.   MouseMove, %iMousePosX%, %iMousePosY%
  97. }
  98.  
  99. #ifWinActive ahk_class ((WarcraftIII)|(OsWindow)|(Qt5QWindowIcon))
  100.  
  101. ;;;;; Enable/disable all hotkeys ;;;;;
  102. ~*Enter::
  103. ~*NumpadEnter::
  104. Suspend, Permit
  105. if (bInChatRoom == True)
  106.   return
  107. Suspend
  108. if (A_IsSuspended == true)
  109. {
  110.   SetNumLockState, Off
  111. }
  112. else
  113. {
  114.   SetNumLockState, On
  115.   SoundPlay,*48
  116. }
  117. return
  118.  
  119. ;; Escape will cancel chatting, so turn the hotkeys back on
  120. ~*Esc::
  121. Suspend, Permit
  122. if (bInChatRoom == True)
  123.   return
  124. Suspend, Off
  125. SetNumLockState, On
  126. return
  127.  
  128. *NumLock::
  129. Suspend, Permit
  130. bInChatRoom := not bInChatRoom
  131. if (bInChatRoom == True)
  132. {
  133.   Suspend, On
  134.   SetNumLockState, Off
  135.   SoundPlay,*64
  136. }
  137. else
  138. {
  139.   Suspend, Off
  140.   SetNumLockState, On
  141.   SoundPlay,*48
  142. }
  143. return
  144.  
  145.  
  146. ; Hotkeys Remapper:
  147.  
  148. ; Disable Windows Key and AltQQ GG
  149. Lwin::return
  150. <!q::return
  151.  
  152. ; Mini-Map Toggles
  153. <!g::<!g
  154. <!r::return
  155. <!t::return
  156. <!a::return
  157. <!f::return
  158. ;;to enable formation toggle add ;; to the line above
  159.  
  160. ; Inventory Keys:
  161. t::Send, {Numpad7}
  162. +t::Send, +{Numpad7}
  163. y::Send, {Numpad8}
  164. +y::Send, +{Numpad8}
  165. g::Send, {Numpad4}
  166. +g::Send, +{Numpad4}
  167. h::Send, {Numpad5}
  168. +h::Send, +{Numpad5}
  169. b::Send, {Numpad1}
  170. +b::Send, +{Numpad1}
  171. n::Send, {Numpad2}
  172. +n::Send, +{Numpad2}
  173.  
  174. ; Quick Chat Msgs
  175. Numpad1::SendInput, +{Enter}Careful{Enter}
  176. Numpad2::SendInput, +{Enter}Attack{Enter}
  177. Numpad3::SendInput, +{Enter}Focus Units{Enter}
  178. Numpad4::SendInput, +{Enter}Back{Enter}
  179. Numpad5::SendInput, +{Enter}Rush{Enter}
  180. Numpad6::SendInput, +{Enter}Focus Hero{Enter}
  181. Numpad7::SendInput, +{Enter}TP{Enter}
  182. Numpad8::SendInput, +{Enter}Counter{Enter}
  183. Numpad9::SendInput, +{Enter}Fast Expo{Enter}
  184. Numpad0::SendInput, +{Enter}Repair{Enter}
  185.  
  186. ; User Specified Hotkeys:
  187. CapsLock::Send, {Backspace}
  188. +CapsLock::Send, +{Backspace}
  189.  
  190. Xbutton1::F1
  191. Xbutton2::Numpad7
  192. Mbutton::Tab
  193. ; these^ are middle mouse and extra mouse buttons
  194.  
  195. ;;LCtrl::Space
  196. ;;Space::LCtrl
  197. ;To swap the Ctrl key with the Spacebar just remove the ;; from the 2 lines above
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top