Advertisement
jakesmurf

Jakesmurf's Gold Farm 2.1e

Jun 9th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.26 KB | None | 0 0
  1. Global $Paused
  2. Global $Paused
  3.  
  4.  
  5.  
  6. $default_resolutionX = 1920
  7. $default_resolutionY = 1080
  8. $x_ratio = @Desktopwidth / $default_resolutionX
  9. $y_ratio = @Desktopheight / $default_resolutionY
  10. Dim $Color, $Left, $Top, $Right, $Bottom
  11. $Color = 0xFFFF00 ;rare color code
  12. $Color2 = 0x6969FF ;blue color code I have the ; in the 6969ff so it doesent pickup remove if you want it too!
  13. $Color3 = 0xBF642F ;legendary color code
  14. $Color4 = 0x00FF00 ;SET color
  15. $Left = 300
  16. $Top = 0
  17. $Right = 1920
  18. $Bottom = 1080
  19. $x = 1
  20. $LeftClear = 1000
  21. $RightClear = 1299
  22. $TopClear = 412
  23. $BottomClear = 620
  24. $BlueClear = 0x111E34
  25. $WhiteClear = 0x100908
  26. $HasCleared = 0
  27. $Amethyst = 0xA56DF1
  28. $Ruby = 0xFA8078
  29. $Emerald = 0x51965B
  30. $Topaz = 0xFFFF59
  31. $LeaveVar = 1
  32. $ResumeVar = 1
  33. $IsDead = 0
  34.  
  35. $go = True
  36.  
  37. While $go = true
  38.  
  39. HotKeySet("=","Start")
  40. HotKeySet("x", "Stop")
  41.  
  42. Wend
  43.  
  44.  
  45. Func StartRun()
  46.  
  47. MouseClick("middle", Round(500*$x_ratio), Round(250*$y_ratio)) ;starts the run [waypoint 1]
  48. Sleep(200)
  49. Send("2")
  50. Sleep(650)
  51. MouseClick("middle", 1, Round(370*$y_ratio)) ;waits 1 second then [waypoint 2]
  52. Call("CheckDead")
  53. Sleep(100)
  54. Send("1")
  55. Sleep(1100)
  56. MouseClick("middle", Round(400*$x_ratio), Round(600*$y_ratio)) ;middle of courtyard
  57. Call("CheckDead")
  58. Sleep(900)
  59. Send("1")
  60. Send("3")
  61. sleep(200)
  62. ;cellar check
  63.  
  64. MouseMove(Round(300*$x_ratio),Round(100*$y_ratio),1) ;moves cursor over to the cellar ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
  65. Sleep(525)
  66. $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
  67. If Not @error Then
  68. MouseClick("left",Round(300 *$x_ratio),Round(100 * $y_ratio)) ;Entrance to cellar
  69. Call("RunCellar")
  70. EndIf
  71. Call("CheckDead")
  72. MouseMove(Round(300*$x_ratio),Round(75*$y_ratio),1) ;moves cursor over to the cellar ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
  73. Sleep(300)
  74. $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
  75. If Not @error Then
  76. MouseClick("left",Round(300 *$x_ratio),Round(75 * $y_ratio)) ;Entrance to cellar
  77. Call("RunCellar")
  78. EndIf
  79. Call("CheckDead")
  80. MouseMove(Round(300*$x_ratio),Round(50*$y_ratio),1) ;moves cursor over to the cellar ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
  81. Sleep(250)
  82. $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
  83. If Not @error Then
  84. MouseClick("left",Round(300 *$x_ratio),Round(50 * $y_ratio)) ;Entrance to cellar
  85. Call("RunCellar")
  86. EndIf
  87. Call("CheckDead")
  88. MouseMove(Round(250*$x_ratio),Round(50*$y_ratio),1) ;moves cursor over to the cellar ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
  89. Sleep(250)
  90. $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
  91. If Not @error Then
  92. MouseClick("left",Round(250 *$x_ratio),Round(50 * $y_ratio)) ;Entrance to cellar
  93. Call("RunCellar")
  94.  
  95. Else
  96. Call("NoCellar") ;send you to the townportal sequence
  97. EndIf
  98. EndFunc
  99.  
  100. Func RunCellar() ;this is the sequence for when you are inside the cellar
  101. if not @error Then
  102.  
  103. Sleep(150)
  104. Send(2)
  105. Sleep(2800)
  106. Call("CheckDead")
  107. MouseClick("middle",Round(531 *$x_ratio),Round(769 * $y_ratio))
  108. Sleep(1100)
  109. MouseClick("middle",Round(547 *$x_ratio),Round(490 * $y_ratio)) ;moves to doorway leading to rare inside cellar
  110. Sleep(500)
  111. MouseMove(Round(579 * $x_ratio),Round(209 * $y_ratio),1) ;hovers over the rare Sarkoth
  112. Send(4)
  113. Sleep(500)
  114. Call("CheckDead")
  115. if $IsDead = 0 Then
  116. Send("{SHIFTDOWN}")
  117. Sleep(500)
  118. MouseClick("left",Round(600 * $x_ratio),Round(239 * $y_ratio),1)
  119. sleep(500)
  120. MouseDown("right") ;attack middle
  121. Sleep(3800)
  122. MouseMove(Round(467 * $x_ratio),Round(269 * $y_ratio),1) ;attack left, add more sleep time if you can't kill minion on left
  123. Sleep(3000)
  124. MouseMove(Round(682 * $x_ratio),Round(147 * $y_ratio),1) ;attack right
  125. Sleep(2700)
  126. MouseUP("right")
  127. Sleep(300)
  128. Send("{SHIFTUP}")
  129. Sleep(500)
  130. MouseClick("middle",Round(579 *$x_ratio),Round(209 * $y_ratio)) ;location of sarkoth after death
  131. Sleep(1400)
  132. call("FindItem")
  133. call("FindItem")
  134. call("FindItem")
  135. call("FindItem")
  136. MouseClick("left",Round(912*$x_ratio),Round(300 * $y_ratio)) ;moves to right top corner for gold
  137. Sleep(500)
  138. Send("t")
  139. Sleep(7500)
  140. Call("CheckRepair")
  141.  
  142. Else
  143.  
  144. $IsDead = 0
  145.  
  146.  
  147. EndIf
  148. EndIF
  149. EndFunc
  150.  
  151. Func NoCellar() ; town portal sequence if the cellar is not there
  152. if not @error then
  153. Send("2")
  154. MouseClick("middle",Round(1300 *$x_ratio),Round(900 * $y_ratio)) ;moves down screen away from cellar in attempt for safety before teleporting back to town
  155. Sleep(1100)
  156. Send("1")
  157. Sleep(100)
  158. Call("CheckDead")
  159. Send("t")
  160. Sleep(7300)
  161. Call("CheckDead")
  162. Call("CheckRepair")
  163. EndIf
  164. EndFunc
  165.  
  166. Func CheckRepair()
  167. If $x > 9 Then
  168. MouseClick("middle", Round(1480 * $x_ratio),Round(281 * $y_ratio));begin movement towards merchant
  169. Sleep(1400)
  170. MouseClick("middle", Round(1316 * $x_ratio),Round(206 * $y_ratio)) ;moves to get merchant in screen
  171. Sleep(1750)
  172. MouseClick("left", Round(845 * $x_ratio),Round(225 * $y_ratio)) ;NPC Merchant to the right of cain's home
  173. Sleep(1000)
  174. MouseClick("left", Round(521 * $x_ratio),Round(506 * $y_ratio)) ;button to open up repair menu
  175. Sleep(1000)
  176. MouseClick("left", Round(260 * $x_ratio),Round(595 * $y_ratio)) ;button to pay for repairs
  177. Sleep(500)
  178. Send("{ESCAPE}") ;close menu
  179. Sleep(500)
  180. $x = 0
  181. Call("LeaveGame")
  182. Else
  183. $x = $x + 1
  184. Call("LeaveGame")
  185. EndIf
  186.  
  187. EndFunc
  188.  
  189. Func FindItem()
  190. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color) ;searches for rares
  191. If Not @error Then
  192. $HasCleared = 0
  193. call("ClearInv")
  194. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color)
  195. If not @error Then
  196. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  197. Sleep(1500)
  198. EndIf
  199. EndIf
  200. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color2 ) ;searches for magics
  201. If Not @error Then
  202. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color)
  203. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;clicks magic
  204. Sleep(250)
  205. EndIf
  206.  
  207. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color3 ) ;searches for legendarys
  208. If Not @error Then
  209. $HasCleared = 0
  210. call("ClearInv")
  211. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color)
  212. if not @error then
  213. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;clicks legendary
  214. Sleep(2000)
  215. EndIf
  216. EndIf
  217. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color4) ;searches for SETS
  218. If Not @error Then
  219. $HasCleared = 0
  220. call("ClearInv")
  221. $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color)
  222. If not @error then
  223. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  224. Sleep(2000)
  225. EndIf
  226. EndIf
  227.  
  228. ; search for gems
  229.  
  230. $SearchResult = PixelSearch(300, 45, 1190, $Bottom, $Amethyst,8) ;searches for gems
  231. If Not @error Then
  232. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  233. Sleep(1500)
  234. EndIf
  235. $SearchResult = PixelSearch(300, 45, 1190, 624, $Ruby,5) ;searches for gems
  236. If Not @error Then
  237. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  238. Sleep(1500)
  239. EndIf
  240. $SearchResult = PixelSearch(300, 45, 1190, 624, $Emerald,9) ;searches for gems
  241. If Not @error Then
  242. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  243. Sleep(1500)
  244. EndIf
  245. ; $SearchResult = PixelSearch(300, 45, 1190, 624, $Topaz,2) ;searches for gems
  246. ; If Not @error Then
  247. ; MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
  248. ; Sleep(800)
  249. ; EndIf
  250. EndFunc
  251.  
  252. Func ClearInv()
  253. Send("{i}")
  254. Sleep(800)
  255. $SearchResult = PixelSearch($LeftClear, $TopClear, $RightClear, $BottomClear, $WhiteClear)
  256. If Not @error Then
  257. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10)
  258. Sleep(500)
  259. MouseClick("left", Round(697* $x_ratio),Round(459 * $y_ratio))
  260. Sleep(800)
  261. $HasCleared = 1
  262. EndIf
  263. $SearchResult = PixelSearch($LeftClear, $TopClear, $RightClear, $BottomClear, $BlueClear)
  264. If Not @error Then
  265. If $HasCleared = 0 Then
  266. MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10)
  267. Sleep(500)
  268. MouseClick("left", Round(697* $x_ratio),Round(459 * $y_ratio))
  269. Sleep(500)
  270. $HasCleared = 1
  271. EndIf
  272. EndIf
  273. Send("{ESCAPE}")
  274. Sleep(500)
  275. EndFunc
  276.  
  277. Func LeaveGame()
  278. Call("CheckWindow")
  279. Send("{ESCAPE}") ;opens menu
  280. Sleep(1000)
  281. $Pixel3 = PixelSearch(665,400,690,425,0xC5803E,8)
  282. If Not @error Then
  283. MouseClick("left", Round(956 * $x_ratio),Round(579 * $y_ratio)) ;button to leave game
  284. Sleep(3000)
  285. Call("CheckResume")
  286. Else
  287. Call("LeaveGame")
  288. EndIF
  289. EndFunc
  290.  
  291. Func CheckResume()
  292.  
  293. Call("CheckWindow")
  294.  
  295. While $LeaveVar < 20
  296.  
  297. Sleep(500)
  298. $Pixel3 = PixelSearch(30,715,50,745,0x801C00,2)
  299. If Not @error Then
  300. MouseClick("left", Round(230 * $x_ratio),Round(416 * $y_ratio)) ;button to resume game from main menu
  301. Sleep(2000)
  302. Call("JoinGame")
  303. $LeaveVar = 1
  304. Else
  305.  
  306. $LeaveVar = $LeaveVar + 1
  307.  
  308. EndIf
  309. WEnd
  310.  
  311. MouseClick("left", Round(230 * $x_ratio),Round(416 * $y_ratio)) ;button to resume game from main menu
  312. Sleep(2000)
  313. Call("JoinGame")
  314. $LeaveVar = 1
  315.  
  316. EndFunc
  317.  
  318.  
  319. Func JoinGame()
  320.  
  321. While $ResumeVar < 18
  322.  
  323. Sleep(500)
  324. $Pixel3 = PixelSearch(725,720,770,750,0xDC1D1D,8)
  325. If Not @error Then
  326. $ResumeVar = 1
  327. Call("StartRun")
  328. Else
  329. $Pixel3 = PixelSearch(1160,700,1180,730,0xE1B559,1)
  330. If Not @error Then
  331. MouseClick("left", Round(230 * $x_ratio),Round(416 * $y_ratio)) ;button to resume game from main menu
  332. Sleep(2000)
  333. EndIf
  334. $ResumeVar = $ResumeVar + 1
  335. EndIf
  336. WEnd
  337.  
  338. call("StartRun")
  339.  
  340. EndFunc
  341.  
  342. Func CheckWindow()
  343.  
  344. $Pixel3 = PixelSearch(1115,75,1125,85,0xFFD594,4)
  345. If Not @error Then
  346. Send("{ESCAPE}")
  347. Sleep(500)
  348. Call("CheckResume")
  349. EndIf
  350.  
  351. $Pixel3 = PixelSearch(815,150,830,165,0xFFD594,4)
  352. If Not @error Then
  353. Send("{ESCAPE}")
  354. Sleep(500)
  355. Call("CheckResume")
  356. EndIf
  357.  
  358. $Pixel3 = PixelSearch(670,440,690,460,0xB47539,5)
  359. If Not @error Then
  360. Send("{ESCAPE}")
  361. Sleep(2000)
  362. Call("CheckResume")
  363. EndIf
  364.  
  365. EndFunc
  366.  
  367. Func CheckDead()
  368.  
  369. $Pixel3 = PixelSearch(990,247,1000,259,0xFFFFFF,4)
  370. If Not @error Then
  371. Sleep(500)
  372. $IsDead = 1
  373. Call("LeaveGame")
  374. Else
  375.  
  376. $IsDead = 0
  377.  
  378. EndIf
  379.  
  380. EndFunc
  381.  
  382. Func Pause()
  383. $Leave = False
  384. EndFunc
  385.  
  386. Func Stop() ;to allow the script to stop
  387. Exit
  388. EndFunc
  389.  
  390. Func Start()
  391. Call("StartRun")
  392. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement