Code:
Opt('MouseCoordMode', 0)Opt('PixelCoordMode', 0)
Opt('SendKeyDelay', 50); Default speed
HotKeySet('{END}', 'Quit')
HotKeySet('{F10}', 'Pause')
Global $Paused
Global $DebugOn = True
$Amethyst = 0xA56DF1
$Ruby = 0xFA8078
$Emerald = 0x51965B
$Topaz = 0xFFFF59
$Left = 64
$Top = 42
$Right = 720
$Bottom = 519
$Color = 0xFFFF00 ;rare color code
$Color2 = 0x6969FF ;blue color code
$Color3 = 0xBF642F ;legendary color code
$Color4 = 0x00FF00 ;SET color
;bot starts paused. press space to start.
Pause()
WinActivate('Diablo III')
While 1
If WinActive('Diablo III') Then
;start
checkResume()
Sleep(500)
Click(134, 255) ;resume
Sleep(6000) ;load
$repair = PixelSearch(569,39,597,84,0xFFF000) ;searches top right screen for yellow of broken armor
If(Not @error ) Or (CheckInv() == 1) Then
InvRepair()
Else
Send('3')
Sleep(40)
Teleport()
Sleep(40)
Send('1')
Sleep(40)
$yellow = PixelSearch(643, 109, 698, 163, 0xF5CD37, 10)
If Not @error Then
Move(66,435)
Move(134, 249)
Sleep(1000)
$blue = PixelSearch(430, 132, 602, 267, 0x5D80DB, 10)
If Not @error Then
DEBUG("Cave FOUNDED")
MouseClick("left", $blue[0], $blue[1])
Sleep(2000)
EndIf
Sleep(500)
Move(126, 494)
Move(219, 282) ;in pos
Click(349, 595) ;choose hydra
Click(220, 174) ;cast hydra
MouseClickDrag ( "right", 87, 171 , 260, 106)
MouseClickDrag ( "right", 87, 171 , 260, 106)
Shoot(161, 128)
Sleep(500)
Move(223, 113)
Sleep(500)
Move(291, 565)
Sleep(500)
Move(305, 227)
Sleep(500)
MouseClick("right", 259, 549)
FindItem()
$death = PixelSearch(285, 491, 308, 508, 0x2C0100,2)
If @error Then
Sleep(500)
Send('t')
Sleep(8000)
Send("{ESCAPE}") ;opens menu
Sleep(1000)
Click(407, 345) ;leave
Sleep(2000)
Else
DEBUG("DEAD")
Sleep(500)
Send("{ESCAPE}") ;opens menu
Sleep(1000)
Click(407, 345) ;leave
Sleep(12000)
EndIf
Else
Move(338, 160)
Sleep(500)
Send('t')
Sleep(8000)
Send("{ESCAPE}") ;opens menu
Sleep(1000)
Click(407, 345) ;leave
Sleep(2000)
EndIf
EndIf
EndIf
WEnd
Func Move($x, $y)
MouseClick('middle', $x, $y, 1, Random(0, 1))
Sleep(1500)
EndFunc ;==>Move
Func checkResume()
Local $check = 0
While $check == 0
$resume = PixelSearch(63, 255, 83, 269, 0x2C0100,10)
If Not @error Then
$check = 1
DEBUG("RESUME")
Else
Sleep(100)
EndIf
WEnd
EndFunc
Func Shoot($x, $y)
MouseClick('right', $x, $y, 300)
Sleep(Random(100, 200))
EndFunc ;==>Shoot
Func Teleport()
MouseMove(5, 199)
_Send('2', 2000)
Sleep(Random(100, 200))
EndFunc ;==>Teleport
Func Click($x, $y)
MouseClick('left', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
Sleep(Random(100, 200))
EndFunc ;==>Click
Func FindItem()
$work = 1
$checkCount = 0
While $work == 1 And $checkCount <15
DEBUG("Search Item")
$work = 0
;~ $SearchResult = PixelSearch(382, 131, $Right, $Bottom, $Color) ;searches for rares
;~ If Not @error Then
;~ MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
;~ Sleep(2500)
;~ $work = 1
;~ $checkCount = $checkCount +1
;~ EndIf
$SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color2 ) ;searches for magics
If Not @error Then
MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;clicks magic
Sleep(2500)
$work = 1
$checkCount = $checkCount +1
EndIf
;~ $SearchResult = PixelSearch(382, 131, $Right, $Bottom, $Color3 ) ;searches for legendarys
;~ If Not @error Then
;~ MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;clicks legendary
;~ Sleep(2500)
;~ $work = 1
;~ $checkCount = $checkCount +1
;~ EndIf
;~ $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color4) ;searches for SETS
;~ If Not @error Then
;~ MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
;~ Sleep(2500)
;~ $work = 1
;~ $checkCount = $checkCount +1
;~ EndIf
; search for gems
$SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Amethyst,9) ;searches for gems
If Not @error Then
MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
Sleep(2500)
$work = 1
$checkCount = $checkCount +1
EndIf
$SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Ruby,6) ;searches for gems
If Not @error Then
MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
Sleep(2500)
$work = 1
$checkCount = $checkCount +1
EndIf
$SearchResult = PixelSearch(382, 131, $Right, $Bottom, $Topaz,4) ;searches for gems
If Not @error Then
MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
Sleep(2500)
$work = 1
$checkCount = $checkCount +1
EndIf
$SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Emerald,9) ;searches for gems
If Not @error Then
MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
Sleep(2500)
$work = 1
$checkCount = $checkCount +1
EndIf
WEnd
DEBUG("Finish Item Searching")
EndFunc
Func CheckInv()
Send("{i}") ;opens inv
Sleep(200)
$full = PixelSearch(780, 474, 782, 476, 0x130C08,5)
If @error Then
DEBUG("FULL")
Send("{i}") ;close inv
Return 1
EndIf
$full = PixelSearch(754, 474, 756, 476, 0x130C08,5)
If @error Then
DEBUG("FULL")
Send("{i}") ;close inv
Return 1
EndIf
$full = PixelSearch(761, 466, 762, 468, 0x130C08,5)
If @error Then
DEBUG("FULL")
Send("{i}") ;close inv
Return 1
EndIf
Send("{i}") ;close inv
Return 0
EndFunc
Func InvRepair()
DEBUG("Going to repair")
$slot1x = 538
$slot1y = 367
$offset = 27
Send("t")
Sleep(8000)
MouseClick("left", 700, 147) ;begin movement towards merchant
Sleep(2400)
MouseClick("left", 531, 51) ;moves to get merchant in screen
Sleep(3000)
For $i = 0 To 9
For $j = 0 To 3
MouseClick("right", $slot1x + ($i * $offset), $slot1y + ($j * $offset),1,3)
Sleep(40)
Next
Next
For $i = 5 To 9
For $j = 4 To 5
MouseClick("right", $slot1x + ($i * $offset), $slot1y + ($j * $offset),1,3)
Sleep(40)
Next
Next
MouseClick("left", 294, 296) ;button to open up repair menu
Sleep(1500)
MouseClick("left", 186, 326) ;button to pay for repairs
Sleep(1500)
$inBag = PixelSearch(780, 474, 782, 476, 0x130C08,5)
If @error Then
DEBUG("Not at shop")
Sleep(500)
Send("{ESCAPE}") ;opens menu
Sleep(1000)
Click(407, 345) ;leave
Sleep(12000)
Else
Send("{ESCAPE}") ;opens menu
Sleep(1000)
Send("{ESCAPE}") ;opens menu
Sleep(1000)
MouseClick("left", 407, 345) ;button to leave game
Sleep(2000)
EndIf
EndFunc
Func Pause()
$Paused = Not $Paused
While $Paused
Sleep(100)
ToolTip('Paused...', 0, 0)
WEnd
ToolTip("")
EndFunc ;==>Pause
Func _Send($text, $milliseconds)
$time = TimerInit()
Do
Send($text)
Until TimerDiff($time) > $milliseconds
EndFunc
Func Quit()
Exit
EndFunc ;==>Quit
Func DEBUG($MESSAGE)
If $DebugOn Then
ToolTip($MESSAGE, 0, 0)
EndIf
EndFunc ;==>Debug Info
Start the game on "The Legacy of Cain" and select the "Explore Cellar" quest. Run northeast until you hit the checkpoint, then TP to town and leave the game. Run the script, then while at the character screen, press F10 to start