Advertisement
Guest User

Sak Farm!

a guest
Jun 21st, 2012
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.33 KB | None | 0 0
  1. Global $Paused
  2. HotKeySet("=","Leave") ;script can START by pressing =
  3. HotKeySet("-", "Pause") ;script can be Pause by pressing -
  4. HotKeySet("x", "Stop") ;script can be Stopped by pressing x
  5.  
  6. ;-----------------------------------------------------
  7. ;-----------------------------------------------------
  8. ; Settings
  9. $SearchForWhite = False ;True / False Activate/Deactivate white looting (will not pick potions / gems either)
  10. $SearchForBlue = True ;True / False Activate/Deactivate blue looting
  11. $KeepPotion = True ;True / False Activate/Deactivate dropping potion in stash
  12. $KeepGems = False ;True / False Activate/Deactivate dropping in stash
  13. $SarkothKillBeforeVendoring = 10 ;Number of kill before going to town to deposit and vendor
  14. $LootingLoopCount = 2 ;Number of times you try looting items on the ground (increasing will increase the chance of unstucking yourself and keep looting)
  15. $TimeOffset = 0 ;Increase this if you stop running before reaching the cellar door (1000 = 1 second)
  16. $SalvageBlues = True ;True / False Activate/Deactivate Salavage of blues
  17. ;-----------------------------------------------------
  18. ;-----------------------------------------------------
  19.  
  20.  
  21. $go = True
  22. $Run = False
  23. $runMade = 0
  24.  
  25. While $go
  26. if($Run) Then
  27. $Pixel1 = PixelSearch(1500,57,1535,95,0xFFF000) ;searches top right screen for yellow of broken armor
  28. If Not @error Then
  29. ;we need to repair
  30. Send("t")
  31. Sleep(8000)
  32. MouseClick("left", 1480, 281) ;begin movement towards merchant
  33. Sleep(1500)
  34. MouseClick("left", 1316, 206) ;moves to get merchant in screen
  35. Sleep(1500)
  36. MouseClick("left", 845, 225) ;NPC Merchant to the right of cain's home
  37. Sleep(1500)
  38. MouseClick("left", 521, 506) ;button to open up repair menu
  39. Sleep(1500)
  40. MouseClick("left", 260, 595) ;button to pay for repairs
  41. Sleep(2500)
  42. Send("{ESCAPE}") ;close windows
  43. Sleep(200);
  44. ResumeGame()
  45. Else
  46. ;starts the run
  47. MouseClick("left", 54, 129)
  48. Sleep(1300)
  49. Send("2")
  50. Sleep(600)
  51. Send("1")
  52. Sleep(1000)
  53. MouseClick("left", 87, 429)
  54. Sleep(1500 + $TimeOffset)
  55. Send("1")
  56. Sleep(random(800,1000))
  57. Send("3")
  58. MouseMove(203, 186,1) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
  59. Sleep(Random(500,750))
  60. if(StatusCheck()) Then
  61. $Pixel2 = PixelSearch(92,123,247,187,0xffffff) ;searches for the white pixel in the cellar name
  62. If Not @error Then
  63. MouseClick("left",203, 186) ;Entrance to cellar
  64. Sleep(2000)
  65. Send(2)
  66. Sleep(2800)
  67. while Loading()
  68. ; "pause" the script until loading is over
  69. WEnd
  70. MouseClick("left", 531, 769)
  71. Send(4)
  72. Sleep(2000)
  73. MouseClick("left", 547, 490) ;moves to doorway leading to rare inside cellar
  74. Sleep(1500)
  75. MouseMove(624,258,1) ;hovers over the rare Sarkoth
  76. Send("{SHIFTDOWN}")
  77. MouseDown("right")
  78. Sleep(5200)
  79. MouseMove(474, 273, 1) ;attack left, add more sleep time if you can't kill minion on left
  80. Sleep(1000)
  81. MouseMove(732, 232, 1) ;attack right
  82. Sleep(500)
  83. MouseMove(624,258, 1) ;attack mid again
  84. Sleep(1000)
  85. MouseUP("right")
  86. Send("{SHIFTUP}")
  87. Sleep(1500)
  88. Looting()
  89. if (StatusCheck()) Then
  90. Sleep(1500)
  91. Send("t")
  92. Sleep(10200)
  93. Town()
  94. ResumeGame()
  95. EndIf
  96. Else
  97. if(StatusCheck()) Then
  98. Sleep(random(300,450))
  99. Send(3);added/changed
  100. Sleep(random(150,200))
  101. Send(3)
  102. Sleep(random(125,225))
  103. Send(2)
  104. Sleep(random(100,125)); added/CHANGED
  105. Send("t")
  106. Sleep(8200)
  107. ResumeGame()
  108. EndIf
  109. EndIf
  110. EndIf
  111. EndIf
  112. EndIf
  113. WEnd
  114.  
  115. Func Pause()
  116. $Run = False
  117. EndFunc
  118.  
  119. Func Stop() ;to allow the script to stop
  120. Exit
  121. EndFunc
  122.  
  123. Func Leave()
  124. $Run = True
  125. EndFunc
  126.  
  127. Func SearchBlue()
  128. $cnt = 0
  129. $Searching = True
  130. while $Searching
  131. $Pixel3 = PixelSearch(0,0,1950,1120,0x6969ff)
  132. if Not @error Then
  133. Send("{ALTDOWN}")
  134. Send("{ALTUP}")
  135. MouseClick("left", $Pixel3[0], $Pixel3[1])
  136. Sleep(1000)
  137. $cnt = $cnt + 1
  138. if $cnt > 8 Then
  139. $Searching = False
  140. EndIf
  141. Else
  142. $Searching = False
  143. EndIf
  144. WEnd
  145. EndFunc
  146.  
  147. Func SearchYellow()
  148. $cnt = 0
  149. $Searching = True
  150. while $Searching
  151. $Pixel3 = PixelSearch(0,0,1950,1120,0xe0e205)
  152. if Not @error Then
  153. Send("{ALTDOWN}")
  154. Send("{ALTUP}")
  155. MouseClick("left", $Pixel3[0], $Pixel3[1])
  156. Sleep(1000)
  157. $cnt = $cnt + 1
  158. if $cnt > 8 Then
  159. $Searching = False
  160. EndIf
  161. Else
  162. $Searching = False
  163. EndIf
  164. WEnd
  165.  
  166. $cnt = 0
  167. $Searching = True
  168. while $Searching
  169. $Pixel3 = PixelSearch(0,0,1950,1120,0xc5c509)
  170. if Not @error Then
  171. Send("{ALTDOWN}")
  172. Send("{ALTUP}")
  173. MouseClick("left", $Pixel3[0], $Pixel3[1])
  174. Sleep(1000)
  175. $cnt = $cnt + 1
  176. if $cnt > 8 Then
  177. $Searching = False
  178. EndIf
  179. Else
  180. $Searching = False
  181. EndIf
  182. WEnd
  183.  
  184. $cnt = 0
  185. $Searching = True
  186. while $Searching
  187. $Pixel3 = PixelSearch(0,0,1950,1120,0xd4d711)
  188. if Not @error Then
  189. Send("{ALTDOWN}")
  190. Send("{ALTUP}")
  191. MouseClick("left", $Pixel3[0], $Pixel3[1])
  192. Sleep(1000)
  193. $cnt = $cnt + 1
  194. if $cnt > 8 Then
  195. $Searching = False
  196. EndIf
  197. Else
  198. $Searching = False
  199. EndIf
  200. WEnd
  201.  
  202. $cnt = 0
  203. $Searching = True
  204. while $Searching
  205. $Pixel3 = PixelSearch(0,0,1950,1120,0xdddd00)
  206. if Not @error Then
  207. Send("{ALTDOWN}")
  208. Send("{ALTUP}")
  209. MouseClick("left", $Pixel3[0], $Pixel3[1])
  210. Sleep(1000)
  211. $cnt = $cnt + 1
  212. if $cnt > 8 Then
  213. $Searching = False
  214. EndIf
  215. Else
  216. $Searching = False
  217. EndIf
  218. WEnd
  219. EndFunc
  220.  
  221. Func SearchOrange()
  222. $cnt = 0
  223. $Searching = True
  224. while $Searching
  225. $Pixel3 = PixelSearch(0,0,1950,1120,0x9b5227)
  226. if Not @error Then
  227. Send("{ALTDOWN}")
  228. Send("{ALTUP}")
  229. MouseClick("left", $Pixel3[0], $Pixel3[1])
  230. Sleep(1000)
  231. $cnt = $cnt + 1
  232. if $cnt > 8 Then
  233. $Searching = False
  234. EndIf
  235. Else
  236. $Searching = False
  237. EndIf
  238. WEnd
  239. EndFunc
  240.  
  241. Func SearchWhite()
  242. ;if $SearchForWhite = 1 Then
  243.  
  244. $cnt = 0
  245. $Searching = True
  246. while $Searching
  247. $Pixel3 = PixelSearch(350,200,1350,800,0xeeeeee)
  248. if Not @error Then
  249. Send("{ALTDOWN}")
  250. Send("{ALTUP}")
  251. MouseClick("left", $Pixel3[0], $Pixel3[1])
  252. Sleep(1000)
  253. $cnt = $cnt + 1
  254. if $cnt > 8 Then
  255. $Searching = False
  256. EndIf
  257. Else
  258. $Searching = False
  259. EndIf
  260. WEnd
  261. ; EndIf
  262. EndFunc
  263.  
  264. Func Town()
  265. $runMade = $runMade + 1
  266. If $runMade > $SarkothKillBeforeVendoring Then
  267. $runMade = 0
  268.  
  269. if($SalvageBlues)Then
  270. ReachBlacksmith()
  271. Sleep(3500)
  272. Else
  273. MouseClick("left", 1064, 256) ;go to chest
  274. Sleep(2000)
  275. EndIf
  276. MouseClick("left", 517, 251) ; 1st tab
  277. Sleep(500);
  278. DropInChest();
  279. MouseClick("left", 517, 378) ; 2nd tab
  280. Sleep(500);
  281. DepositRare()
  282. MouseClick("left", 517, 500) ; 3rd tab
  283. Sleep(500);
  284. DepositRare()
  285. Sleep(500);
  286. Send("{ESCAPE}") ;close windows
  287. Sleep(500)
  288. MouseClick("left", 1541, 238) ;go half way to vendor
  289. Sleep(2000)
  290.  
  291. if($SalvageBlues)Then
  292. MouseClick("left", 956, 132) ;go to vendor
  293. Else
  294. MouseClick("left", 1105, 225) ;go to vendor
  295. EndIf
  296.  
  297. Sleep(2000)
  298. VendorAll()
  299. MouseClick("left", 506, 483) ;click repair tab
  300. Sleep(200)
  301. MouseClick("left", 242, 528) ;click repair
  302. Sleep(200)
  303. Send("{ESCAPE}") ;close windows
  304. Sleep(500)
  305. EndIf
  306. EndFunc
  307.  
  308. Func StatusCheck()
  309. if Not CheckDeath() Then
  310. TrayTip("Status", "NOT OK:: Death", 1)
  311. Return False
  312. EndIf
  313.  
  314. if Not CheckConnection() Then
  315. TrayTip("Status", "NOT OK:: Connection", 1)
  316. Return False
  317. EndIf
  318.  
  319. Return True
  320. EndFunc
  321.  
  322. Func Looting()
  323. For $i = 1 To $LootingLoopCount
  324. if ($SearchForBlue) Then
  325. SearchBlue()
  326. EndIf
  327.  
  328. SearchYellow()
  329. SearchOrange()
  330.  
  331. if ($SearchForWhite) Then
  332. SearchWhite()
  333. EndIf
  334. Sleep(500)
  335. Next
  336. EndFunc
  337.  
  338. Func DropInChest()
  339. ; Tome of secret
  340. $Searching = True
  341. while $Searching
  342. $Pixel3 = PixelSearch(1400,584,1900,874,0x507554 )
  343. if Not @error Then
  344. MouseClick("right", $Pixel3[0], $Pixel3[1])
  345. Sleep(500)
  346. Else
  347. $Searching = False
  348. EndIf
  349. WEnd
  350.  
  351. ; mystic potion
  352. if($KeepPotion) Then
  353. $Searching = True
  354. while $Searching
  355. $Pixel3 = PixelSearch(1400,584,1900,874,0x4a1008 )
  356. if Not @error Then
  357. MouseClick("right", $Pixel3[0], $Pixel3[1])
  358. Sleep(500)
  359. Else
  360. $Searching = False
  361. EndIf
  362. WEnd
  363. EndIf
  364.  
  365. if ($KeepGems = False) Then
  366. Return
  367. EndIf
  368.  
  369. ; Yellow gems
  370. $Searching = True
  371. while $Searching
  372. $Pixel3 = PixelSearch(1400,584,1900,874,0xce8200 )
  373. if Not @error Then
  374. MouseClick("right", $Pixel3[0], $Pixel3[1])
  375. Sleep(500)
  376. Else
  377. $Searching = False
  378. EndIf
  379. WEnd
  380.  
  381. ; Yellow gems
  382. $Searching = True
  383. while $Searching
  384. $Pixel3 = PixelSearch(1400,584,1900,874,0xc17900 )
  385. if Not @error Then
  386. MouseClick("right", $Pixel3[0], $Pixel3[1])
  387. Sleep(500)
  388. Else
  389. $Searching = False
  390. EndIf
  391. WEnd
  392.  
  393.  
  394. ; Green gems
  395. $Searching = True
  396. while $Searching
  397. $Pixel3 = PixelSearch(1400,584,1900,874,0x319e31 )
  398. if Not @error Then
  399. MouseClick("right", $Pixel3[0], $Pixel3[1])
  400. Sleep(500)
  401. Else
  402. $Searching = False
  403. EndIf
  404. WEnd
  405.  
  406. ; Green gems
  407. $Searching = True
  408. while $Searching
  409. $Pixel3 = PixelSearch(1400,584,1900,874,0x3db835 )
  410. if Not @error Then
  411. MouseClick("right", $Pixel3[0], $Pixel3[1])
  412. Sleep(500)
  413. Else
  414. $Searching = False
  415. EndIf
  416. WEnd
  417.  
  418.  
  419. ; Red gems
  420. $Searching = True
  421. while $Searching
  422. $Pixel3 = PixelSearch(1400,584,1900,874,0xf01d1f)
  423. if Not @error Then
  424. MouseClick("right", $Pixel3[0], $Pixel3[1])
  425. Sleep(500)
  426. Else
  427. $Searching = False
  428. EndIf
  429. WEnd
  430.  
  431. ; Red gems
  432. $Searching = True
  433. while $Searching
  434. $Pixel3 = PixelSearch(1400,584,1900,874,0xe90b0b)
  435. if Not @error Then
  436. MouseClick("right", $Pixel3[0], $Pixel3[1])
  437. Sleep(500)
  438. Else
  439. $Searching = False
  440. EndIf
  441. WEnd
  442.  
  443. ; Red gems
  444. $Searching = True
  445. while $Searching
  446. $Pixel3 = PixelSearch(1400,584,1900,874,0xe80a0a)
  447. if Not @error Then
  448. MouseClick("right", $Pixel3[0], $Pixel3[1])
  449. Sleep(500)
  450. Else
  451. $Searching = False
  452. EndIf
  453. WEnd
  454.  
  455. ; Red gems
  456. $Searching = True
  457. while $Searching
  458. $Pixel3 = PixelSearch(1400,584,1900,874,0xef0d11)
  459. if Not @error Then
  460. MouseClick("right", $Pixel3[0], $Pixel3[1])
  461. Sleep(500)
  462. Else
  463. $Searching = False
  464. EndIf
  465. WEnd
  466.  
  467.  
  468. ; Purple gems
  469. $Searching = True
  470. while $Searching
  471. $Pixel3 = PixelSearch(1400,584,1900,874,0x9905db )
  472. if Not @error Then
  473. MouseClick("right", $Pixel3[0], $Pixel3[1])
  474. Sleep(500)
  475. Else
  476. $Searching = False
  477. EndIf
  478. WEnd
  479.  
  480. ; Purple gems
  481. $Searching = True
  482. while $Searching
  483. $Pixel3 = PixelSearch(1400,584,1900,874,0xb110f7 )
  484. if Not @error Then
  485. MouseClick("right", $Pixel3[0], $Pixel3[1])
  486. Sleep(500)
  487. Else
  488. $Searching = False
  489. EndIf
  490. WEnd
  491.  
  492. DepositCraftingMats()
  493. EndFunc
  494.  
  495. Func DepositCraftingMats()
  496. ;inferno dust
  497. $Searching = True
  498. while $Searching
  499. $Pixel3 = PixelSearch(1400,584,1900,874,0xc6a6e3 )
  500. if Not @error Then
  501. MouseClick("right", $Pixel3[0], $Pixel3[1])
  502. Sleep(500)
  503. Else
  504. $Searching = False
  505. EndIf
  506. WEnd
  507.  
  508. ;hell dust
  509. $Searching = True
  510. while $Searching
  511. $Pixel3 = PixelSearch(1400,584,1900,874,0xddd2a5 )
  512. if Not @error Then
  513. MouseClick("right", $Pixel3[0], $Pixel3[1])
  514. Sleep(500)
  515. Else
  516. $Searching = False
  517. EndIf
  518. WEnd
  519.  
  520. ; brimstone
  521. $Searching = True
  522. while $Searching
  523. $Pixel3 = PixelSearch(1400,584,1900,874,0xac2a02 )
  524. if Not @error Then
  525. MouseClick("right", $Pixel3[0], $Pixel3[1])
  526. Sleep(500)
  527. Else
  528. $Searching = False
  529. EndIf
  530. WEnd
  531.  
  532. ; hell yellow mats
  533. $Searching = True
  534. while $Searching
  535. $Pixel3 = PixelSearch(1400,584,1900,874,0xe0c49f )
  536. if Not @error Then
  537. MouseClick("right", $Pixel3[0], $Pixel3[1])
  538. Sleep(500)
  539. Else
  540. $Searching = False
  541. EndIf
  542. WEnd
  543.  
  544. ; inferno yellow mats
  545. $Searching = True
  546. while $Searching
  547. $Pixel3 = PixelSearch(1400,584,1900,874,0xffbea5 )
  548. if Not @error Then
  549. MouseClick("right", $Pixel3[0], $Pixel3[1])
  550. Sleep(500)
  551. Else
  552. $Searching = False
  553. EndIf
  554. WEnd
  555. EndFunc
  556.  
  557. Func VendorAll()
  558. For $i = 0 To 9 Step 1
  559. MouseClick("right", 1432 + (50 * $i), 609)
  560. Sleep(25)
  561. MouseClick("right", 1432 + (50 * $i), 609 + 50)
  562. Sleep(25)
  563. MouseClick("right", 1432 + (50 * $i), 609 + 100)
  564. Sleep(25)
  565. MouseClick("right", 1432 + (50 * $i), 609 + 150)
  566. Sleep(25)
  567. MouseClick("right", 1432 + (50 * $i), 609 + 200)
  568. Sleep(25)
  569. MouseClick("right", 1432 + (50 * $i), 609 + 250)
  570. Sleep(25)
  571. Next
  572. EndFunc
  573.  
  574. Func SellBlue($mouseBtn)
  575.  
  576. ; 1st color
  577. ; 2 slots items
  578. ;$Searching = True
  579. ;while $Searching
  580. ; $Pixel3 = PixelSearch(1400,584,1900,874,0x161829 )
  581. ; if Not @error Then
  582. ; TrayTip("found blue:", "color: 1", 1)
  583. ; MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
  584. ; Sleep(500)
  585. ; Else
  586. ; $Searching = False
  587. ; EndIf
  588. ;WEnd
  589. ; 1 slots items
  590. $Searching = True
  591. while $Searching
  592. $Pixel3 = PixelSearch(1400,584,1900,874,0x161c36 )
  593. if Not @error Then
  594. TrayTip("found blue:", "color: 2", 1)
  595. MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
  596. Sleep(500)
  597. Else
  598. $Searching = False
  599. EndIf
  600. WEnd
  601.  
  602. ; more color
  603. $Searching = True
  604. while $Searching
  605. $Pixel3 = PixelSearch(1400,584,1900,874,0x13233c )
  606. if Not @error Then
  607. TrayTip("found blue:", "color: 3", 1)
  608. MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
  609. Sleep(500)
  610. Else
  611. $Searching = False
  612. EndIf
  613. WEnd
  614.  
  615. ; more color
  616. $Searching = True
  617. while $Searching
  618. $Pixel3 = PixelSearch(1400,584,1900,874,0x182343 )
  619. if Not @error Then
  620. TrayTip("found blue:", "color: 4", 1)
  621. MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
  622. Sleep(500)
  623. Else
  624. $Searching = False
  625. EndIf
  626. WEnd
  627.  
  628. ; more color
  629. $Searching = True
  630. while $Searching
  631. $Pixel3 = PixelSearch(1400,584,1900,874,0x233055 )
  632. if Not @error Then
  633. TrayTip("found blue:", "color: 5", 1)
  634. MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
  635. Sleep(500)
  636. Else
  637. $Searching = False
  638. EndIf
  639. WEnd
  640.  
  641. ; more color
  642. $Searching = True
  643. while $Searching
  644. $Pixel3 = PixelSearch(1400,584,1900,874,0x102039 )
  645. if Not @error Then
  646. TrayTip("found blue:", "color: 6", 1)
  647. MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
  648. Sleep(500)
  649. Else
  650. $Searching = False
  651. EndIf
  652. WEnd
  653. EndFunc
  654.  
  655. Func SellWhite()
  656. ; more color
  657. $Searching = True
  658. while $Searching
  659. $Pixel3 = PixelSearch(1400,584,1900,874,0xffffff )
  660. if Not @error Then
  661. MouseClick("right", $Pixel3[0], $Pixel3[1])
  662. Sleep(500)
  663. Else
  664. $Searching = False
  665. EndIf
  666. WEnd
  667. endFunc
  668.  
  669. Func DepositRare()
  670. ;Yellow
  671. ;1st color
  672. ; 2 slots items
  673. $Searching = True
  674. while $Searching
  675. $Pixel3 = PixelSearch(1400,584,1900,874,0x604f0b )
  676. if Not @error Then
  677. MouseClick("right", $Pixel3[0], $Pixel3[1])
  678. Sleep(500)
  679. Else
  680. $Searching = False
  681. EndIf
  682. WEnd
  683. ; 1 slots items
  684. $Searching = True
  685. while $Searching
  686. $Pixel3 = PixelSearch(1400,584,1900,874,0x5a4d10 )
  687. if Not @error Then
  688. MouseClick("right", $Pixel3[0], $Pixel3[1])
  689. Sleep(500)
  690. Else
  691. $Searching = False
  692. EndIf
  693. WEnd
  694. ; more color
  695. $Searching = True
  696. while $Searching
  697. $Pixel3 = PixelSearch(1400,584,1900,874,0x5d4e10 )
  698. if Not @error Then
  699. MouseClick("right", $Pixel3[0], $Pixel3[1])
  700. Sleep(500)
  701. Else
  702. $Searching = False
  703. EndIf
  704. WEnd
  705. ; more color
  706. $Searching = True
  707. while $Searching
  708. $Pixel3 = PixelSearch(1400,584,1900,874,0x66580f )
  709. if Not @error Then
  710. MouseClick("right", $Pixel3[0], $Pixel3[1])
  711. Sleep(500)
  712. Else
  713. $Searching = False
  714. EndIf
  715. WEnd
  716. ; more color
  717. $Searching = True
  718. while $Searching
  719. $Pixel3 = PixelSearch(1400,584,1900,874,0xf5f500 )
  720. if Not @error Then
  721. MouseClick("right", $Pixel3[0], $Pixel3[1])
  722. Sleep(500)
  723. Else
  724. $Searching = False
  725. EndIf
  726. WEnd
  727. ; more color
  728. $Searching = True
  729. while $Searching
  730. $Pixel3 = PixelSearch(1400,584,1900,874,0x554914 )
  731. if Not @error Then
  732. MouseClick("right", $Pixel3[0], $Pixel3[1])
  733. Sleep(500)
  734. Else
  735. $Searching = False
  736. EndIf
  737. WEnd
  738.  
  739. ;orange
  740. ; 2 slots items
  741. $Searching = True
  742. while $Searching
  743. $Pixel3 = PixelSearch(1400,584,1900,874,0x593212 )
  744. if Not @error Then
  745. MouseClick("right", $Pixel3[0], $Pixel3[1])
  746. Sleep(500)
  747. Else
  748. $Searching = False
  749. EndIf
  750. WEnd
  751. ; 1 slots items
  752. $Searching = True
  753. while $Searching
  754. $Pixel3 = PixelSearch(1400,584,1900,874,0x693e12 )
  755. if Not @error Then
  756. MouseClick("right", $Pixel3[0], $Pixel3[1])
  757. Sleep(500)
  758. Else
  759. $Searching = False
  760. EndIf
  761. WEnd
  762. EndFunc
  763.  
  764. Func CheckDeath()
  765. $Pixel3 = PixelSearch(830,840,860,850,0xe69f4f )
  766. if Not @error Then
  767. $Pixel3 = PixelSearch(700,830,730,860,0x180000 )
  768. if Not @error Then
  769. ResumeGame()
  770. Return False
  771. EndIf
  772. EndIf
  773.  
  774. $Pixel3 = PixelSearch(830,840,860,850,0x4b4742 )
  775. if Not @error Then
  776. $Pixel3 = PixelSearch(700,830,730,860,0x060201 )
  777. if Not @error Then
  778. ResumeGame()
  779. Return False
  780. EndIf
  781. EndIf
  782. Return True
  783. EndFunc
  784.  
  785. Func CheckConnection()
  786. $Pixel3 = PixelSearch(860,417,1068,438,0xf09901 )
  787. if Not @error Then
  788. $Pixel3 = PixelSearch(900,620,920,640,0x230400 )
  789. if Not @error Then
  790. MouseClick("left", 910, 630)
  791. ResumeGame()
  792. Return False
  793. EndIf
  794. EndIf
  795. Return True
  796. EndFunc
  797.  
  798. Func ReachBlacksmith()
  799. MouseClick("left", 1800, 500)
  800. Sleep(2000)
  801. MouseClick("left", 1475, 400)
  802. Sleep(1000)
  803. MouseClick("left", 260, 300)
  804. Sleep(500)
  805. SellBlue("left")
  806. Sleep(1000)
  807. Send("{ESCAPE}")
  808. Sleep(500)
  809. MouseClick("left", 30, 280)
  810. EndFunc
  811.  
  812. Func Loading()
  813. $Pixel3 = PixelSearch(1700,168,1775,240,0x00a6ff )
  814. if Not @error Then
  815. ; pixel found = loading is over
  816. Return False
  817. EndIf
  818.  
  819. ;Still on loading screen
  820. return True
  821. EndFunc
  822.  
  823. Func ResumeGame()
  824.  
  825. ; move the mouse to be sure it's not over the pixel we're looking for
  826. MouseMove(100, 100, 1)
  827.  
  828. $Searching = True
  829. while $Searching
  830. $Pixel3 = PixelSearch(800,550,1125,610,0xf3aa55 )
  831. if Not @error Then
  832. MouseClick("left", 956, 579) ;button to leave game
  833. $Searching = False
  834. Else
  835. Send("{ESCAPE}") ;opens menu
  836. Sleep(1000)
  837. EndIf
  838. WEnd
  839.  
  840. ; check if profile screen is open
  841. $Pixel3 = PixelSearch(1565,98,1593,126,0xffd794 )
  842. if Not @error Then
  843. Send("{ESCAPE}") ;close profile
  844. EndIf
  845.  
  846. $Searching = True
  847. while $Searching
  848. $Pixel3 = PixelSearch(60,384,411,450,0x3c0700 )
  849. if Not @error Then
  850. MouseClick("left", 230, 416) ;button to resume game from main menu
  851. ;Sleep(8000)
  852. $Searching = False
  853. EndIf
  854. WEnd
  855.  
  856. while Loading()
  857. ;will get out of the loop when loading is over and resume resume the script
  858. WEnd
  859.  
  860. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement