Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.39 KB | None | 0 0
  1. #include <AutoItConstants.au3>
  2. HotKeySet("{f1}", "myExit")
  3.  
  4. Global $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.         Call ( "myResult", $Counter )
  15.         sleep(2000)
  16.         MouseClick("Left", 472, 333, 1, 2)
  17.         sleep(500)
  18.         MouseClick("Left", 713, 598, 1, 2)
  19.         Call ( "myResult", $Counter )
  20.         sleep(2000)
  21.         MouseClick("Left", 614, 532, 1, 2)
  22.         sleep(500)
  23.         MouseClick("Left", 713, 598, 1, 2)
  24.         Call ( "myResult", $Counter )
  25.         sleep(2000)
  26.         MouseClick("Left", 614, 532, 1, 2)
  27.         sleep(500)
  28.         MouseClick("Left", 713, 598, 1, 2)
  29.         Call ( "myResult", $Counter )
  30.         sleep(2000)
  31.         MouseClick("Left", 472, 333, 1, 2)
  32.         sleep(500)
  33.         MouseClick("Left", 713, 598, 1, 2)
  34.         Call ( "myResult", $Counter )
  35.         sleep(2000)
  36.         MouseClick("Left", 472, 333, 1, 2)
  37.         sleep(500)
  38.         MouseClick("Left", 713, 598, 1, 2)
  39.         Call ( "myResult", $Counter )
  40.         Sleep(2000)
  41.     until timerdiff($timer) > 960;
  42. WEnd
  43.  
  44.  
  45. func myResult($Counter)
  46.     ;ConsoleWrite(" Function myresult is called " & @CRLF)
  47.     $Variable = PixelSearch(1240, 250, 1450, 420, 0x0E0E0E, 1)
  48.     If IsArray($Variable) = True Then
  49.         ConsoleWrite(" Red is found " & @CRLF)
  50.         MouseClick("Left", 888, 597, 1, 1)
  51.         MouseClick($MOUSE_CLICK_LEFT,  $Variable[0], $Variable[1], $Counter)
  52.     Else
  53.         $Variable = PixelSearch(1240, 250, 1450, 420, 0x54835D, 1)
  54.         If IsArray($Variable) = True Then
  55.             ConsoleWrite(" 0x00B1C5 is found " & @CRLF)
  56.             For $vElement In $Variable
  57.                 $Counter = $Counter * 2
  58.             Next
  59.             MouseClick($MOUSE_CLICK_LEFT, $Variable[0], $Variable[1], $Counter)
  60.         EndIf
  61.     EndIf
  62. EndFunc
  63.  
  64. Func init()
  65.     WinActivate("Identikit")
  66.     WinWaitActive("Identikit", "", 10); wait for 10 sec to appear
  67.     MouseClick("Left", 529, 594, 1, 1)
  68.     sleep(4000)
  69.     MouseWheel($MOUSE_WHEEL_DOWN, 2)
  70.     sleep(500)
  71.     MouseClick("Left", 755, 578, 1, 1)
  72.     sleep(2000)
  73.     MouseClick("Left", 823, 598, 1, 1)
  74.     sleep(16000)
  75.     MouseWheel($MOUSE_WHEEL_DOWN, 1)
  76.     sleep(1000)
  77. EndFunc
  78.  
  79. func myExit()
  80.     Exit
  81. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement