Advertisement
Guest User

Untitled

a guest
Feb 1st, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.34 KB | None | 0 0
  1.  
  2. Global $g_bPaused = True
  3.  
  4. HotKeySet("{ESC}", "Terminate")
  5. HotKeySet("{p}", "TogglePause")
  6.  
  7. main()
  8.  
  9. Func main()
  10.  
  11.     While 1
  12.         While $g_bPaused
  13.             Sleep(100)
  14.         WEnd
  15.  
  16.         ; Kontroller
  17.         If Not HourBetween(00, 05) Then ContinueLoop
  18.         If Not hasInternetConnection() Then Return ConsoleWrite("! No internetz by3z" & @LF)
  19.  
  20.         ; Allt som körs om alla kontroller är OK
  21.         Local $aCoord = PixelSearch(742, 822, 920, 889, 0x00BAF5, 2, 2) ;Color of "Okay"-button after death
  22.         If Not @error Then
  23.             MouseUp("left") ; Set the left mouse button state as up.
  24.             ;"Okay" button @death
  25.             MouseMove($aCoord[0], $aCoord[1], 0)
  26.             Sleep(400)
  27.             MouseClick("left")
  28.             ;Location for starting
  29.             MouseMove(952, 761, 2)
  30.             Sleep(400)
  31.             MouseDown("left") ; Set the left mouse button state as down.
  32.         Else
  33.             ;Leftmost side
  34.             MouseMove(720, 843, 30)
  35.             Sleep(100)
  36.             ;Rightmost side
  37.             MouseMove(1183, 843, 30)
  38.             Sleep(100)
  39.         EndIf
  40.  
  41.     WEnd
  42. EndFunc   ;==>main
  43.  
  44. Func HourBetween($hh1, $hh2)
  45.     Return @HOUR >= $hh1 And @HOUR <= $hh2
  46. EndFunc   ;==>HourBetween
  47.  
  48. Func hasInternetConnection()
  49.     Ping("google.se")
  50.     Return Not @error
  51. EndFunc   ;==>hasInternetConnection
  52.  
  53. Func TogglePause()
  54.     $g_bPaused = Not $g_bPaused
  55.     TrayTip("STATUS", $g_bPaused ? 'PAUS' : 'KÖR', 5, 1)
  56. EndFunc   ;==>TogglePause
  57.  
  58. Func Terminate()
  59.     Exit
  60. EndFunc   ;==>Terminate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement