Guest User

Autohotkey script for TOAW4

a guest
Jan 10th, 2018
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. #Warn  ; Enable warnings to assist with detecting common errors.
  3. #UseHook On ; Keyboard hook
  4. #SingleInstance force
  5. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  6. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  7.  
  8. ;#IfWinActive The Operational Art of War
  9. ;#IfWinActive ahk_exe Opart 4.exe
  10. #If WinActive("ahk_class The Operational Art of War") and WinActive("ahk_exe Opart 4.exe")
  11.  
  12. ; Suspend: Pause
  13. Pause::Suspend
  14.  
  15. ;WASD keys
  16. w::Up
  17. a::Left
  18. s::Down
  19. d::Right
  20.  
  21. ; Other remappings
  22. +w:: ; Shift+W - Weather Report
  23.    Send w
  24.    Return
  25. +a:: ;Shift+A - Air Unit Report
  26.    Send a
  27.    Return
  28. ^a:: ;Ctrl+A - Air Briefing
  29.    Send +a
  30.    Return
  31. +d:: ;Shift+D - Dig In
  32.    Send d
  33.    Return
  34. x:: ;X - Center map on unit
  35.    Send {NumPad5}
  36.    Return
  37. q:: ;Q - Unit Report
  38.    Send u
  39.    Return
  40. e:: ;E - Next Unit
  41.    Send n
  42.    Return
  43. +e:: ;Shift+E - Previous unit
  44.    Send -
  45.    Return
  46. ^e:: ;Ctrl+E - End Turn
  47.    Send e
  48.    Return
  49. Space:: ;Space - Plan Attack
  50.    Send p
  51.    Return
  52. v:: ;V - Toggle view units, hold down needs check for Space
  53.    Send {Space down}
  54.    KeyWait, v
  55.    Send {Space up}
  56.    Return
  57.  
  58. #IfWinActive
  59.  
  60. /***************
  61. ; The long-winded WASD way
  62. ; WASD Keys
  63. w::
  64.    Send,{Up down}
  65.    KeyWait, w
  66.    Send,{Up up}
  67.    Return
  68. a::
  69.    Send,{Left down}
  70.    KeyWait, a
  71.    Send,{Left up}
  72.    Return
  73. s::
  74.    Send,{Down down}
  75.    KeyWait, s
  76.    Send,{Down up}
  77.    Return
  78. d::
  79.    Send,{Right down}
  80.    KeyWait, d
  81.    Send,{Right up}
  82.    Return
  83.  
  84. ; The Remap shortcut
  85. ; This didn't work as well as it should... :(
  86. ; Other keys
  87. +w::w       ;Shift+W, Weather Report
  88. +a::+a      ;Shift+A, Air Briefing
  89. ^a::a       ;Ctrl+A, Air Unit Report
  90. +d::d       ;Shift+D, Dig In
  91. x::Numpad5  ;X, Center map on unit
  92. q::u        ;Q, Unit Report
  93. e::n        ;E, Next Unit
  94. +e::-       ;Shift+E, Previous unit
  95. ^e::e       ;Ctrl+E, End Turn
  96. Space::p    ;Space, Plan Attack
  97. v::Space    ;V, Toggle view units
  98. ****************/
Add Comment
Please, Sign In to add comment