Advertisement
Guest User

WoW Multibox

a guest
Feb 28th, 2020
971
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. #SingleInstance, Force
  2. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  3. ;~ #Warn ; Recommended for catching common errors.
  4. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  5. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  6. SetTitleMatchMode, 2 ; Fast|Slow|RegEx|1|2|3
  7.  
  8. ; ****************
  9. ; Variables
  10. ; ****************
  11.  
  12.  
  13. ; Put Variables in here
  14.  
  15. ;~ Notepad for testing
  16. ;~ *** To Run other progrm un-commnt their line
  17.  
  18. ;~ Program := "Notepad" ; or your language name for Notepad as displayed in the titlebar!
  19. ;~ Program := "Overwatch"
  20. Program := "Warcraft"
  21.  
  22. IfEqual, Program, Notepad,
  23. Target := "C:\Windows\system32\notepad.exe"
  24. IfEqual, Program, Overwatch
  25. Target := "F:\Overwatch\Overwatch.exe"
  26. IfEqual, Program, Warcraft
  27. Target := "C:\Users\Public\Public Games\World of Warcraft\_retail_\Wow.exe"
  28.  
  29.  
  30. #include, Creds.ini
  31. ;~ Credentials have now been moved to their own support file "Creds.ini"
  32. ;~ Creds.ini must be in the same folder with the main script.
  33.  
  34. global ProgID := ""
  35. global ProgList := []
  36.  
  37.  
  38. ;~ *** Screen Dimentions & Taskbar Hiding ***
  39. tb=40 ; *** Adjust if your taskbar is a different height ***
  40. ;~ tb=0 ; *** "0" if your Taskbar is set to "autohide" or you wish to hide your Taskbar to use all available screen space. ***
  41. IfEqual, tb, 0, WinHide ahk_class Shell_TrayWnd
  42. else
  43. WinShow ahk_class Shell_TrayWnd
  44.  
  45. W=%A_ScreenWidth%
  46. H=%A_ScreenHeight%
  47. H:=H-tb
  48.  
  49. GroupAdd, Games, ahk_class TankWindowClass
  50.  
  51.  
  52. ; ****************
  53. ; Script
  54. ; ****************
  55.  
  56.  
  57. ;~ /*
  58. InputBox, Num, Open Programs, "How many programs do you want to open?",,,,,,,, 12
  59.  
  60. ;~ Check for, and load required number of games
  61. WinGet, ProgID, List, %Program% ; Detect how many open already
  62. while ProgID < Num
  63. {
  64. run %Target%
  65. WinWaitActive, %Program%
  66. WinMinimize, %Program%
  67. WinGet, ProgID, List, %Program%
  68. } ToolTip, %ProgID%
  69. */
  70.  
  71.  
  72. WinGet, ProgID, List, %Program% ; Dete
  73. Loop %ProgID%
  74. ProgList.push(ProgID%A_Index%)
  75.  
  76.  
  77. ;~ /*
  78. ;~ Lay out games
  79. Win_X := Win_Y := "0"
  80. Loop % ProgList.Length() ;%ProgID%
  81. {
  82. game := ProgList[A_Index]
  83. WinActivate, ahk_id %game%
  84. WinSet, Style, -0xC00000,ahk_id %game% ; Remove titlebar & borders
  85. WinMove, ahk_id %game%,,Win_X, Win_Y,W/4,H/3
  86. Win_Y += H/3
  87. if Win_Y >= %H% ; Floor(Sqrt(ProgList.Length())
  88. {
  89. Win_Y := "0" ; Win_Y += H/3
  90. Win_X += W/4
  91. }
  92. }
  93. */
  94.  
  95.  
  96.  
  97.  
  98. ;~ /*
  99. ;~ Login games
  100. MsgBox, all games loaded and layed out correctly?
  101. SetKeyDelay, 100, 30
  102. Loop % ProgList.Length()
  103. {
  104. game := ProgList[A_Index]
  105. ;~ WinActivate, ahk_id %game%
  106. WinGetPos, Cur_X, Cur_Y, Width, Height, ahk_id %game%
  107. WinMove, ahk_id %game%,, A_ScreenWidth * 0.24, A_ScreenHeight * 0.3,Width*2,Height*2
  108.  
  109. User := Creds[A_Index][1]
  110. Pass := Creds[A_Index][2]
  111.  
  112. ControlSend,, %User%{Tab}%Pass%{Enter}, ahk_id %game%
  113. WinMove, ahk_id %game%,, Cur_X, Cur_Y, W/4, H/3
  114. } SetKeyDelay, -1, -1
  115. */
  116.  
  117. ; ****************
  118. ; Hotkeys
  119. ; ****************
  120.  
  121. $W:: Multi("w")
  122. $A:: Multi("a")
  123. $S:: Multi("s")
  124. $D:: Multi("d")
  125. $Q:: Multi("q")
  126. $E:: Multi("e")
  127. $B:: Multi("b")
  128.  
  129. BS:: Multi("BS")
  130. DEL:: Multi("Del")
  131.  
  132. ;~ *** Show or Hide Taskbar ***
  133. ^#!H::WinHide ahk_class Shell_TrayWnd
  134. ^#!t::WinShow ahk_class Shell_TrayWnd
  135.  
  136. ; *** Logout Toons ***
  137. +F12::
  138. Send, /
  139. Sleep, 100
  140. Send, logout{ENTER}
  141. return
  142.  
  143. ; *** Exit Games ***
  144. ^#F12:: WinClose ; *** Exit current active game ***
  145. ^#!F12:: WinClose ahk_group Games ; *** Exit all games ***
  146.  
  147. ; ****************
  148. ; Functions
  149. ; ****************
  150.  
  151. ; Functions here
  152.  
  153. ;~ /*
  154. Multi(key)
  155. {
  156. pr := "1"
  157. while pr
  158. {
  159. ToolTip, Down
  160. Loop % ProgList.length()
  161. {
  162. game := ProgList[A_Index]
  163. ControlSend,, {%key% Down}, ahk_id %game%
  164. ToolTip, Down
  165. }
  166. pr := GetKeyState(key, "P")
  167. }
  168. Loop % ProgList.length()
  169. {
  170. game := ProgList[A_Index]
  171. ControlSend,, {%key% Up}, ahk_id %game%
  172. ToolTip, Down
  173. }
  174. ToolTip, Up
  175. return
  176. }
  177. */
  178.  
  179.  
  180.  
  181. ; ****************
  182. Pause::Suspend
  183. ^F11:: Menu, Tray, Icon
  184. ^F12:: Menu, Tray, NoIcon
  185.  
  186. #ifwinactive ahk_class Notepad
  187. ~^s::
  188. #ifwinactive ahk_class Notepad++
  189. ~^s::
  190. #ifwinactive ahk_class SciTEWindow
  191. ~^s::
  192. Sleep, 500
  193. ; Checks for changes to the saved script.
  194. FileGetTime, NewModTime, %A_ScriptName%, M
  195. isIt := A_Now-NewModTime
  196. IfLessOrEqual, isIt, 2, Reload
  197. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement