rcmaehl

Untitled

Feb 13th, 2013
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.71 KB | None | 0 0
  1. HotKeySet("`", "Toggle") ; Toggles Macro Using ` key, can be toggled any time without wait as it interrupts the code to run then resumes
  2.  
  3. $Toggle = False ; Set script to be off by default
  4.  
  5. While 1 ; Always true loop
  6.     If $Toggle Then ; Checks for Toggle
  7.         For $Loop = 0 To 41 Step 1  ; Loop to send Tab key 42 times
  8.             Send("{Tab}") ; Send Tab Key
  9.         Next ; Increase Loop counter
  10.         Send{"{Enter}") ; Send Enter Key
  11.         Do ; Start of a loop definition
  12.             Send("^a") ; Send Select All
  13.             Send("^c") ; Send Copy
  14.             MouseClick("Primary") ; Deselect Text using mouse click
  15.         Until Not StringInStr(ClipGet(), "Loading...") ; End of loop definition, do until it does not display "Loading..." on the page
  16.         Do ; Start of a loop definition
  17.             Send("^a") ; Send Select All
  18.             Send("^c") ; Send Copy
  19.             MouseClick("Primary") ; Deselect Text using mouse click
  20.             If StringInStr(ClipGet(), "Please enter the following code into the text box:") Then ; Check if it asks for captcha if so wait for user
  21.                 Beep() ; Beep to inform user
  22.                 $Toggle = False ; Set toggle to false
  23.                 Do ; Start of a loop definition
  24.                     Sleep(1000) ; Sleep for 1 second before checking the next line, saves cpu usage
  25.                 Until $Toggle = True ; Wait for user to retoggle macro using "`" key
  26.             EndIf ; End of defined if statement
  27.         Until StringInStr(ClipGet(), "You can mine now.") ; End of loop definition, do until it says "You can mine now." on the page
  28.     Else ; If toggle is false
  29.         Sleep(100) ; Sleep for 1/10 a second before doing next line, saves cpu usage
  30.     EndIf ; End of defined if statement
  31. WEnd ; End of loop defintion
  32.  
  33. Func Toggle()
  34.     If $Toggle Then
  35.         $Toggle = False
  36.     ElseIf Not $Toggle Then
  37.         $Toggle = True
  38.     Else
  39.         Exit(1)
  40.     EndIf
  41. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment