Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.16 KB | None | 0 0
  1. #include <AutoItConstants.au3>
  2. HotKeySet("{f1}", "myExit")
  3.  
  4. Local $Counter = 1
  5.  
  6. init(); changed all that to a function to call one time(  readability)
  7.  
  8. while 1
  9.     $timer = timerinit()
  10.     Do
  11.         MouseClick("Left", 614, 532, 1, 2)
  12.         sleep(500)
  13.         MouseClick("Left", 713, 598, 1, 2)
  14.         myResult ( $Counter ) ; just call the function directly
  15.         sleep(2000)
  16.         MouseClick("Left", 472, 333, 1, 2)
  17.         sleep(500)
  18.         MouseClick("Left", 713, 598, 1, 2)
  19.         myResult ( $Counter )
  20.         sleep(2000)
  21.         MouseClick("Left", 614, 532, 1, 2)
  22.         sleep(500)
  23.         MouseClick("Left", 713, 598, 1, 2)
  24.         myResult ( $Counter )
  25.         sleep(2000)
  26.         MouseClick("Left", 614, 532, 1, 2)
  27.         sleep(500)
  28.         MouseClick("Left", 713, 598, 1, 2)
  29.         myResult ( $Counter )
  30.         MouseClick("Left", 472, 333, 1, 2)
  31.         sleep(500)
  32.         MouseClick("Left", 713, 598, 1, 2)
  33.         myResult ( $Counter )
  34.         sleep(2000)
  35.         MouseClick("Left", 472, 333, 1, 2)
  36.         sleep(500)
  37.         MouseClick("Left", 713, 598, 1, 2)
  38.         myResult ( $Counter )
  39.         Sleep(2000)
  40.     until timerdiff($timer) > 960
  41. WEnd
  42.  
  43.  
  44. func myResult(ByRef $Counter)
  45.     ConsoleWrite(" Function myresult is called " & @CRLF)
  46.     $Variable = PixelSearch(1003, 404, 1146, 602, 0x00AAB3)
  47.     If IsArray($Variable) = True Then
  48.         ConsoleWrite(" 00AAB3 is found " & @CRLF)
  49.         MouseClick("Left", 888, 597, 1, 1)
  50.         MouseClick($MOUSE_CLICK_LEFT,  $Variable[0], $Variable[1], $Counter)
  51.     Else
  52.         $Variable = PixelSearch(1003, 404, 1146, 602, 0x00B1C5)
  53.         If IsArray($Variable) = True Then
  54.             ConsoleWrite(" 0x00B1C5 is found " & @CRLF)
  55.             $Counter = $Counter * 2
  56.             MouseClick($MOUSE_CLICK_LEFT, $Variable[0], $Variable[1], $Counter)
  57.             ConsoleWrite("svar0 = " &  $Variable[0] & "     svar1 = " & $Variable[1] & "       counter = "  & $Counter & @CRLF) ; to read out at what counter it is right now.
  58.         EndIf
  59.     EndIf
  60. EndFunc
  61.  
  62. Func init()
  63.     WinActivate("Identikit")
  64.     WinWaitActive("Identikit", "", 10); wait for 10 sec to appear
  65.     MouseClick("Left", 529, 594, 1, 1)
  66.     sleep(4000)
  67.     MouseWheel($MOUSE_WHEEL_DOWN, 2)
  68.     sleep(500)
  69.     MouseClick("Left", 755, 578, 1, 1)
  70.     sleep(2000)
  71.     MouseClick("Left", 823, 598, 1, 1)
  72.     sleep(16000)
  73.     MouseWheel($MOUSE_WHEEL_DOWN, 1)
  74.     sleep(1000)
  75. EndFunc
  76.  
  77. func myExit()
  78.     Exit
  79. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement