Advertisement
cemxokenc

Warcraft III Masin RPG

Apr 29th, 2025
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SendText(hwnd, text) {
  2.     Loop, Parse, text
  3.     {
  4.         ControlSend,, %A_LoopField%, ahk_id %hwnd%
  5.         Sleep, 50
  6.     }
  7. }
  8.  
  9. #Persistent
  10. SetTitleMatchMode, 2
  11. DetectHiddenWindows, On
  12. SetTimer, SendCommands, 300000
  13.  
  14. SendCommands:
  15.    WinGet, idList, List, Warcraft III
  16.     total := idList
  17.  
  18.     if (total = 0) {
  19.         MsgBox, Warcraft III windows not found
  20.         Return
  21.     }
  22.  
  23.     commands := ["-quest", "-greed", "-str"]
  24.  
  25.     Loop, %total%
  26.     {
  27.         hwnd := idList%A_Index%
  28.  
  29.         for index, cmd in commands
  30.         {
  31.             ControlSend,, {Enter}, ahk_id %hwnd%
  32.             Sleep, 200
  33.             SendText(hwnd, cmd)
  34.             Sleep, 200
  35.             ControlSend,, {Enter}, ahk_id %hwnd%
  36.             Sleep, 300
  37.         }
  38.  
  39.         if (A_Index < total) {
  40.             Sleep, 10000
  41.         }
  42.     }
  43. Return
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement