Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. ; Array of colors to find different enemies
  2. ; 0x6C9FA6 Fatty
  3. ; 0xA9FEFD Mini
  4. ; 0x9CAAB8 Arms
  5. ; 0x56736E Dawgs
  6. Global $colors[4] = [0x6C9FA6, 0xA9FEFD, 0x9CAAB8, 0x56736E]
  7.  
  8. ; Just in case we want to keep track of how many loops have been done
  9. Global $loop_n = 1
  10. Global $had_fight = 0
  11.  
  12. HotKeySet("{F4}", "ExitProg")
  13. Func ExitProg()
  14. Exit
  15. EndFunc
  16.  
  17. ;Start Main Account
  18. Func start_main_account()
  19. ConsoleWrite('Starting up')
  20. MouseMove (465, 1061)
  21. Sleep(500)
  22. MouseClick ("Left")
  23.  
  24. Sleep(1000)
  25. EndFunc
  26.  
  27. ; Click attack button
  28. Func click_attack($e_position)
  29. Local $pixel = $e_position
  30.  
  31. MouseMove($pixel [0], $pixel [1], 1)
  32. Sleep(50)
  33. MouseClick ("Right")
  34.  
  35. Sleep(1000)
  36.  
  37. MouseMove (732, 407)
  38.  
  39. Sleep (3000)
  40. ;$pixel2 = PixelSearch ($pixel[0]-105, $pixel[1]-111, $pixel[0]-41, $pixel[1]-35, 0xDBD8D2)BIGGER
  41. Local $pixel2 = PixelSearch ($pixel[0]-100, $pixel[1]-106, $pixel[0]-46, $pixel[1]-40, 0xDBD8D2)
  42. ;$pixel2 = PixelSearch ($pixel[0]-90, $pixel[1]-96, $pixel[0]-56, $pixel[1]-50, 0xDBD8D2) OG
  43. If IsArray($pixel2) = True Then
  44. MouseMove($pixel2 [0], $pixel2 [1], 1)
  45. MouseClick ("left")
  46. Sleep (500)
  47. Else
  48. ConsoleWrite("No Button Found, looking for new enemy...")
  49. Return "button not found"
  50. EndIf
  51. EndFunc
  52.  
  53. ; [TODO] Click extract button
  54. Func click_extract()
  55. EndFunc
  56.  
  57. ; Find an enemy for us to attack
  58. ; Accepts a color code: findEnemy(0x6C9FA6)
  59. Func findEnemy($e_color)
  60. Return PixelSearch (505, 458, 788, 713, $e_color)
  61. EndFunc
  62.  
  63. Func MenuOpen()
  64. Local $menupixel1 = PixelGetColor(954, 435)
  65. Local $menupixel2 = PixelGetColor(957, 622)
  66.  
  67. If ($menupixel1 == 0xFFFFFF And $menupixel2 == 0xCDCAC1) Then
  68. return True
  69. Else
  70. return False
  71. EndIf
  72. EndFunc
  73.  
  74. Func CloseMenu()
  75. If MenuOpen() Then
  76. Send("{ESC}")
  77. EndIf
  78. EndIf
  79.  
  80. ; Main loop
  81. while 1
  82. $had_fight = 0
  83. $attack = ""
  84. start_main_account()
  85.  
  86. ; Loop through enemies, attacking each one
  87. For $i =0 To UBound($colors) - 1
  88. $enemy = findEnemy($colors[$i])
  89.  
  90. ; Attack the enemy if we managed to find one, continue looping
  91. ; we didn't
  92. If IsArray($enemy) = True Then
  93. $attack = click_attack($enemy)
  94.  
  95. If $attack == "button not found" Then
  96. ContinueLoop
  97. EndIF
  98.  
  99. ; [TODO] Refactor the shit out of this
  100. ;MouseMove($enemy [0], $enemy [1], 1)
  101.  
  102. Sleep (5500)
  103.  
  104. ;Second Account Ready Up
  105. MouseMove (515, 1060)
  106. Sleep (250)
  107. MouseClick ("Left")
  108. Sleep (500)
  109. Send ("{SPACE}")
  110. ConsoleWrite('account 1 ready up')
  111.  
  112. Sleep(1000)
  113.  
  114. ;Main Account ready up
  115. MouseMove (465, 1061)
  116. Sleep (250)
  117. MouseClick ("Left")
  118. Sleep (500)
  119. Send ("{SPACE}")
  120. ConsoleWrite('account 2 ready up')
  121.  
  122. Sleep(6000)
  123.  
  124. ; Attacking Script
  125. Send ("1")
  126. Sleep (250)
  127. MouseClick ("left", 673, 554)
  128. Sleep (3000)
  129. Send ("1")
  130. Sleep (250)
  131. MouseClick ("left", 673, 554)
  132.  
  133. ConsoleWrite('Fight over!')
  134. Sleep (30000)
  135. Send ("{ESC}")
  136. ConsoleWrite('account 1 close menu')
  137.  
  138. Sleep (1000)
  139.  
  140. ;Account2 clean up
  141. MouseMove (515, 1060)
  142. Sleep (1000)
  143. MouseClick ("Left")
  144. Sleep (1000)
  145. Send ("{ESC}")
  146. ConsoleWrite('account 2 close menu')
  147.  
  148. ; Set var so we know we had a fight
  149. $had_fight = 1
  150.  
  151. Sleep (3000)
  152.  
  153. ExitLoop
  154. Else
  155. ; Uncomment to help with debugging
  156. ;ConsoleWrite("Enemy not found: " & $colors[$i])
  157. ContinueLoop
  158. EndIf
  159. Next
  160.  
  161. ; If we didn't have a fight, select window 2 so that window 1 doesn't
  162. ; get minimized when the loop restarts
  163. If $had_fight == 0 Then
  164. MouseMove (515, 1060)
  165. Sleep (1000)
  166. MouseClick ("Left")
  167. Sleep (1000)
  168. EndIf
  169.  
  170. ; Lets take it from the top!
  171. ConsoleWrite("Loop " & $loop_n)
  172.  
  173. ; Sleep for a moment so we don't have crazy high cpu usage
  174. Sleep(500)
  175.  
  176. ContinueLoop
  177. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement