Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;notAres' Sarkarth DH Gold Script 1.2.5 - 6/7/2012 - Improved death detection and escape usage to avoid any extra pushes. Improved cellar waypoint so ferrets do not auto-attack, fine tuned the DPS from there.
- ;Please notice I changed some variable names around and added a variable for teleport time. $waittime is now appropriately named $loadtime.
- ;WONT WORK UNLESS MOVE IS BOUND TO MIDDLE MOUSE (Mouse 3) -- NOT MOVE/INTERACT
- ;Required build: http://us.battle.net/d3/en/calculator/demon-hunter#aRYXVT!aTW!YcaZbY
- ;Required movement speed: 25% (10% boots + 15% passive 'Hot Pursuit')
- ;Required display mode for cellar detection: "FULLSCREEN WINDOWED"
- ;Official supported resolution: 1920x1080
- ;;;;;
- ;Features:
- ;Loot scanning. Will only pick up rare/legendary/set pieces [IMPROVED]
- ;Randomized aiming coordinates (but still static path)
- ;Randomized pickup timers for variation in runs
- ;Automatic repair on yellow status icon
- ;Automatic resolution adjustment (16:9 only) [BUGGY - need someone to tweak coords]
- ;Death check
- ;Open window check (in rare case it gets stuck in menu)
- ;;;;;
- ;Original:
- ;[Goldfarming] AFK 150k-200k Gold Per Hour by mackus101 @ ownedcore
- ;;;;;
- Global $Paused
- HotKeySet("=","Leave") ;script started by pressing =
- HotKeySet("-", "Pause") ;script paused by pressing -
- HotKeySet("x", "Stop") ;script stopped by pressing x
- $walktime = 6000; time in ms the script waits for you to enter and load the cellar. Slow this down for slower move speeds and loading times
- $loadtime = 6000 ; time in ms the script waits for the game to load before it starts pathfinding. Slow this down for slower hard drives
- $tptime = 8200 ; time in ms the script waits for teleport before exiting the game
- $yellow = "0x1E2B45" ; yellow color code it detects @ pixel 1520x40, tweak this if it's not detecting correctly
- $red = "0xDB0000" ; red color code
- $go = True
- $Leave = False
- $NeedRepair = False
- $Dead = False
- $default_resolutionX = 1920
- $default_resolutionY = 1080
- $x_ratio = @Desktopwidth / $default_resolutionX
- $y_ratio = @Desktopheight / $default_resolutionY
- While $go
- if($Leave) Then
- Call("CheckDead")
- Call("CheckWindow")
- Call("CheckLogout")
- Call("CheckRepair")
- $i = 0
- MouseClick("left", Round(587 * $x_ratio),Round(333 * $y_ratio)) ;starts the main run
- Sleep(1800)
- Send("2")
- MouseClick("left", Round(96 * $x_ratio),Round(383 * $y_ratio))
- Sleep(800)
- Send("1")
- Sleep(1500)
- MouseClick("left", Round(417 * $x_ratio),Round(422 * $y_ratio)) ;middle of area outside of cellar
- Sleep(2000)
- Send("3")
- MouseMove(Round(115 * $x_ratio),Round(210 * $y_ratio),1) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
- Sleep(1000)
- Call("CheckDead")
- Call("CheckWindow")
- $Pixel2 = PixelSearch(0,0, Round(600*$x_ratio), Round(600*$y_ratio),0x334FB7,3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be)
- If Not @error Then
- MouseClick("left",Round(115 *$x_ratio),Round(210 * $y_ratio)) ;Entrance to cellar
- Sleep($loadtime)
- MouseClick("left",Round(531 *$x_ratio),Round(769 * $y_ratio))
- Sleep(2000)
- MouseClick("left",Round(547 *$x_ratio),Round(490 * $y_ratio)) ;moves to doorway leading to rare inside cellar
- Sleep(1500)
- MouseMove(Round(579 * $x_ratio),Round(209 * $y_ratio),1) ;hovers over the rare Sarkoth
- Send(4)
- Sleep(1000)
- Send("{SHIFTDOWN}")
- MouseDown("right") ;attack middle
- Sleep(3800)
- MouseMove(Round(467 * $x_ratio),Round(269 * $y_ratio),1) ;attack left, add more sleep time if you can't kill minion on left
- Sleep(3000)
- MouseMove(Round(682 * $x_ratio),Round(147 * $y_ratio),1) ;attack right
- Sleep(800)
- MouseMove(Round(579 * $x_ratio),Round(209 * $y_ratio),1) ;move back to middle
- Sleep(1000)
- MouseUP("right")
- Sleep(300)
- Send("{SHIFTUP}")
- Call("CheckDead")
- Call("CheckWindow")
- Sleep(400)
- MouseClick("middle",Round(600 *$x_ratio),Round(223 * $y_ratio)) ;location of sarkoth after death
- Sleep(2500)
- MouseClick("middle",Round(866 *$x_ratio),Round(324 * $y_ratio)) ;moves to right top corner for gold
- Sleep(1500)
- MouseClick("middle",Round(902 *$x_ratio),Round(954 * $y_ratio)) ;moves to bottom middle for gold
- Sleep(1500)
- MouseClick("middle",Round(687 *$x_ratio),Round(413 * $y_ratio)) ;moves to left top corner for gold
- Sleep(1500)
- Call("CheckLoot")
- Send("t")
- Sleep($tptime)
- Call("CheckDead")
- Call("CheckWindow")
- If Not $Dead Then
- Send("{ESCAPE}") ;menu
- Sleep(200)
- MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
- Sleep($loadtime)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- EndIf
- Else
- Sleep(100)
- MouseClick("middle",Round(1100*$x_ratio),Round(600*$y_ratio)) ;moves between caltrops for safety before teleporting back to town
- Sleep(200)
- Send("t")
- Sleep($tptime)
- Call("CheckDead")
- Call("CheckWindow")
- If Not $Dead Then
- Send("{ESCAPE}") ;menu
- Sleep(200)
- MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
- Sleep($loadtime)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- EndIf
- EndIf
- EndIf
- WEnd
- Func CheckDead()
- Call("CheckWindow")
- $Pixeltest = PixelGetColor(549, 569)
- $Pixeltest2 = PixelGetColor(515, 561)
- $Pixeltest3 = PixelGetColor(524, 558)
- If Hex($Pixeltest, 6) == "0x2E2D42" OR Hex($Pixeltest, 6) == "0x352C43" Then
- If Not $Window Then
- $Dead = True
- Sleep(100)
- Send("{Escape}")
- Sleep(10)
- MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
- Sleep(12500)
- Sleep($loadtime)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- ElseIf $Window Then
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- $Window = False
- EndIf
- ElseIf Hex($Pixeltest2, 6) == "0x080B12" OR Hex($Pixeltest3, 6) == "0x121015" Then
- Sleep(10000)
- If Not $Window Then
- $Dead = True
- Sleep($loadtime)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- ElseIf $Window Then
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- $Window = False
- EndIf
- Else
- $Dead = False
- EndIf
- EndFunc
- Func CheckWindow()
- $Pixeltest2 = PixelGetColor(Round(1580*$x_ratio), Round(100*$y_ratio))
- If Hex($Pixeltest2, 6) == "0x653B23" Then
- Sleep(20)
- MouseClick("left", Round(1580*$x_ratio), Round(100*$y_ratio)) ;close the open window
- Sleep(20)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- EndIf
- EndFunc
- Func CheckLogout()
- $Pixeltest3 = PixelGetColor(Round(960*$x_ratio), Round(290*$y_ratio))
- If Hex($Pixeltest3, 6) == "0x400400" Then
- Sleep(9000)
- Sleep($loadtime)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- EndIf
- EndFunc
- Func CheckRepair()
- $RepairArea = PixelSearch(1010, 22, 1015, 28, $yellow)
- If Not @error Then
- Call("DoRepair")
- EndIf
- $RepairAreaRed = PixelSearch(1010, 22, 1015, 28, $red)
- If Not @error Then
- Call("DoRepair")
- EndIf
- EndFunc
- Func DoRepair()
- Send("t")
- Sleep($tptime)
- MouseClick("left", Round(1480*$x_ratio),Round(281*$y_ratio)) ;begin movement towards merchant
- Sleep(1500)
- MouseClick("left", Round(1316*$x_ratio),Round(206*$y_ratio)) ;moves to get merchant in screen
- Sleep(1500)
- MouseClick("left", Round(845*$x_ratio),Round(225*$y_ratio)) ;NPC Merchant to the right of cain's home
- Sleep(1200)
- MouseClick("left", Round(521*$x_ratio),Round(506*$y_ratio)) ;button to open up repair menu
- Sleep(400)
- MouseClick("left", Round(260*$x_ratio),Round(595*$y_ratio)) ;button to pay for repairs
- Sleep(100)
- Call("CheckDead")
- Call("CheckWindow")
- If Not $Dead Then
- Send("{ESCAPE}") ;closes repair tab
- Sleep(100)
- Send("{ESCAPE}") ;menu
- Sleep(10)
- MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
- Sleep($loadtime)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- EndIf
- EndFunc
- Func CheckLoot()
- Sleep(Random(1200,3200))
- $Pixel4 = PixelSearch(Round(270*$x_ratio), 0, Round(1490*$x_ratio), Round(900*$y_ratio), 0xBF642F, 1) ;searches main window for color of legendary lootz
- If Not @error Then
- MouseClick ('left', $Pixel4[0], $Pixel4[1])
- Sleep(Random(800,1200))
- $i+= 1
- If $i > 8 Then
- Call("CheckLoot")
- EndIf
- EndIf
- $Pixel5 = PixelSearch(Round(270*$x_ratio), 0, Round(1490*$x_ratio), Round(900*$y_ratio), 0xFFFF00) ; rare lootz (also f3f45b)
- If Not @error Then
- MouseClick ('left', $Pixel5[0], $Pixel5[1])
- Sleep(Random(800,1800))
- $i+= 1
- If $i > 8 Then
- Call("CheckLoot")
- EndIf
- EndIf
- $Pixel6 = PixelSearch(Round(270*$x_ratio), 0, Round(1490*$x_ratio), Round(900*$y_ratio), 0x00FF00) ; set lootz
- If Not @error Then
- MouseClick ('left', $Pixel6[0], $Pixel6[1])
- Sleep(Random(800,1200))
- $i+= 1
- If $i > 8 Then
- Call("CheckLoot")
- EndIf
- EndIf
- EndFunc
- Func Pause()
- $Leave = False
- EndFunc
- Func Stop() ;to allow the script to stop
- Exit
- EndFunc
- Func Leave()
- $Leave = True
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement