Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <AutoItConstants.au3>
- HotKeySet("{f1}", "myExit")
- Local $Counter = 1
- init(); changed all that to a function to call one time( readability)
- while 1
- $timer = timerinit()
- Do
- MouseClick("Left", 614, 532, 1, 2)
- sleep(500)
- MouseClick("Left", 713, 598, 1, 2)
- myResult ( $Counter ) ; just call the function directly
- sleep(2000)
- MouseClick("Left", 472, 333, 1, 2)
- sleep(500)
- MouseClick("Left", 713, 598, 1, 2)
- myResult ( $Counter )
- sleep(2000)
- MouseClick("Left", 614, 532, 1, 2)
- sleep(500)
- MouseClick("Left", 713, 598, 1, 2)
- myResult ( $Counter )
- sleep(2000)
- MouseClick("Left", 614, 532, 1, 2)
- sleep(500)
- MouseClick("Left", 713, 598, 1, 2)
- myResult ( $Counter )
- MouseClick("Left", 472, 333, 1, 2)
- sleep(500)
- MouseClick("Left", 713, 598, 1, 2)
- myResult ( $Counter )
- sleep(2000)
- MouseClick("Left", 472, 333, 1, 2)
- sleep(500)
- MouseClick("Left", 713, 598, 1, 2)
- myResult ( $Counter )
- Sleep(2000)
- until timerdiff($timer) > 960
- WEnd
- func myResult(ByRef $Counter)
- ConsoleWrite(" Function myresult is called " & @CRLF)
- $Variable = PixelSearch(1003, 404, 1146, 602, 0x00AAB3)
- If IsArray($Variable) = True Then
- ConsoleWrite(" 00AAB3 is found " & @CRLF)
- MouseClick("Left", 888, 597, 1, 1)
- MouseClick($MOUSE_CLICK_LEFT, $Variable[0], $Variable[1], $Counter)
- Else
- $Variable = PixelSearch(1003, 404, 1146, 602, 0x00B1C5)
- If IsArray($Variable) = True Then
- ConsoleWrite(" 0x00B1C5 is found " & @CRLF)
- $Counter = $Counter * 2
- MouseClick($MOUSE_CLICK_LEFT, $Variable[0], $Variable[1], $Counter)
- ConsoleWrite("svar0 = " & $Variable[0] & " svar1 = " & $Variable[1] & " counter = " & $Counter & @CRLF) ; to read out at what counter it is right now.
- EndIf
- EndIf
- EndFunc
- Func init()
- WinActivate("Identikit")
- WinWaitActive("Identikit", "", 10); wait for 10 sec to appear
- MouseClick("Left", 529, 594, 1, 1)
- sleep(4000)
- MouseWheel($MOUSE_WHEEL_DOWN, 2)
- sleep(500)
- MouseClick("Left", 755, 578, 1, 1)
- sleep(2000)
- MouseClick("Left", 823, 598, 1, 1)
- sleep(16000)
- MouseWheel($MOUSE_WHEEL_DOWN, 1)
- sleep(1000)
- EndFunc
- func myExit()
- Exit
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement