Advertisement
Guest User

stuff

a guest
Oct 22nd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.57 KB | None | 0 0
  1. $version = "0.2"
  2.  
  3. #include <Misc.au3>
  4. #include <_PixelGetColor.au3>
  5. #include <OCR.au3>
  6. #include <WinAPI.au3>
  7.  
  8. If _Singleton(@ScriptName, 1) = 0 Then ; allow only one instance
  9. MsgBox(0, "Warning", "An occurence of " & @ScriptName & " is already running")
  10. Exit
  11. EndIf
  12.  
  13.  
  14. #Region variables
  15. $BlockScreensaver = 1
  16. $flagMouse = 1
  17. $MouseNotMovedCounter = 0
  18. $posMouseMovedX = 0
  19. $posMouseMovedY = 0
  20. $Counter = 0
  21. $MiningX = 2391 - 1600
  22. $MiningY = 735
  23. $LoggingX = 2391 - 1600
  24. $LoggingY = 711
  25. ;Heroes Button
  26. $HeroX = 2516 - 1600
  27. $HeroY = 927
  28. ;3105 427
  29. $closeHeroX = 3105 - 1600
  30. $closeHeroY = 427
  31.  
  32. ;Character Button
  33. $charX = 2514 - 1600
  34. $charY = 887
  35.  
  36. $cardsX = 2530 - 1600
  37. $cardsY = 796
  38.  
  39. ;outfits
  40. $outfit1X = 3078 - 1600
  41. $outfit1Y = 756
  42. $outfit2X = 3065 - 1600
  43. $outfit2Y = 778
  44. $outfit3X = 3077 - 1600
  45. $outfit3Y = 819
  46. $outfit4X = 3077 - 1600
  47. $outfit4Y = 842
  48. $outfit5X = 3077 - 1600
  49. $outfit5Y = 881
  50.  
  51. $instamineX = 2806 - 1600
  52. $instamineY = 492
  53.  
  54. $instachopX = 2730 - 1600
  55. $instachopY = 849
  56.  
  57. $keeplogginX = 2728 - 1600
  58. $keeplogginY = 703
  59.  
  60. $keepMiningX = 2727 - 1600
  61. $keepMiningY = 699
  62.  
  63. $redXX = 2951 - 1600
  64. $redXY = 508
  65.  
  66. $continueX = 2662 - 1600
  67. $continueY = 815
  68.  
  69. #include <WinAPI.au3>
  70.  
  71. $debugCode = 0
  72.  
  73. $ContinueOnly = False
  74.  
  75. #EndRegion variables
  76. #Region main
  77. Local $hTimer = TimerInit()
  78. Local $buttonTimer = TimerInit()
  79. $ClickDisabled = False
  80. While 1
  81.  
  82. $pos = MouseGetPos()
  83.  
  84. $ocrOptions = $ocrOptMatchForeground + $ocrOptAutoCleanFontData + $ocrOptDontAskForMatch
  85.  
  86. $ocr = _OCR($MiningX - 4, $MiningY - 2, $MiningX + 32, $MiningY + 10, 13355979, 100, "", "", $ocrOptions)
  87.  
  88. $ocr2 = _OCR(2762 - 1600, 488, 2841 - 1600, 498, 16711422, 100, "", "", $ocrOptions)
  89. $ocr3 = _OCR($LoggingX, $LoggingY, $LoggingX + 32, $LoggingY + 10, 13355979, 100, "", "", $ocrOptions)
  90. $loggingocr = _OCR(2351 - 1600, 708, 2370 - 1600, 721, 51968, 100, "", "", $ocrOptions)
  91. ;$ocr5 = _OCR(2351, 734, 2368, 747, 52479, 100, @ScriptDir & "\OCRFontData5.txt", "" , $ocrOptions)
  92. $miningocr = _OCR(2351 - 1600, 734, 2370 - 1600, 747, 52479, 100, "", "", $ocrOptions)
  93. ;52222
  94. ;52479
  95. If StringLeft($ocr2, 2) <> "Co" And StringInStr($ocr2, "mle") == False Then
  96.  
  97. Local $fDiff = TimerDiff($buttonTimer)
  98. If $fDiff > 125000 Then
  99. Click(2355, 468)
  100. ConsoleWrite("Clicking button " & $ocr2 & @CRLF)
  101. Local $buttonTimer = TimerInit()
  102. EndIf
  103.  
  104.  
  105. EndIf
  106.  
  107. If _IsPressed("09") Then
  108.  
  109. If $ClickDisabled = False Then
  110. $ClickDisabled = True
  111. ConsoleWrite("Click Disabled")
  112. Else
  113. $ClickDisabled = False
  114. ConsoleWrite("Click Enabled")
  115. EndIf
  116. EndIf
  117.  
  118. If _IsPressed("A0") Then
  119. $pos = MouseGetPos() ;
  120. $color = PixelGetColor($pos[0], $pos[1])
  121. ConsoleWrite("MousePos " & $pos[0] & " " & $pos[1] & " Color: " & $color & " Color2: " & colourRGBToBGR($color) & @CRLF)
  122. ConsoleWrite("OCR " & $ocr & @CRLF)
  123. ConsoleWrite("OCR2 " & $ocr2 & @CRLF)
  124. ConsoleWrite("OCR3 " & $ocr3 & @CRLF)
  125. ConsoleWrite("LoggingOCR " & $loggingocr & @CRLF)
  126. ConsoleWrite("MiningOCR " & $miningocr & "color: " & 52479 & @CRLF)
  127. ;ConsoleWrite("RedX: " & $RedX & " Continue: " & $continue & " Mining: " & $MiningChk & " Logging: " & $LoggingChk & @CRLF)
  128. ContinueLoop
  129. EndIf
  130. ;ConsoleWrite("RedX:" & $RedX & " Continue:" & $continue & @crlf)
  131. CloseHeroButton()
  132. CheckForRedX()
  133. CloseHeroButton()
  134.  
  135. $ocr = _OCR($MiningX - 4, $MiningY - 2, $MiningX + 32, $MiningY + 10, 13355979, 100, "", "", $ocrOptions)
  136.  
  137. $MiningChk = PixelChecksum($MiningX, $MiningY, $MiningX + 34, $MiningY + 10, 2)
  138. $LoggingChk = PixelChecksum($LoggingX, $LoggingY, $LoggingX + 34, $LoggingY + 10, 2)
  139. CheckLogging()
  140. CheckMining()
  141.  
  142. Sleep(750)
  143. WEnd
  144. #EndRegion main
  145.  
  146. ;func
  147.  
  148.  
  149. Func SanityCheck()
  150. $pos = MouseGetPos()
  151. $SanityChk = PixelChecksum(2392 - 1600, 364, 2448 - 1600, 264, 2)
  152.  
  153. _WinAPI_DrawRect(2392 - 1600, 364, 2448 - 1600, 264, 2)
  154. While $SanityChk <> 720346816 And $SanityChk <> 3912911203 And $SanityChk <> 1894744995 And $SanityChk <> 3228587771 And $SanityChk <> 3466226225
  155. $pos = MouseGetPos()
  156. ConsoleWrite("Sanity Check Failed. Pausing 2 seconds " & $SanityChk & "pos: " & $pos[0] & " " & $pos[1] & @CRLF)
  157. Sleep(2000)
  158.  
  159. $continue = PixelChecksum($continueX, $continueY, $continueX + 40, $continueY + 10, 2)
  160.  
  161. If $continue = 3125660357 Then
  162. MouseClick("left", $continueX, $continueY)
  163. Sleep(500)
  164. EndIf
  165.  
  166. $RedX = PixelChecksum($redXX, $redXY, $redXX + 10, $redXY + 10, 2)
  167. ;ConsoleWrite("RedX " &$RedX &@CRLF)
  168. If $RedX = 825376492 Or $RedX = 2497054545 Then
  169. MouseClick("left", $redXX + 10, $redXY + 10)
  170. Sleep(1000)
  171. EndIf
  172.  
  173. CloseHeroButton()
  174. $SanityChk = PixelChecksum(2392 - 1600, 364, 2448 - 1600, 264, 2)
  175.  
  176.  
  177. WEnd
  178. ;ConsoleWrite("Sanity " & $SanityChk & @CRLF)
  179. ;2392 364
  180. ;2448 264
  181. EndFunc ;==>SanityCheck
  182.  
  183. Func CheckLogging()
  184.  
  185.  
  186. CheckForRedX()
  187. 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
  188. $ContinueOnly = False
  189. PressSet4()
  190. Sleep(12000)
  191. InstaChop()
  192. PressSet1()
  193. ConsoleWrite("Logging Stuff going down " & @CRLF)
  194.  
  195. EndIf
  196. $ContinueOnly = False
  197. CheckForRedX()
  198.  
  199. EndFunc ;==>CheckLogging
  200.  
  201. Func CheckMining()
  202.  
  203. CheckForRedX()
  204.  
  205. 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
  206. $ContinueOnly = False
  207. PressSet5()
  208. Sleep(12000)
  209. InstaMine()
  210. PressSet1()
  211. ConsoleWrite("Mining Stuff going down " & @CRLF)
  212. EndIf
  213. $ContinueOnly = False
  214. CheckForRedX()
  215. EndFunc ;==>CheckMining
  216.  
  217. Func PressHeroButton()
  218.  
  219. Click($HeroX, $HeroY)
  220.  
  221. EndFunc ;==>PressHeroButton
  222.  
  223. Func InstaMine()
  224.  
  225. $miningocr = _OCR(2351 - 1600, 734, 2368 - 1600, 747, 52479, 100, "", "", $ocrOptions)
  226. ;if Int($miningocr) > 40 Then
  227. Click($MiningX, $MiningY)
  228. Click($instamineX, $instamineY)
  229. Click($keepMiningX, $keepMiningY)
  230. Click($instamineX, $instamineY)
  231. CloseHeroButton()
  232. ;Else
  233. ;ConsoleWrite("Not instamining" & $miningocr & "!>40" & @CRLF)
  234. ;EndIf
  235. EndFunc ;==>InstaMine
  236.  
  237. Func InstaChop()
  238. $loggingocr = _OCR(2351 - 1600, 708, 2368 - 1600, 721, 51968, 100, "", "", $ocrOptions)
  239. ;if Int($loggingocr) > 40 Then
  240. Click($LoggingX, $LoggingY)
  241. Click($instachopX, $instachopY)
  242. Click($keeplogginX, $keeplogginY)
  243. Click($instachopX, $instachopY)
  244. CloseHeroButton()
  245. ;Else
  246. ;ConsoleWrite("Not Instachopping" & $loggingocr & "!>40" & @CRLF)
  247. ;EndIf
  248. EndFunc ;==>InstaChop
  249.  
  250.  
  251. Func ClickUpgrades()
  252.  
  253. Click(2647, 885)
  254.  
  255. EndFunc ;==>ClickUpgrades
  256.  
  257. Func ClickInfinity()
  258.  
  259. Click(2399, 509)
  260.  
  261. EndFunc ;==>ClickInfinity
  262.  
  263. Func ClickActivities()
  264.  
  265. Click(264, 572)
  266.  
  267. EndFunc ;==>ClickActivities
  268.  
  269. Func ClickReset()
  270. Click(2792, 927)
  271. EndFunc ;==>ClickReset
  272.  
  273. Func PressCardsButton()
  274.  
  275. Click($charX, $charY)
  276. Click($cardsX, $cardsY)
  277.  
  278. EndFunc ;==>PressCardsButton
  279.  
  280.  
  281. Func Click($x, $y)
  282. If $ClickDisabled = True Then
  283. Return
  284. EndIf
  285. CheckForRedX()
  286. If $x > 1600 Then
  287. $x = $x - 1600
  288. EndIf
  289. MouseClick("left", $x, $y)
  290. Sleep(500)
  291. CheckForRedX()
  292. EndFunc ;==>Click
  293.  
  294.  
  295. Func CheckForRedX()
  296.  
  297. If $ClickDisabled = True Then
  298. Return
  299. EndIf
  300.  
  301. $continue = PixelChecksum($continueX, $continueY, $continueX + 40, $continueY + 10, 2)
  302.  
  303. If $continue = 3125660357 Then
  304. MouseClick("left", $continueX, $continueY)
  305. Sleep(500)
  306. EndIf
  307.  
  308. If $ContinueOnly = True Then
  309. Return
  310. EndIf
  311.  
  312. $RedX = PixelChecksum($redXX, $redXY, $redXX + 10, $redXY + 10, 2)
  313. ;ConsoleWrite("RedX " & $RedX & @CRLF)
  314. If $RedX = 825376492 Or $RedX = 2497054545 Then
  315. MouseClick("left", $redXX + 10, $redXY + 10)
  316. Sleep(1000)
  317. EndIf
  318.  
  319. $RedX = PixelChecksum($redXX, $redXY, $redXX + 10, $redXY + 10, 2)
  320. If $RedX = 825376492 Or $RedX = 2497054545 Then
  321. Sleep(2000)
  322. EndIf
  323.  
  324. $RedX = PixelChecksum($redXX, $redXY, $redXX + 10, $redXY + 10, 2)
  325. If $RedX = 825376492 Or $RedX = 2497054545 Then
  326. Sleep(4000)
  327. EndIf
  328. $RedX = PixelChecksum($redXX, $redXY, $redXX + 10, $redXY + 10, 2)
  329. If $RedX = 825376492 Or $RedX = 2497054545 Then
  330. MouseClick("left", $redXX + 10, $redXY + 10)
  331. Sleep(6000)
  332. EndIf
  333. SanityCheck()
  334. EndFunc ;==>CheckForRedX
  335.  
  336.  
  337. Func PressSet1()
  338.  
  339. PressCardsButton()
  340. Click($outfit1X, $outfit1Y)
  341. CloseHeroButton()
  342.  
  343. EndFunc ;==>PressSet1
  344.  
  345.  
  346. Func PressSet2()
  347.  
  348. PressCardsButton()
  349. Click($outfit2X, $outfit2Y)
  350. CloseHeroButton()
  351.  
  352.  
  353. EndFunc ;==>PressSet2
  354.  
  355.  
  356. Func PressSet3()
  357.  
  358. PressCardsButton()
  359. Click($outfit3X, $outfit3Y)
  360. CloseHeroButton()
  361.  
  362.  
  363. EndFunc ;==>PressSet3
  364.  
  365.  
  366. Func PressSet4()
  367.  
  368. PressCardsButton()
  369. Click($outfit4X, $outfit4Y)
  370. CloseHeroButton()
  371.  
  372.  
  373. EndFunc ;==>PressSet4
  374.  
  375.  
  376. Func PressSet5()
  377.  
  378. PressCardsButton()
  379.  
  380. Click($outfit5X, $outfit5Y)
  381. CloseHeroButton()
  382.  
  383.  
  384. EndFunc ;==>PressSet5
  385.  
  386.  
  387. Func CloseHeroButton()
  388.  
  389.  
  390. $OtherRedX = PixelChecksum(3091 - 1600, 419, 3113 - 1600, 323, 2)
  391. ;ConsoleWrite("redx: " & $OtherRedX & @CRLF)
  392. If $OtherRedX = 2831187533 Or $OtherRedX = 521034765 Or $OtherRedX = 4015807889 Or $OtherRedX = 1627676777 or $OtherRedX = 1192257685 Then
  393. Click($closeHeroX, $closeHeroY)
  394. Sleep(500)
  395. EndIf
  396.  
  397.  
  398. $OtherRedX = PixelChecksum(3091 - 1600, 419, 3113 - 1600, 323, 2)
  399. If $OtherRedX = 2831187533 Or $OtherRedX = 521034765 Or $OtherRedX = 4015807889 Or $OtherRedX = 1627676777 or $OtherRedX = 1192257685 Then
  400. Sleep(1500)
  401. EndIf
  402.  
  403. $OtherRedX = PixelChecksum(3091 - 1600, 419, 3113 - 1600, 323, 2)
  404. If $OtherRedX = 2831187533 Or $OtherRedX = 521034765 Or $OtherRedX = 4015807889 Or $OtherRedX = 1627676777 or $OtherRedX = 1192257685 Then
  405. Sleep(4000)
  406. EndIf
  407.  
  408. $OtherRedX = PixelChecksum(3091 - 1600, 419, 3113 - 1600, 323, 2)
  409. If $OtherRedX = 2831187533 Or $OtherRedX = 521034765 Or $OtherRedX = 4015807889 Or $OtherRedX = 1627676777 or $OtherRedX = 1192257685 Then
  410. Click($closeHeroX, $closeHeroY)
  411. Sleep(1000)
  412. EndIf
  413.  
  414. EndFunc ;==>CloseHeroButton
  415.  
  416. #Region functions
  417.  
  418. Func _WinAPI_DrawRect($start_x, $start_y, $iWidth, $iHeight, $iColor)
  419. Local $hDC = _WinAPI_GetWindowDC(0) ; DC of entire screen (desktop)
  420. Local $tRect = DllStructCreate($tagRECT)
  421. DllStructSetData($tRect, 1, $start_x)
  422. DllStructSetData($tRect, 2, $start_y)
  423. DllStructSetData($tRect, 3, $iWidth)
  424. DllStructSetData($tRect, 4, $iHeight)
  425. Local $hBrush = _WinAPI_CreateSolidBrush($iColor)
  426.  
  427. _WinAPI_FrameRect($hDC, DllStructGetPtr($tRect), $hBrush)
  428.  
  429. ; clear resources
  430. _WinAPI_DeleteObject($hBrush)
  431. _WinAPI_ReleaseDC(0, $hDC)
  432. EndFunc ;==>_WinAPI_DrawRect
  433.  
  434. Func CheckifMouseMove()
  435. ;~ ConsoleWrite("+CheckifMouseMove()" & @crlf)
  436. $posMouseMoved = MouseGetPos()
  437. If $posMouseMovedX <> $posMouseMoved[0] Or $posMouseMovedY <> $posMouseMoved[1] Then
  438. $posMouseMovedX = $posMouseMoved[0]
  439. $posMouseMovedY = $posMouseMoved[1]
  440. $MouseNotMovedCounter = 0
  441. ;~ ConsoleWrite('>$MouseNotMovedCounter = ' & $MouseNotMovedCounter & @crlf )
  442. Else
  443. ;$MouseMoved=0
  444. $MouseNotMovedCounter = $MouseNotMovedCounter + 1
  445. ;~ ConsoleWrite('--$MouseNotMovedCounter = ' & $MouseNotMovedCounter & @crlf )
  446. EndIf
  447. EndFunc ;==>CheckifMouseMove
  448. Func moveMouse()
  449. ;~ ConsoleWrite("+moveMouse" & @crlf)
  450. Local $posMouse = MouseGetPos()
  451. $flagMouse = $flagMouse * -1
  452. Local $new_y = $posMouse[1] + $flagMouse ; + (10*$flagMouse)
  453. MouseMove($posMouse[0], $new_y)
  454. $MouseNotMovedCounter = 0
  455. ;~ ConsoleWrite("+mouseMove $MouseNotMovedCounter" & $MouseNotMovedCounter & @crlf)
  456. EndFunc ;==>moveMouse
  457.  
  458.  
  459.  
  460.  
  461.  
  462. #EndRegion functions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement