Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Opt('MouseCoordMode', 0)
- Opt('PixelCoordMode', 0)
- HotKeySet('{END}', 'Quit')
- HotKeySet('{SPACE}', 'Pause')
- Global $Paused
- Global $Picked = False
- Global $DebugOn = True
- Global $Run = 1
- Global $CountSell = 0
- Global $selltime = 100
- $LootRares = True ; Change this to false if you don't want the bot to pick up rares (good for legendary/set only, recommend setting LootGems to False)
- $LootGems = False ; Change this to true if you want to pick up gems (messy, can fill up bag with whites/blues)
- $LootMagic = True
- $BluesPickedUp = 0
- $MaxBluesBeforeSell = 10
- $Amethyst = 0xB06DF6
- $Ruby = 0xFF6A75
- $Emerald = 0x95FF62
- $Topaz = 0xFFFF82
- $i = 0
- $selltime = 100
- ;$j = 0
- ;Global $ItemColors[5] = ["0xFFFF00", "0x6969FF", "0xBF642F", "0x00FF00", "0xFFFFFF"]
- ;FFFFFF-white
- ;FFFF00-yellow
- ;6969FF-blue
- ;0xBF642F-legendary
- ;0x00FF00-green set
- $walktime = 2600 ; time in ms the script waits for you to enter and load the cellar. Slow this down for slower move speeds and loading times
- $tptime = 6900 ; time in ms the script waits for teleport before exiting the game
- $loadtime = 3200 ; time in ms the script waits for the game to load before it starts pathfinding. Slow this down for slower hard drives
- ;bot starts paused. press space to start.
- Pause()
- WinActivate('Diablo III')
- Call("Route")
- Func Route()
- DEBUG("starting")
- ;$Run+= 1
- DEBUG($Run)
- If WinActive('Diablo III') Then
- ;start
- Sleep(9000)
- ;Click(134, 255) ;resume
- MouseClick('left',134, 255,1,0)
- ;MouseMove(330, 338) ;moves cursor over to the window so the proper red pixel becomes highlighted
- ;$Pixel3 = PixelSearch(310,348, 700, 300, 0x2B0E0C, 1)
- ;If Not @error Then
- ;Sleep(2000)
- ;MouseClick("left", 400, 380)
- ;Debug("Waiting 10 minutes and trying again.")
- ;Sleep(60000)
- ;Debug("Waiting 9 minutes and trying again.")
- ;Sleep(60000)
- ;Debug("Waiting 8 minutes and trying again.")
- ;Sleep(60000)
- ;Debug("Waiting 7 minutes and trying again.")
- ;Sleep(60000)
- ;Debug("Waiting 6 minutes and trying again.")
- ;Sleep(60000)
- ;Debug("Waiting 5 minutes and trying again.")
- ;Sleep(60000)
- ;Debug("Waiting 4 minutes and trying again.")
- ;Sleep(60000)
- ;Debug("Waiting 3 minutes and trying again.")
- ;Sleep(60000)
- ;Debug("Waiting 2 minutes and trying again.")
- ;Sleep(60000)
- ;Debug("Waiting 1 minute and trying again.")
- ;Sleep(60000)
- ;Else
- Sleep(5500) ;load
- If Mod($Run, 20) = 0 Then
- Call("GoSell")
- EndIf
- $repair = PixelSearch(569,39,597,84,0xFFF000) ;searches top right screen for yellow of broken armor
- If Not @error Then
- DEBUG("Going to repair")
- Send("t")
- Sleep($tptime)
- Call("CheckDead")
- Sleep(40)
- MouseClick("left", 710, 40) ;begin movement towards merchant
- Sleep(2400)
- MouseClick("left", 480, 140) ;NPC Merchant to the right of cain's home
- Sleep(3000)
- Call("Sell")
- Sleep(3000)
- MouseClick("left", 280, 275) ;button to open up repair menu
- Sleep(1500)
- MouseClick("left", 140, 330) ;button to pay for repairs
- Sleep(1500)
- Send("{ESC}") ;opens menu
- Sleep(1000)
- Send("{ESC}") ;opens menu
- Sleep(1000)
- MouseClick("left", 400, 350) ;button to leave game
- Sleep(2400)
- Call("Route")
- Else
- ;route start
- If $CountSell >= 20 Then
- $CountSell = 0
- Send("t")
- Sleep(8000)
- MouseClick("left", 710, 40) ;begin movement towards merchant
- Sleep(2400)
- MouseClick("left", 480, 140) ;NPC Merchant to the right of cain's home
- Sleep(3000)
- Call("Sell")
- Sleep(3000)
- MouseClick("left", 280, 275) ;button to open up repair menu
- Sleep(1500)
- MouseClick("left", 140, 330) ;button to pay for repairs
- Sleep(1500)
- Send("{ESC}") ;opens menu
- Sleep(1000)
- Send("{ESC}") ;opens menu
- Sleep(1000)
- MouseClick("left", 400, 350) ;button to leave game
- Sleep(2400)
- Call("Route")
- EndIf
- $CountSell = $CountSell + 1
- MouseClick("middle", 110, 145) ;starts the run [waypoint 1]
- Sleep(900)
- Send("2")
- Sleep(300)
- MouseClick("middle", 10, 320) ;waits ~1 second then [waypoint 2]
- Sleep(1400)
- MouseClick("middle", 10, 320) ;middle of courtyard [waypoint 3]
- Sleep(1400)
- MouseClick("middle", 170, 215) ;near cellar entrance[waypoint 4]
- Sleep(40)
- Send("2")
- Sleep(20)
- Send("3")
- Sleep(600)
- Send("1")
- Sleep(300)
- Call("CheckDead")
- Sleep(100)
- MouseMove(205, 135, 1) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
- Sleep(1000)
- $Pixel2 = PixelSearch(0,0, 702, 302, 0x63A8EE, 3) ;checks for open cellar (in a 700x300 box from the top left - where it should always be)
- If Not @error Then
- MouseClick("left", 205, 135) ;Entrance to cellar
- Sleep(3000)
- MouseClick("middle", 10, 500) ;moves to doorway leading to rare inside cellar
- Sleep(1100)
- MouseClick("middle", 290, 270) ;moves to doorway leading to rare inside cellar
- Sleep(800)
- MouseMove(225, 140, 1) ;hovers over the rare Sarkoth
- Call("CheckDead")
- Sleep(10)
- Send("4")
- Send("{SHIFTDOWN}")
- MouseDown("left") ;attack middle
- Sleep(8000)
- MouseUp("left")
- MouseDown("right")
- Sleep(4000)
- MouseUp("right")
- MouseMove(80, 160, 1) ;attack left
- Sleep(40)
- MouseDown("right")
- Sleep(2800)
- MouseUp("right")
- MouseMove(280, 90, 1) ;attack right
- MouseDown("right")
- Sleep(1800)
- MouseUp("right")
- Send("{SHIFTUP}")
- Sleep(400)
- Send("4")
- Sleep(10)
- MouseClick("middle", 210, 190) ;location of sarkoth after death
- Sleep(5000)
- Call("CheckDead")
- Debug("Checkloot")
- Call("CheckLoot")
- Send("4")
- Sleep(1000)
- Send("t")
- $Run+= 1
- Sleep($tptime)
- Else
- DEBUG("starting here")
- Sleep(10)
- MouseClick("middle", 460, 380) ;moves between caltrops for safety before teleporting back to town
- Sleep(200)
- Send("1")
- Sleep(620)
- Send("2")
- Sleep(40)
- Send("t")
- Sleep($tptime)
- EndIf
- EndIf
- ;route end
- DEBUG("quitting")
- Sleep(40)
- Send("{ESC}") ;opens menu
- Sleep(1000)
- MouseClick("left", 400, 350) ;button to leave game
- $Picked = True
- Sleep(5000)
- Call("Route")
- EndIf
- EndFunc
- Func Move($x, $y)
- If Not $Picked Then
- FindItems()
- EndIf
- If Not $Picked Then
- ;MouseClick('middle', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
- MouseClick('middle',$x,$y,1,0)
- ;Sleep(Random(2000, 2500))
- Sleep(2000)
- EndIf
- EndFunc ;==>Move
- Func Click($x, $y)
- If Not $Picked Then
- FindItems()
- EndIf
- If Not $Picked Then
- ;MouseClick('left', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
- MouseClick('left',$x,$y,1,0)
- ;Sleep(Random(1000, 1500))
- Sleep(1000)
- EndIf
- EndFunc ;==>Click
- Func Shoot($x, $y)
- If Not $Picked Then
- FindItems()
- EndIf
- If Not $Picked Then
- ;MouseClick('right', Random($x - 2, $x + 2), Random($y - 2, $y + 2), 1, 0)
- MouseClick('right',$x,$y,1,0)
- ;Sleep(Random(550, 700))
- Sleep(550)
- EndIf
- EndFunc ;==>Shoot
- Func CheckDead()
- Sleep(500)
- ;Local $dead = PixelSearch(200, 190, 240, 230, 0xFFFFFF, 2)
- Local $dead = PixelSearch(220, 210, 221, 211, 0xFFFFFF, 1)
- If Not @error Then
- DEBUG("U Died Bro")
- Send("{ESC}")
- MouseClick('left', 400, 350)
- Sleep(13000)
- Call("Route")
- EndIf
- EndFunc
- Func CheckLoot()
- ;send("{ALTDOWN}")
- Sleep(Random(500,2000))
- send("{ALT}")
- $SL = PixelSearch(366, 294, 456,346, 0x00FF00, 8) ; set loot
- If Not @error Then
- MouseClick ('left', $SL[0], $SL[1])
- Debug("Set")
- Sleep(Random(800,1200))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- ;send("{ALT}")
- $LL = PixelSearch(366, 294, 456,346, 0xBF642F, 2) ; legendary loot
- If Not @error Then
- MouseClick ('left', $LL[0], $LL[1])
- Debug("Set")
- Sleep(Random(800,1200))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- send("{ALT}")
- If $LootRares Then
- $RL = PixelSearch(366, 294, 456,346, 0xFFFF00, 2) ; rare loot (darker for compatibility)
- If Not @error Then
- MouseClick ('left', $RL[0], $RL[1])
- Debug("Rare")
- Sleep(Random(700,900))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- EndIf
- send("{ALT}")
- If $LootRares Then
- $ML = PixelSearch(366, 294, 456,346, 0x6969FF, 2) ; magic loot
- If Not @error Then
- MouseClick ('left', $ML[0], $ML[1])
- Debug("Magic")
- Sleep(Random(700,900))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- EndIf
- send("{ALTUP}")
- ;original ;send("{ALT}")
- ; $SetLoot = PixelSearch(150, 200, 700,400, 0x02CE01, 8) ; set loot
- ; If Not @error Then
- ; MouseClick ('left', $SetLoot[0], $SetLoot[1])
- ; Debug("Set")
- ; Sleep(Random(800,1200))
- ; $i+= 1
- ; If $i <= 8 Then
- ; EndIf
- ; EndIf
- ; $LegendaryLoot= PixelSearch(150, 200, 700,400, 0xAC5B2C, 8) ; legendary loot
- ; If Not @error Then
- ; MouseClick ('left', $LegendaryLoot[0], $LegendaryLoot[1])
- ; Debug("Legendary")
- ; Sleep(Random(800,1200))
- ; $i+= 1
- ; If $i <= 8 Then
- ; EndIf
- ; EndIf
- ; If $LootRares Then
- ; $RareLoot = PixelSearch(150, 200, 700,400, 0xBBBB00, 2) ; rare loot (darker for compatibility)
- ; If Not @error Then
- ; MouseClick ('left', $RareLoot[0], $RareLoot[1])
- ; Debug("Rare")
- ; Sleep(Random(700,900))
- ; $i+= 1
- ; If $i <= 8 Then
- ; EndIf
- ; EndIf
- ; EndIf
- ;end of original
- send("{ALT}")
- $SetLoot = PixelSearch(700, 400, 150,200, 0x00FF00, 8) ; set loot
- If Not @error Then
- MouseClick ('left', $SetLoot[0], $SetLoot[1])
- Debug("Set")
- Sleep(Random(800,1200))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- $SetLoot = PixelSearch(150, 200, 700,400, 0x00FF00, 8) ; set loot
- If Not @error Then
- MouseClick ('left', $SetLoot[0], $SetLoot[1])
- Debug("Set")
- Sleep(Random(800,1200))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- send("{ALT}")
- $LegendaryLoot= PixelSearch(700, 400, 150,200, 0xBF642F, 2) ; legendary loot
- If Not @error Then
- MouseClick ('left', $LegendaryLoot[0], $LegendaryLoot[1])
- Debug("Legendary")
- Sleep(Random(800,1200))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- $LegendaryLoot= PixelSearch(150, 200, 700,400, 0xBF642F, 2) ; legendary loot
- If Not @error Then
- MouseClick ('left', $LegendaryLoot[0], $LegendaryLoot[1])
- Debug("Legendary")
- Sleep(Random(800,1200))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- send("{ALT}")
- If $LootRares Then
- $RareLoot = PixelSearch(700, 400, 150,200, 0xFFFF00, 2) ; rare loot (darker for compatibility)
- If Not @error Then
- MouseClick ('left', $RareLoot[0], $RareLoot[1])
- Debug("Rare")
- Sleep(Random(700,900))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- EndIf
- If $LootRares Then
- $RareLoot = PixelSearch(150, 200, 700,400, 0xFFFF00, 2) ; rare loot (darker for compatibility)
- If Not @error Then
- MouseClick ('left', $RareLoot[0], $RareLoot[1])
- Debug("Rare")
- Sleep(Random(700,900))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- EndIf
- If $LootRares Then
- $MagicLoot = PixelSearch(700, 400, 150,200, 0x6969FF, 2) ; magic loot
- If Not @error Then
- MouseClick ('left', $MagicLoot[0], $MagicLoot[1])
- Debug("Magic")
- Sleep(Random(700,900))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- EndIf
- If $LootRares Then
- $MagicLoot = PixelSearch(700, 400, 150,200, 0x6969FF, 2) ; magic loot
- If Not @error Then
- MouseClick ('left', $MagicLoot[0], $MagicLoot[1])
- Debug("Magic")
- Sleep(Random(700,900))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- EndIf
- If $LootRares Then
- $MagicLoot = PixelSearch(150, 200, 700,400, 0x6969FF, 2) ; magic loot
- If Not @error Then
- MouseClick ('left', $MagicLoot[0], $MagicLoot[1])
- Debug("Magic")
- Sleep(Random(700,900))
- $i+= 1
- If $i <= 8 Then
- EndIf
- EndIf
- EndIf
- ;send("{ALT}")
- ;If $LootRares Then
- ; $WhiteLoot = PixelSearch(700, 400, 150,200, 0xFFFFFF, 2) ; White loot
- ; If Not @error Then
- ; MouseClick ('left', $WhiteLoot[0], $WhiteLoot[1])
- ; Debug("White")
- ; Sleep(Random(700,900))
- ; $i+= 1
- ; If $i <= 8 Then
- ; EndIf
- ; EndIf
- ; EndIf
- ;If $LootRares Then
- ; $WhiteLoot = PixelSearch(150, 200, 700,400, 0xFFFFFF, 2) ; White loot
- ; If Not @error Then
- ; MouseClick ('left', $WhiteLoot[0], $WhiteLoot[1])
- ; Debug("White")
- ; Sleep(Random(700,900))
- ; $i+= 1
- ; If $i <= 8 Then
- ; EndIf
- ; EndIf
- ; EndIf
- EndFunc
- Func CheckGems()
- If $LootGems Then
- $AmethystDrop = PixelSearch(150, 200, 700,700, $Amethyst,8)
- If Not @error Then
- MouseClick("left", $AmethystDrop[0], $AmethystDrop[1])
- Debug("Amethyst")
- Sleep(Random(900,1400))
- $i+= 1
- If $i <= 10 Then
- EndIf
- EndIf
- $RubyDrop = PixelSearch(150, 200, 700,400, $Ruby,10)
- If Not @error Then
- MouseClick("left", $RubyDrop[0], $RubyDrop[1])
- Debug("Ruby")
- Sleep(Random(900,1400))
- $i+= 1
- If $i <= 10 Then
- EndIf
- EndIf
- $EmeraldDrop = PixelSearch(150, 200, 700,400, $Emerald,20)
- If Not @error Then
- MouseClick("left", $EmeraldDrop[0], $EmeraldDrop[1])
- Debug("Emerald")
- Sleep(Random(900,1400))
- $i+= 1
- If $i <= 10 Then
- EndIf
- EndIf
- $TopazDrop = PixelSearch(150, 200, 700,400, $Topaz,20)
- If Not @error Then ; change to 'If Not @error Then' if you want to search for topazes
- MouseClick("left", $TopazDrop[0], $TopazDrop[1])
- Debug("Topaz")
- Sleep(Random(900,1400))
- $i+= 1
- If $i <= 10 Then
- EndIf
- EndIf
- EndIf
- EndFunc
- Func RandomSleep()
- If $Timer And Random(1,20) = 20 Then
- Sleep(Random(30000,60000)
- EndIf
- EndFunc
- Func Quit()
- Exit
- EndFunc ;==>Quit
- Func Pause()
- $Paused = Not $Paused
- While $Paused
- Sleep(100)
- ToolTip('Paused...', 0, 0)
- WEnd
- ToolTip("")
- EndFunc ;==>Pause
- Func DEBUG($MESSAGE)
- If $DebugOn Then
- ToolTip($MESSAGE, 0, 0)
- EndIf
- EndFunc ;==>Debug Info
- Func GoSell()
- DEBUG("Going to sell")
- $Run+= 1
- Send("t")
- Sleep(8000)
- MouseClick("left", 710, 40) ;begin movement towards merchant
- Sleep(2400)
- MouseClick("left", 480, 140) ;NPC Merchant to the right of cain's home
- Sleep(3000)
- Call("Sell")
- Sleep(3000)
- MouseClick("left", 280, 275) ;button to open up repair menu
- Sleep(1500)
- MouseClick("left", 140, 330) ;button to pay for repairs
- Sleep(1500)
- Send("{ESC}") ;opens menu
- Sleep(1000)
- Send("{ESC}") ;opens menu
- Sleep(1000)
- MouseClick("left", 400, 350) ;button to leave game
- Sleep(2400)
- Call("Route")
- EndFunc
- Func Sell()
- ;sell first column
- ;MouseClick ("right", 538, 370) ;row 1
- ;Sleep($selltime)
- ;MouseClick ("right", 538, 395) ;row 2
- ;Sleep($selltime)
- ;MouseClick ("right", 538, 423) ;row 3
- ;Sleep($selltime)
- ;MouseClick ("right", 538, 448) ;row 4
- ;Sleep($selltime)
- ;MouseClick ("right", 538, 475) ;row 5
- ;Sleep($selltime)
- ;MouseClick ("right", 538, 501) ;row 6
- ;Sleep($selltime)
- ;this part may be for future development to cut out tons of lines
- ;now sell the other 9 columns
- ;$j = 0
- ;while $j < 10
- ;$j += 1
- ;sell column 2
- MouseClick ("right", 565, 370) ;row 1
- Sleep($selltime)
- MouseClick ("right", 565, 395) ;row 2
- Sleep($selltime)
- MouseClick ("right", 565, 423) ;row 3
- Sleep($selltime)
- MouseClick ("right", 565, 448) ;row 4
- Sleep($selltime)
- MouseClick ("right", 565, 475) ;row 5
- Sleep($selltime)
- MouseClick ("right", 565, 501) ;row 6
- Sleep($selltime)
- ;sell column 3
- MouseClick ("right", 592, 370) ;row 1
- Sleep($selltime)
- MouseClick ("right", 592, 395) ;row 2
- Sleep($selltime)
- MouseClick ("right", 592, 423) ;row 3
- Sleep($selltime)
- MouseClick ("right", 592, 448) ;row 4
- Sleep($selltime)
- MouseClick ("right", 592, 475) ;row 5
- Sleep($selltime)
- MouseClick ("right", 592, 501) ;row 6
- Sleep($selltime)
- ;sell column 4
- MouseClick ("right", 619, 370) ;row 1
- Sleep($selltime)
- MouseClick ("right", 619, 395) ;row 2
- Sleep($selltime)
- MouseClick ("right", 619, 423) ;row 3
- Sleep($selltime)
- MouseClick ("right", 619, 448) ;row 4
- Sleep($selltime)
- MouseClick ("right", 619, 475) ;row 5
- Sleep($selltime)
- MouseClick ("right", 619, 501) ;row 6
- Sleep($selltime)
- ;sell column 5
- MouseClick ("right", 646, 370) ;row 1
- Sleep($selltime)
- MouseClick ("right", 646, 395) ;row 2
- Sleep($selltime)
- MouseClick ("right", 646, 423) ;row 3
- Sleep($selltime)
- MouseClick ("right", 646, 448) ;row 4
- Sleep($selltime)
- MouseClick ("right", 646, 475) ;row 5
- Sleep($selltime)
- MouseClick ("right", 646, 501) ;row 6
- Sleep($selltime)
- ;sell column 6
- MouseClick ("right", 673, 370) ;row 1
- Sleep($selltime)
- MouseClick ("right", 673, 395) ;row 2
- Sleep($selltime)
- MouseClick ("right", 673, 423) ;row 3
- Sleep($selltime)
- MouseClick ("right", 673, 448) ;row 4
- Sleep($selltime)
- MouseClick ("right", 673, 475) ;row 5
- Sleep($selltime)
- MouseClick ("right", 673, 501) ;row 6
- Sleep($selltime)
- ;sell column 7
- MouseClick ("right", 700, 370) ;row 1
- Sleep($selltime)
- MouseClick ("right", 700, 395) ;row 2
- Sleep($selltime)
- MouseClick ("right", 700, 423) ;row 3
- Sleep($selltime)
- MouseClick ("right", 700, 448) ;row 4
- Sleep($selltime)
- MouseClick ("right", 700, 475) ;row 5
- Sleep($selltime)
- MouseClick ("right", 700, 501) ;row 6
- Sleep($selltime)
- ;sell column 8
- MouseClick ("right", 727, 370) ;row 1
- Sleep($selltime)
- MouseClick ("right", 727, 395) ;row 2
- Sleep($selltime)
- MouseClick ("right", 727, 423) ;row 3
- Sleep($selltime)
- MouseClick ("right", 727, 448) ;row 4
- Sleep($selltime)
- MouseClick ("right", 727, 475) ;row 5
- Sleep($selltime)
- MouseClick ("right", 727, 501) ;row 6
- Sleep($selltime)
- ;sell column 9
- MouseClick ("right", 754, 370) ;row 1
- Sleep($selltime)
- MouseClick ("right", 754, 395) ;row 2
- Sleep($selltime)
- MouseClick ("right", 754, 423) ;row 3
- Sleep($selltime)
- MouseClick ("right", 754, 448) ;row 4
- Sleep($selltime)
- MouseClick ("right", 754, 475) ;row 5
- Sleep($selltime)
- MouseClick ("right", 754, 501) ;row 6
- Sleep($selltime)
- ;sell column 10
- MouseClick ("right", 781, 370) ;row 1
- Sleep($selltime)
- MouseClick ("right", 781, 395) ;row 2
- Sleep($selltime)
- MouseClick ("right", 781, 423) ;row 3
- Sleep($selltime)
- MouseClick ("right", 781, 448) ;row 4
- Sleep($selltime)
- MouseClick ("right", 781, 475) ;row 5
- Sleep($selltime)
- MouseClick ("right", 781, 501) ;row 6
- Sleep($selltime)
- ;WEnd
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement