Advertisement
anonymous1184

Multi-game.ahk

Jun 5th, 2022
1,567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. F1::
  3.     width := 400
  4.     height := 600
  5.     windows := Windows("TITLE OF THE GAME WINDOW")
  6.     for _,win in windows {
  7.         WinActivate % "ahk_id" win
  8.         WinWaitActive % "ahk_id" win
  9.         WinMove % "ahk_id" win,,,, width, height
  10.     }
  11. return
  12.  
  13. F2::
  14.     ClickGame(100, 200, 100)
  15.     ClickGame(120, 220, 400)
  16.     ClickGame(140, 250, 150)
  17. return
  18.  
  19. Windows(Title := "")
  20. {
  21.     static ids := ""
  22.  
  23.     if (!ids) {
  24.         ids := []
  25.         WinGet winList, List, % Title
  26.         loop % winList
  27.             ids.Push(winList%A_Index%)
  28.     }
  29.     return ids
  30. }
  31.  
  32. ClickGame(X, Y, Wait)
  33. {
  34.     CoordMode Mouse, Window
  35.     for _,win in Windows() {
  36.         WinActivate % "ahk_id" win
  37.         WinWaitActive % "ahk_id" win
  38.         Click % X " " Y
  39.     }
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement