Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;ASS(Autoit Sarkoth Script) ver 1.0
- ;WONT WORK UNLESS MOVE IS BOUND TO MIDDLE MOUSE (Mouse 3) -- NOT MOVE/INTERACT
- ;Tested With DH build: http://d3db.com/tool/calculator/demon-hunter/28088
- ;Required Max Discipline: 35
- ;Required display mode for cellar detection: "FULLSCREEN WINDOWED"
- ;Features:
- ;Selling Junks Supported
- ;Loot scanning. You can choose which quality to loot.
- ;Automatic repair on yellow status icon
- ;Automatic resolution adjustment
- ;Death check before end of every loop (teleports and leaves)
- ;Original:
- ;[Goldfarming] AFK 150k-200k Gold Per Hour by mackus101 @ ownedcore Combined with notAres' Sarkarth DH Gold Script 1.2.1 - 6/7/2012
- Global $Paused
- HotKeySet("=","TogglePause") ;script can be START and PAUSE by pressing = Also Show some statistics
- HotKeySet("x", "Stop") ;script can be Stopped by pressing x
- Global $loadtime = 3500
- Global $waittime = 3800
- Global $LForLegendary = True, $TotalLegendary = 0 ;Loot Legendary Items
- Global $LForSet = True, $TotalSet = 0 ;Loot Set Items
- Global $LForRare = True, $TotalRare = 0 ;Loot Rare Items
- Global $LForMagic = True, $TotalMagic = 0 ;Loot Magic Items
- Global $LForJunk = True, $TotalJunk = 0 ;Loot Junk Items
- Global $Runs = 0 ;for tracking Number of Runs(Do not modify it)
- Global $SellItems = True ;If you want to sell Magic and Junk Items
- Global $SelPeriod = 15 ; How many Runs before Selling Junks
- $Run = False
- $default_resolutionX = 1920
- $default_resolutionY = 1080
- $x_ratio = @Desktopwidth / $default_resolutionX
- $y_ratio = @Desktopheight / $default_resolutionY
- While True
- if($Run) Then
- CheckDead()
- ;CheckWindow()
- $Runs += 1
- Sleep(3000)
- $ArmorBox = PixelSearch(Round(1482*$x_ratio), Round(20*$y_ratio), Round(1535*$x_ratio), Round(95*$y_ratio),0xFFF000, 1, 2) ;searches top right screen for yellow of broken armor
- If Not @error Then ;Repair is needed
- Teleport()
- Sleep(100)
- Repair()
- Sleep(100)
- ResetRun()
- Else ;Repair is NOT needed
- GetToCellar()
- Sleep(400)
- $Cellar = 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
- If Not @error Then
- MouseClick("left",Round(115 *$x_ratio),Round(210 * $y_ratio)) ;Entrance to cellar
- FightSarkoth()
- Sleep(1500)
- MouseClick("left",Round(579 *$x_ratio),Round(209 * $y_ratio)) ;location of sarkoth after death
- $TotalMagic += 1 ;Counts Magic item at Sarkoth Location
- Sleep(500)
- CheckLoot()
- MouseClick("left",Round(866 *$x_ratio),Round(324 * $y_ratio)) ;moves to right top corner for gold
- Sleep(500)
- MouseClick("left",Round(902 *$x_ratio),Round(954 * $y_ratio)) ;moves to bottom middle for gold
- Sleep(800)
- MouseClick("left",Round(687 *$x_ratio),Round(413 * $y_ratio)) ;moves to left top corner for gold
- Sleep(500)
- If Not CheckDead() Then
- Teleport()
- if ($Runs/$SelPeriod == Round($Runs/$SelPeriod)) AND $SellItems Then
- SellJunk()
- EndIf
- Sleep(300)
- ResetRun()
- EndIf
- Else
- ;Sleep(800)
- MouseMove(Round(150 * $x_ratio), Round(108 * $y_ratio), 1) ;moves cursor over to the Alternate cellar Location so the proper blue pixel becomes highlighted
- Sleep(500)
- $AltCellar = PixelSearch(Round(60 * $x_ratio), Round(36 * $y_ratio), Round(180*$x_ratio), Round(160*$y_ratio),0x3B62E3,3) ;searches for the specific blue pixel
- If IsArray($AltCellar) Then
- MouseClick("left",Round(150 *$x_ratio),Round(108 * $y_ratio)) ;Entrance to cellar
- FightSarkoth()
- Sleep(1500)
- MouseClick("left",Round(579 *$x_ratio),Round(209 * $y_ratio)) ;location of sarkoth after death
- $TotalMagic += 1 ;Counts Magic item at Sarkoth Location
- Sleep(500)
- CheckLoot()
- MouseClick("left",Round(866 *$x_ratio),Round(324 * $y_ratio)) ;moves to right top corner for gold
- Sleep(500)
- MouseClick("left",Round(902 *$x_ratio),Round(954 * $y_ratio)) ;moves to bottom middle for gold
- Sleep(800)
- MouseClick("left",Round(687 *$x_ratio),Round(413 * $y_ratio)) ;moves to left top corner for gold
- Sleep(500)
- If Not CheckDead() Then
- Teleport()
- if ($Runs/$SelPeriod == Round($Runs/$SelPeriod)) AND $SellItems Then
- SellJunk()
- EndIf
- Sleep(300)
- ResetRun()
- EndIf
- Else
- MouseClick("middle", Round(1115 *$x_ratio), Round(205 * $y_ratio), 1) ;moves up screen away from cellar in attempt for safety before teleporting back to town
- Sleep(100)
- Send("1")
- Sleep(500)
- If Not CheckDead() Then
- Teleport()
- if ($Runs/$SelPeriod == Round($Runs/$SelPeriod)) AND $SellItems Then
- SellJunk()
- EndIf
- Sleep(300)
- ResetRun()
- EndIf
- EndIf
- EndIf
- EndIf
- EndIf
- WEnd
- Func CheckDead()
- $Pixeltest = PixelGetColor(Round(740*$x_ratio), Round(850*$y_ratio))
- If Hex($Pixeltest, 6) == "0C0404" OR Hex($Pixeltest, 6) == "310000" Then
- Sleep(100)
- Send("{Escape}")
- Sleep(10)
- MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
- Sleep(10000)
- Sleep($waittime)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($waittime)
- $Flag = True
- Else
- $Flag = False
- EndIf
- Return $Flag
- EndFunc
- Func CheckWindow()
- $Pixeltest2 = PixelGetColor(Round(1580*$x_ratio), Round(100*$y_ratio))
- If Hex($Pixeltest2, 6) == "653B23" 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($waittime)
- EndIf
- EndFunc
- Func CheckLoot()
- If $LForLegendary Then
- $i = 0
- While $i < 2
- Send("{LALT}")
- Sleep(200)
- $Legendary = PixelSearch(Round(756*$x_ratio), Round(360*$y_ratio), Round(1080*$x_ratio), Round(668*$y_ratio), 0xBF642F, 2, 3) ;searches main window for color of legendary lootz
- If Not @error Then
- ToolTip("Legendary Loot Has been Find",700, 450)
- Sleep(2000)
- ToolTip("")
- $TotalLegendary += 1
- if IsArray($Legendary) then
- MouseClick ('left', $Legendary[0], $Legendary[1])
- Sleep(Random(400,1200))
- EndIf
- EndIf
- $i = $i+1
- WEnd
- EndIf
- If $LForSet Then
- $i = 0
- While $i < 1
- Send("{LALT}")
- Sleep(200)
- $Set = PixelSearch(Round(756*$x_ratio), Round(360*$y_ratio), Round(1080*$x_ratio), Round(668*$y_ratio), 0x00FF00, 1, 3) ; searches main window for color of Set lootz
- If Not @error Then
- ToolTip("Set Loot Has been Find",700, 450)
- Sleep(2000)
- ToolTip("")
- $TotalSet += 1
- ToolTip("")
- if IsArray($Set) then
- MouseClick ('left', $Set[0], $Set[1])
- Sleep(Random(400,1200))
- EndIf
- EndIf
- $i = $i+1
- WEnd
- EndIf
- If $LForRare Then
- $i = 0
- While $i < 3
- Send("{LALT}")
- Sleep(200)
- $Rare = PixelSearch(Round(756*$x_ratio), Round(360*$y_ratio), Round(1080*$x_ratio), Round(668*$y_ratio), 0xFFFF00, 2, 3) ; rare lootz (also f3f45b)
- If Not @error Then
- ToolTip("Rare Loot Has been Find",700, 450)
- Sleep(1000)
- ToolTip("")
- $TotalRare += 1
- ToolTip("")
- if IsArray($Rare) then
- MouseClick ('left', $Rare[0], $Rare[1])
- Sleep(Random(400,1200))
- EndIf
- EndIf
- $i = $i+1
- WEnd
- EndIf
- If $LForMagic Then
- $i = 0
- While $i < 5
- Send("{LALT}")
- Sleep(200)
- $Magic = PixelSearch(630, 300, 900, 550, 0x6969FF, 5, 3) ; magic lootz
- If Not @error Then
- ;ToolTip("Magic Loot Has been Find",700, 450)
- Sleep(200)
- ;ToolTip("")
- $TotalMagic += 1
- if IsArray($Magic) then
- MouseClick ('left', $Magic[0], $Magic[1])
- Sleep(Random(400,1200))
- EndIf
- EndIf
- $i = $i+1
- WEnd
- EndIf
- If $LForJunk Then
- $i = 0
- While $i < 5
- Send("{LALT}")
- Sleep(200)
- $Junk = PixelSearch(Round(756*$x_ratio), Round(360*$y_ratio), Round(1080*$x_ratio), Round(668*$y_ratio), 0xFFFFFF, 3, 3) ; Junk lootz
- If Not @error Then
- ;ToolTip("Jagic Loot Has been Find",700, 450)
- Sleep(400)
- ;ToolTip("")
- $TotalJunk += 1
- if IsArray($Junk) then
- MouseClick ('left', $Junk[0], $Junk[1])
- Sleep(Random(400,1200))
- EndIf
- EndIf
- $i = $i+1
- WEnd
- EndIf
- EndFunc
- Func ResetRun()
- CheckDead()
- Send("{ESCAPE}") ;opens menu
- Sleep(100)
- MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
- Sleep($waittime)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- EndFunc
- Func Teleport()
- Send("t")
- Sleep(8000)
- EndFunc
- Func Repair()
- 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(1500)
- MouseClick("left", Round(521*$x_ratio),Round(506*$y_ratio)) ;button to open up repair menu
- Sleep(1500)
- MouseClick("left", Round(260*$x_ratio),Round(595*$y_ratio)) ;button to pay for repairs
- Sleep(100)
- Send("{ESCAPE}") ;closes repair tab
- EndFunc
- Func SellJunk()
- $left = 1854*$x_ratio
- $right = 1882.8*$x_ratio
- 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(1500)
- For $j = 1 To 10
- $top = 836.4*$y_ratio
- $bottom = 861.6*$y_ratio
- For $k = 1 To 6
- ;MouseMove($left, $top, 1)
- $JunkItem = PixelSearch($left, $top, $right, $bottom, 0x130B08, 1, 2) ;search Inventory for Junk Items to sell
- If Not @error Then
- if IsArray($JunkItem) then
- MouseClick ('right', $JunkItem[0], $JunkItem[1], 1)
- EndIf
- EndIf
- Sleep(200)
- $RareItem = PixelSearch($left, $top, $right, $bottom, 0x11213A, 5, 2) ;search Inventory for Magic Items to sell
- If Not @error Then
- if IsArray($RareItem) then
- MouseClick ('right', $RareItem[0], $RareItem[1], 1)
- EndIf
- EndIf
- $top -= 40
- $bottom -= 40
- Next
- $left -= 40
- $right -= 40
- Next
- Sleep(100)
- Send("{SPACE}") ;closes Merchant Window
- EndFunc
- Func GetToCellar()
- MouseClick("middle", 587 * $x_ratio,335* $y_ratio) ;starts the main run
- Sleep(1500)
- Send("2") ;Smoke Screen
- MouseClick("middle", 96 * $x_ratio,383 * $y_ratio)
- Sleep(800)
- Send("1")
- Sleep(1200)
- MouseClick("middle", Round(417 * $x_ratio),Round(422 * $y_ratio)) ;middle of area outside of cellar
- Sleep(100)
- Send("1")
- Sleep(1500)
- Send("3") ;Caltrops
- Sleep(100)
- Send("2") ;Smoke Screen
- MouseMove(Round(115 * $x_ratio),Round(210 * $y_ratio),1) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
- EndFunc
- Func FightSarkoth()
- Sleep(4500)
- Send(2)
- Sleep(100)
- MouseClick("left",Round(531 *$x_ratio),Round(769 * $y_ratio))
- Sleep(600)
- 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}")
- EndFunc
- Func TogglePause()
- $Run = Not $Run
- While Not $Run
- Sleep(100)
- ToolTip("So far "&$Runs&" Runs: "&$TotalLegendary&" Legendaries, "&$TotalSet&" Sets, "&$TotalRare&" Rares, "&$TotalMagic&" Magic, "&$TotalJunk&" Junks Looted",700, 450)
- WEnd
- ToolTip("")
- EndFunc ;==>TogglePause
- Func Stop() ;to allow the script to stop
- Exit 0
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment