Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $version = "0.2"
- #include <Misc.au3>
- #include <_PixelGetColor.au3>
- #include <OCR.au3>
- #include <WinAPI.au3>
- If _Singleton(@ScriptName, 1) = 0 Then ; allow only one instance
- MsgBox(0, "Warning", "An occurence of " & @ScriptName & " is already running")
- Exit
- EndIf
- #Region variables
- $BlockScreensaver = 1
- $flagMouse = 1
- $MouseNotMovedCounter = 0
- $posMouseMovedX = 0
- $posMouseMovedY = 0
- $Counter = 0
- $MiningX = 2391 - 1600
- $MiningY = 735
- $LoggingX = 2391 - 1600
- $LoggingY = 711
- ;Heroes Button
- $HeroX = 2516 - 1600
- $HeroY = 927
- ;3105 427
- $closeHeroX = 3105 - 1600
- $closeHeroY = 427
- ;Character Button
- $charX = 2514 - 1600
- $charY = 887
- $cardsX = 2530 - 1600
- $cardsY = 796
- ;outfits
- $outfit1X = 3078 - 1600
- $outfit1Y = 756
- $outfit2X = 3065 - 1600
- $outfit2Y = 778
- $outfit3X = 3077 - 1600
- $outfit3Y = 819
- $outfit4X = 3077 - 1600
- $outfit4Y = 842
- $outfit5X = 3077 - 1600
- $outfit5Y = 881
- $instamineX = 2806 - 1600
- $instamineY = 492
- $instachopX = 2730 - 1600
- $instachopY = 849
- $keeplogginX = 2728 - 1600
- $keeplogginY = 703
- $keepMiningX = 2727 - 1600
- $keepMiningY = 699
- $redXX = 2951 - 1600
- $redXY = 508
- $continueX = 2662 - 1600
- $continueY = 815
- #include <WinAPI.au3>
- $debugCode = 0
- $ContinueOnly = False
- #EndRegion variables
- #Region main
- Local $hTimer = TimerInit()
- Local $buttonTimer = TimerInit()
- $ClickDisabled = False
- While 1
- $pos = MouseGetPos()
- $ocrOptions = $ocrOptMatchForeground + $ocrOptAutoCleanFontData + $ocrOptDontAskForMatch
- $ocr = _OCR($MiningX - 4, $MiningY - 2, $MiningX + 32, $MiningY + 10, 13355979, 100, "", "", $ocrOptions)
- $ocr2 = _OCR(2762 - 1600, 488, 2841 - 1600, 498, 16711422, 100, "", "", $ocrOptions)
- $ocr3 = _OCR($LoggingX, $LoggingY, $LoggingX + 32, $LoggingY + 10, 13355979, 100, "", "", $ocrOptions)
- $loggingocr = _OCR(2351 - 1600, 708, 2370 - 1600, 721, 51968, 100, "", "", $ocrOptions)
- ;$ocr5 = _OCR(2351, 734, 2368, 747, 52479, 100, @ScriptDir & "\OCRFontData5.txt", "" , $ocrOptions)
- $miningocr = _OCR(2351 - 1600, 734, 2370 - 1600, 747, 52479, 100, "", "", $ocrOptions)
- ;52222
- ;52479
- If StringLeft($ocr2, 2) <> "Co" And StringInStr($ocr2, "mle") == False Then
- Local $fDiff = TimerDiff($buttonTimer)
- If $fDiff > 125000 Then
- Click(2355, 468)
- ConsoleWrite("Clicking button " & $ocr2 & @CRLF)
- Local $buttonTimer = TimerInit()
- EndIf
- EndIf
- If _IsPressed("09") Then
- If $ClickDisabled = False Then
- $ClickDisabled = True
- ConsoleWrite("Click Disabled")
- Else
- $ClickDisabled = False
- ConsoleWrite("Click Enabled")
- EndIf
- EndIf
- If _IsPressed("A0") Then
- $pos = MouseGetPos() ;
- $color = PixelGetColor($pos[0], $pos[1])
- ConsoleWrite("MousePos " & $pos[0] & " " & $pos[1] & " Color: " & $color & " Color2: " & colourRGBToBGR($color) & @CRLF)
- ConsoleWrite("OCR " & $ocr & @CRLF)
- ConsoleWrite("OCR2 " & $ocr2 & @CRLF)
- ConsoleWrite("OCR3 " & $ocr3 & @CRLF)
- ConsoleWrite("LoggingOCR " & $loggingocr & @CRLF)
- ConsoleWrite("MiningOCR " & $miningocr & "color: " & 52479 & @CRLF)
- ;ConsoleWrite("RedX: " & $RedX & " Continue: " & $continue & " Mining: " & $MiningChk & " Logging: " & $LoggingChk & @CRLF)
- ContinueLoop
- EndIf
- ;ConsoleWrite("RedX:" & $RedX & " Continue:" & $continue & @crlf)
- CloseHeroButton()
- CheckForRedX()
- CloseHeroButton()
- $ocr = _OCR($MiningX - 4, $MiningY - 2, $MiningX + 32, $MiningY + 10, 13355979, 100, "", "", $ocrOptions)
- $MiningChk = PixelChecksum($MiningX, $MiningY, $MiningX + 34, $MiningY + 10, 2)
- $LoggingChk = PixelChecksum($LoggingX, $LoggingY, $LoggingX + 34, $LoggingY + 10, 2)
- CheckLogging()
- CheckMining()
- Sleep(750)
- WEnd
- #EndRegion main
- ;func
- Func SanityCheck()
- $pos = MouseGetPos()
- $SanityChk = PixelChecksum(2392 - 1600, 364, 2448 - 1600, 264, 2)
- _WinAPI_DrawRect(2392 - 1600, 364, 2448 - 1600, 264, 2)
- While $SanityChk <> 720346816 And $SanityChk <> 3912911203 And $SanityChk <> 1894744995 And $SanityChk <> 3228587771 And $SanityChk <> 3466226225
- $pos = MouseGetPos()
- ConsoleWrite("Sanity Check Failed. Pausing 2 seconds " & $SanityChk & "pos: " & $pos[0] & " " & $pos[1] & @CRLF)
- Sleep(2000)
- $continue = PixelChecksum($continueX, $continueY, $continueX + 40, $continueY + 10, 2)
- If $continue = 3125660357 Then
- MouseClick("left", $continueX, $continueY)
- Sleep(500)
- EndIf
- $RedX = PixelChecksum($redXX, $redXY, $redXX + 10, $redXY + 10, 2)
- ;ConsoleWrite("RedX " &$RedX &@CRLF)
- If $RedX = 825376492 Or $RedX = 2497054545 Then
- MouseClick("left", $redXX + 10, $redXY + 10)
- Sleep(1000)
- EndIf
- CloseHeroButton()
- $SanityChk = PixelChecksum(2392 - 1600, 364, 2448 - 1600, 264, 2)
- WEnd
- ;ConsoleWrite("Sanity " & $SanityChk & @CRLF)
- ;2392 364
- ;2448 264
- EndFunc ;==>SanityCheck
- Func CheckLogging()
- CheckForRedX()
- If $LoggingChk = 2192470344 Or $LoggingChk = 1158902577 Or $LoggingChk = 1562144830 Or $LoggingChk = 317682990 Or $ocr3 = "00:10" Or $ocr3 = "00:09" Or $ocr3 = "00:08" Then
- $ContinueOnly = False
- PressSet4()
- Sleep(12000)
- InstaChop()
- PressSet1()
- ConsoleWrite("Logging Stuff going down " & @CRLF)
- EndIf
- $ContinueOnly = False
- CheckForRedX()
- EndFunc ;==>CheckLogging
- Func CheckMining()
- CheckForRedX()
- If $MiningChk = 3653399891 Or $MiningChk = 1688041624 Or $MiningChk = 3935007291 Or $MiningChk = 833385393 Or $MiningChk = 1429172436 Or $MiningChk = 131364355 Or $MiningChk = 3937038908 Or $MiningChk = 1690073241 Or $ocr = "00:10" Or $ocr = "00:09" Or $ocr = "00:08" Or $ocr = "00:07" Or $ocr = "00:06" Or $ocr = "00:05" Or $ocr = "00:04" Then
- $ContinueOnly = False
- PressSet5()
- Sleep(12000)
- InstaMine()
- PressSet1()
- ConsoleWrite("Mining Stuff going down " & @CRLF)
- EndIf
- $ContinueOnly = False
- CheckForRedX()
- EndFunc ;==>CheckMining
- Func PressHeroButton()
- Click($HeroX, $HeroY)
- EndFunc ;==>PressHeroButton
- Func InstaMine()
- $miningocr = _OCR(2351 - 1600, 734, 2368 - 1600, 747, 52479, 100, "", "", $ocrOptions)
- ;if Int($miningocr) > 40 Then
- Click($MiningX, $MiningY)
- Click($instamineX, $instamineY)
- Click($keepMiningX, $keepMiningY)
- Click($instamineX, $instamineY)
- CloseHeroButton()
- ;Else
- ;ConsoleWrite("Not instamining" & $miningocr & "!>40" & @CRLF)
- ;EndIf
- EndFunc ;==>InstaMine
- Func InstaChop()
- $loggingocr = _OCR(2351 - 1600, 708, 2368 - 1600, 721, 51968, 100, "", "", $ocrOptions)
- ;if Int($loggingocr) > 40 Then
- Click($LoggingX, $LoggingY)
- Click($instachopX, $instachopY)
- Click($keeplogginX, $keeplogginY)
- Click($instachopX, $instachopY)
- CloseHeroButton()
- ;Else
- ;ConsoleWrite("Not Instachopping" & $loggingocr & "!>40" & @CRLF)
- ;EndIf
- EndFunc ;==>InstaChop
- Func ClickUpgrades()
- Click(2647, 885)
- EndFunc ;==>ClickUpgrades
- Func ClickInfinity()
- Click(2399, 509)
- EndFunc ;==>ClickInfinity
- Func ClickActivities()
- Click(264, 572)
- EndFunc ;==>ClickActivities
- Func ClickReset()
- Click(2792, 927)
- EndFunc ;==>ClickReset
- Func PressCardsButton()
- Click($charX, $charY)
- Click($cardsX, $cardsY)
- EndFunc ;==>PressCardsButton
- Func Click($x, $y)
- If $ClickDisabled = True Then
- Return
- EndIf
- CheckForRedX()
- If $x > 1600 Then
- $x = $x - 1600
- EndIf
- MouseClick("left", $x, $y)
- Sleep(500)
- CheckForRedX()
- EndFunc ;==>Click
- Func CheckForRedX()
- If $ClickDisabled = True Then
- Return
- EndIf
- $continue = PixelChecksum($continueX, $continueY, $continueX + 40, $continueY + 10, 2)
- If $continue = 3125660357 Then
- MouseClick("left", $continueX, $continueY)
- Sleep(500)
- EndIf
- If $ContinueOnly = True Then
- Return
- EndIf
- $RedX = PixelChecksum($redXX, $redXY, $redXX + 10, $redXY + 10, 2)
- ;ConsoleWrite("RedX " & $RedX & @CRLF)
- If $RedX = 825376492 Or $RedX = 2497054545 Then
- MouseClick("left", $redXX + 10, $redXY + 10)
- Sleep(1000)
- EndIf
- $RedX = PixelChecksum($redXX, $redXY, $redXX + 10, $redXY + 10, 2)
- If $RedX = 825376492 Or $RedX = 2497054545 Then
- Sleep(2000)
- EndIf
- $RedX = PixelChecksum($redXX, $redXY, $redXX + 10, $redXY + 10, 2)
- If $RedX = 825376492 Or $RedX = 2497054545 Then
- Sleep(4000)
- EndIf
- $RedX = PixelChecksum($redXX, $redXY, $redXX + 10, $redXY + 10, 2)
- If $RedX = 825376492 Or $RedX = 2497054545 Then
- MouseClick("left", $redXX + 10, $redXY + 10)
- Sleep(6000)
- EndIf
- SanityCheck()
- EndFunc ;==>CheckForRedX
- Func PressSet1()
- PressCardsButton()
- Click($outfit1X, $outfit1Y)
- CloseHeroButton()
- EndFunc ;==>PressSet1
- Func PressSet2()
- PressCardsButton()
- Click($outfit2X, $outfit2Y)
- CloseHeroButton()
- EndFunc ;==>PressSet2
- Func PressSet3()
- PressCardsButton()
- Click($outfit3X, $outfit3Y)
- CloseHeroButton()
- EndFunc ;==>PressSet3
- Func PressSet4()
- PressCardsButton()
- Click($outfit4X, $outfit4Y)
- CloseHeroButton()
- EndFunc ;==>PressSet4
- Func PressSet5()
- PressCardsButton()
- Click($outfit5X, $outfit5Y)
- CloseHeroButton()
- EndFunc ;==>PressSet5
- Func CloseHeroButton()
- $OtherRedX = PixelChecksum(3091 - 1600, 419, 3113 - 1600, 323, 2)
- ;ConsoleWrite("redx: " & $OtherRedX & @CRLF)
- If $OtherRedX = 2831187533 Or $OtherRedX = 521034765 Or $OtherRedX = 4015807889 Or $OtherRedX = 1627676777 or $OtherRedX = 1192257685 Then
- Click($closeHeroX, $closeHeroY)
- Sleep(500)
- EndIf
- $OtherRedX = PixelChecksum(3091 - 1600, 419, 3113 - 1600, 323, 2)
- If $OtherRedX = 2831187533 Or $OtherRedX = 521034765 Or $OtherRedX = 4015807889 Or $OtherRedX = 1627676777 or $OtherRedX = 1192257685 Then
- Sleep(1500)
- EndIf
- $OtherRedX = PixelChecksum(3091 - 1600, 419, 3113 - 1600, 323, 2)
- If $OtherRedX = 2831187533 Or $OtherRedX = 521034765 Or $OtherRedX = 4015807889 Or $OtherRedX = 1627676777 or $OtherRedX = 1192257685 Then
- Sleep(4000)
- EndIf
- $OtherRedX = PixelChecksum(3091 - 1600, 419, 3113 - 1600, 323, 2)
- If $OtherRedX = 2831187533 Or $OtherRedX = 521034765 Or $OtherRedX = 4015807889 Or $OtherRedX = 1627676777 or $OtherRedX = 1192257685 Then
- Click($closeHeroX, $closeHeroY)
- Sleep(1000)
- EndIf
- EndFunc ;==>CloseHeroButton
- #Region functions
- Func _WinAPI_DrawRect($start_x, $start_y, $iWidth, $iHeight, $iColor)
- Local $hDC = _WinAPI_GetWindowDC(0) ; DC of entire screen (desktop)
- Local $tRect = DllStructCreate($tagRECT)
- DllStructSetData($tRect, 1, $start_x)
- DllStructSetData($tRect, 2, $start_y)
- DllStructSetData($tRect, 3, $iWidth)
- DllStructSetData($tRect, 4, $iHeight)
- Local $hBrush = _WinAPI_CreateSolidBrush($iColor)
- _WinAPI_FrameRect($hDC, DllStructGetPtr($tRect), $hBrush)
- ; clear resources
- _WinAPI_DeleteObject($hBrush)
- _WinAPI_ReleaseDC(0, $hDC)
- EndFunc ;==>_WinAPI_DrawRect
- Func CheckifMouseMove()
- ;~ ConsoleWrite("+CheckifMouseMove()" & @crlf)
- $posMouseMoved = MouseGetPos()
- If $posMouseMovedX <> $posMouseMoved[0] Or $posMouseMovedY <> $posMouseMoved[1] Then
- $posMouseMovedX = $posMouseMoved[0]
- $posMouseMovedY = $posMouseMoved[1]
- $MouseNotMovedCounter = 0
- ;~ ConsoleWrite('>$MouseNotMovedCounter = ' & $MouseNotMovedCounter & @crlf )
- Else
- ;$MouseMoved=0
- $MouseNotMovedCounter = $MouseNotMovedCounter + 1
- ;~ ConsoleWrite('--$MouseNotMovedCounter = ' & $MouseNotMovedCounter & @crlf )
- EndIf
- EndFunc ;==>CheckifMouseMove
- Func moveMouse()
- ;~ ConsoleWrite("+moveMouse" & @crlf)
- Local $posMouse = MouseGetPos()
- $flagMouse = $flagMouse * -1
- Local $new_y = $posMouse[1] + $flagMouse ; + (10*$flagMouse)
- MouseMove($posMouse[0], $new_y)
- $MouseNotMovedCounter = 0
- ;~ ConsoleWrite("+mouseMove $MouseNotMovedCounter" & $MouseNotMovedCounter & @crlf)
- EndFunc ;==>moveMouse
- #EndRegion functions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement