Guest User

Mackus Gold Farm 1.1a (Modified by Jakesmurf)

a guest
Jun 7th, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.85 KB | None | 0 0
  1. Global $Paused
  2. Global $Paused
  3.  
  4. HotKeySet("=","Leave")
  5. HotKeySet("-", "Pause")
  6. HotKeySet("x", "Stop")
  7.  
  8. $default_resolutionX = 1920
  9. $default_resolutionY = 1080
  10. $x_ratio = @Desktopwidth / $default_resolutionX
  11. $y_ratio = @Desktopheight / $default_resolutionY
  12. Dim $Color, $Left, $Top, $Right, $Bottom
  13. $Color = 0xFFFF00 ;rare color code
  14. $Color2 = 0x6969;FF ;blue color code I have the ; in the 6969ff so it doesent pickup remove if you want it too!
  15. $Color3 = 0xBF642F ;legendary color code
  16. $Color4 = 0x00FF00 ;SET color
  17. $Left = 300
  18. $Top = 0
  19. $Right = 1920
  20. $Bottom = 1080
  21. $x = 1
  22. $LeftClear = 1000
  23. $RightClear = 1299
  24. $TopClear = 412
  25. $BottomClear = 620
  26. $BlueClear = 0x111E34
  27. $WhiteClear = 0x100908
  28. $HasCleared = 0
  29. $Amethyst = 0xA56DF1
  30. $Ruby = 0xFA8078
  31. $Emerald = 0x51965B
  32. $Topaz = 0xFFFF59
  33.  
  34.  
  35. $go = True
  36. $Leave = False
  37.  
  38. While $go
  39. if($Leave) Then
  40.  
  41. MouseClick("middle", Round(599* $x_ratio),Round(333 * $y_ratio)) ;starts the main run
  42. Sleep(1050)
  43. Send("2")
  44. MouseClick("middle", Round(96 * $x_ratio),Round(383 * $y_ratio))
  45. Sleep(350)
  46. Send("1")
  47. Sleep(600)
  48. MouseClick("middle", Round(417 * $x_ratio),Round(422 * $y_ratio)) ;middle of area outside of cellar
  49. Sleep(800)
  50. Send("1")
  51. Sleep(100)
  52. Send("3")
  53. sleep(200)
  54. MouseMove(Round(115 * $x_ratio),Round(210 * $y_ratio),1) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
  55. Sleep(475)
  56. $Pixel2 = PixelSearch(0,0,(960 * $x_ratio),(540 * $y_ratio),0x3B62E3,3) ;searches for the specific blue pixel that only occurs when mouse hovers over open cellar
  57. If Not @error Then
  58. MouseClick("left",Round(115 *$x_ratio),Round(210 * $y_ratio)) ;Entrance to cellar
  59. Sleep(150)
  60. Send(2)
  61. Sleep(2500)
  62. MouseClick("middle",Round(531 *$x_ratio),Round(769 * $y_ratio))
  63. Sleep(1400)
  64. MouseClick("middle",Round(547 *$x_ratio),Round(490 * $y_ratio)) ;moves to doorway leading to rare inside cellar
  65. Sleep(500)
  66. MouseMove(Round(579 * $x_ratio),Round(209 * $y_ratio),1) ;hovers over the rare Sarkoth
  67. Send(4)
  68. Sleep(500)
  69. Send("{SHIFTDOWN}")
  70. Sleep(500)
  71. MouseClick("left",Round(600 * $x_ratio),Round(239 * $y_ratio),1)
  72. sleep(500)
  73. MouseDown("right") ;attack middle
  74. Sleep(3800)
  75. MouseMove(Round(467 * $x_ratio),Round(269 * $y_ratio),1) ;attack left, add more sleep time if you can't kill minion on left
  76. Sleep(3000)
  77. MouseMove(Round(682 * $x_ratio),Round(147 * $y_ratio),1) ;attack right
  78. Sleep(2700)
  79. MouseUP("right")
  80. Sleep(300)
  81. Send("{SHIFTUP}")
  82. Sleep(500)
  83. MouseClick("middle",Round(579 *$x_ratio),Round(209 * $y_ratio)) ;location of sarkoth after death
  84. Sleep(2000)
  85. call("FindItem")
  86. sleep(100)
  87. call("FindItem")
  88. sleep(100)
  89. call("FindItem")
  90. sleep(100)
  91. call("FindItem")
  92. sleep(100)
  93. call("FindItem")
  94. sleep(100)
  95. call("FindItem")
  96. sleep(100)
  97. MouseClick("middle",Round(912*$x_ratio),Round(300 * $y_ratio)) ;moves to right top corner for gold
  98. Sleep(1000)
  99. MouseClick("middle", Round(600* $x_ratio), Round(750 * $y_ratio))
  100. Sleep(1300)
  101. Send("t")
  102. Sleep(7500)
  103. Call("CheckRepair")
  104.  
  105. Else
  106. Send("2")
  107. MouseClick("middle",Round(900 *$x_ratio),Round(900 * $y_ratio)) ;moves down screen away from cellar in attempt for safety before teleporting back to town
  108. Sleep(1100)
  109. Send("1")
  110. Sleep(100)
  111. Send("t")
  112. Sleep(7300)
  113. Call("CheckRepair")
  114.  
  115. EndIf
  116. EndIf
  117. WEnd
  118.  
  119.  
  120. Func CheckRepair()
  121. If $x > 9 Then
  122. MouseClick("middle", Round(1480 * $x_ratio),Round(281 * $y_ratio));begin movement towards merchant
  123. Sleep(1400)
  124. MouseClick("middle", Round(1316 * $x_ratio),Round(206 * $y_ratio)) ;moves to get merchant in screen
  125. Sleep(1750)
  126. MouseClick("left", Round(845 * $x_ratio),Round(225 * $y_ratio)) ;NPC Merchant to the right of cain's home
  127. Sleep(1000)
  128. MouseClick("left", Round(521 * $x_ratio),Round(506 * $y_ratio)) ;button to open up repair menu
  129. Sleep(1000)
  130. MouseClick("left", Round(260 * $x_ratio),Round(595 * $y_ratio)) ;button to pay for repairs
  131. Sleep(500)
  132. Send("{ESCAPE}") ;close menu
  133. Sleep(500)
  134. $x = 0
  135. Call("LeaveGame")
  136. Else
  137. $x = $x + 1
  138. Call("LeaveGame")
  139. EndIf
  140.  
  141. EndFunc
  142.  
  143. Func FindItem()
  144. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color) ;searches for rares
  145. If Not @error Then
  146. $HasCleared = 0
  147. call("ClearInv")
  148. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  149. Sleep(1000)
  150. EndIf
  151. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color2 ) ;searches for magics
  152. If Not @error Then
  153. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;clicks magic
  154. Sleep(10)
  155. EndIf
  156.  
  157. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color3 ) ;searches for legendarys
  158. If Not @error Then
  159. $HasCleared = 0
  160. call("ClearInv")
  161. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;clicks legendary
  162. Sleep(1000)
  163. EndIf
  164. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color4) ;searches for SETS
  165. If Not @error Then
  166. $HasCleared = 0
  167. call("ClearInv")
  168. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  169. Sleep(1000)
  170. EndIf
  171.  
  172. ; search for gems
  173.  
  174. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Amethyst,9) ;searches for gems
  175. If Not @error Then
  176. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  177. Sleep(1500)
  178. EndIf
  179. $SearchResult = PixelSearch($Left, $Top, $Right, 694, $Ruby,6) ;searches for gems
  180. If Not @error Then
  181. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  182. Sleep(1500)
  183. EndIf
  184. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Topaz,4) ;searches for gems
  185. If Not @error Then
  186. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  187. Sleep(1500)
  188. EndIf
  189. $SearchResult = PixelSearch($Left, $Top, $Right, 694, $Emerald,9) ;searches for gems
  190. If Not @error Then
  191. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  192. Sleep(1500)
  193. EndIf
  194. EndFunc
  195.  
  196. Func ClearInv()
  197. Send("{i}")
  198. Sleep(800)
  199. $SearchResult = PixelSearch($LeftClear, $TopClear, $RightClear, $BottomClear, $WhiteClear)
  200. If Not @error Then
  201. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10)
  202. Sleep(500)
  203. MouseClick("left", Round(697* $x_ratio),Round(459 * $y_ratio))
  204. Sleep(800)
  205. $HasCleared = 1
  206. EndIf
  207. $SearchResult = PixelSearch($LeftClear, $TopClear, $RightClear, $BottomClear, $BlueClear)
  208. If Not @error Then
  209. If $HasCleared = 0 Then
  210. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10)
  211. Sleep(500)
  212. MouseClick("left", Round(697* $x_ratio),Round(459 * $y_ratio))
  213. Sleep(500)
  214. $HasCleared = 1
  215. EndIf
  216. EndIf
  217. Send("{ESCAPE}")
  218. Sleep(500)
  219. EndFunc
  220.  
  221. Func LeaveGame()
  222. Send("{ESCAPE}") ;opens menu
  223. Sleep(1000)
  224. MouseClick("left", Round(956 * $x_ratio),Round(579 * $y_ratio)) ;button to leave game
  225. Sleep(12000)
  226. MouseClick("left", Round(230 * $x_ratio),Round(416 * $y_ratio)) ;button to resume game from main menu
  227. Sleep(6000)
  228. EndFunc
  229.  
  230.  
  231. Func Pause()
  232. $Leave = False
  233. EndFunc
  234.  
  235. Func Stop() ;to allow the script to stop
  236. Exit
  237. EndFunc
  238.  
  239. Func Leave()
  240. $Leave = True
  241. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment