Advertisement
cemxokenc

Warcraft III Masin RPG SemiAfk Farm

May 5th, 2025
1,325
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.  
  13. SetTimer, SendCommands, 120000
  14.  
  15. global counter := 0
  16.  
  17. SendCommands:
  18.    counter++
  19.  
  20.     WinGet, idList, List, Warcraft III
  21.     total := idList
  22.  
  23.     if (total = 0) {
  24.         MsgBox, Warcraft III windows not found
  25.         Return
  26.     }
  27.  
  28.     commands := ["-quest", "-greed", "-str"]
  29.  
  30.     Loop, %total%
  31.     {
  32.         hwnd := idList%A_Index%
  33.  
  34.         for index, cmd in commands
  35.         {
  36.             ControlSend,, {Enter}, ahk_id %hwnd%
  37.             Sleep, 200
  38.             SendText(hwnd, cmd)
  39.             Sleep, 200
  40.             ControlSend,, {Enter}, ahk_id %hwnd%
  41.             Sleep, 300
  42.         }
  43.  
  44.         if (Mod(counter, 12) = 0) {
  45.             ControlSend,, {Enter}, ahk_id %hwnd%
  46.             Sleep, 200
  47.             SendText(hwnd, "-save")
  48.             Sleep, 200
  49.             ControlSend,, {Enter}, ahk_id %hwnd%
  50.             Sleep, 300
  51.         }
  52.  
  53.         if (A_Index < total) {
  54.             Sleep, 10000
  55.         }
  56.     }
  57. Return
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement