Code:
#include <ImageSearch.au3> ;comment this if you are not using the new looting system
Global $Paused
Opt('MouseCoordMode', 2)
Opt('PixelCoordMode', 2)
HotKeySet("=","Leave") ;script started by pressing =
HotKeySet("-", "Pause") ;script paused by pressing -
HotKeySet("x", "Stop") ;script stopped by pressing x
;ImageSearch Looting Variables
$ImgLoot = True ; set this to true if you want to use ImageSearch looting system. False will revert to old PixelSearch method
$directory = "C:\pics\" ; CHANGE THIS! Point it to the directory with the imagesearch pngs
$totalItems = 17 ; This needs to match the number of pngs you are loading
Global $pick[$totalItems], $size = WinGetClientSize("[TITLE:Diablo III; CLASS:D3 Main Window Class]"), $go = True, $Leave = False, $Dead = False, $Logout = False, $Window = False, $i = 0, $currentArrayItem = 0, $gX = 0, $gY = 0
$pick[0] = "uare.png|40"
$pick[1] = "tome.png|40"
$pick[2] = "legendaryA.png|20"
$pick[3] = "legendaryE.png|20"
$pick[4] = "legendaryI.png|10"
$pick[5] = "legendaryO.png|20"
$pick[6] = "legendaryU.png|20"
$pick[7] = "setA.png|30"
$pick[8] = "setE.png|30"
$pick[9] = "setU.png|30"
$pick[10] = "setO.png|30"
$pick[11] = "setI.png|30"
$pick[12] = "rareA.png|20" ; comment/delete these and adjust $totalItems to disable rare looting
$pick[13] = "rareE.png|20"
$pick[14] = "rareI.png|20"
$pick[15] = "rareO.png|20"
$pick[16] = "rareU.png|20" ; end comment
$LootRares = True ; set this to false if you don't want the bot to pick up rares (old looting method only)
$Timer = True ; set this to true and the bot will randomly wait (5% chance) in town for 30-60 seconds before starting over
$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
$loadtime = 4100 ; time in ms the script waits for the game to load before it starts pathfinding. Slow this down for slower hard drives
$tptime = 6900 ; time in ms the script waits for teleport before exiting the game
$yellow = 0xFFF000 ; yellow color code (repair icon)
$red = 0xD90000 ; red color code (repair icon)
Call("RestartRun")
Func RestartRun()
While $go
if($Leave) Then
$i = 0
RandomSleepShort(850) ;had to add this since the icon doesn't show up RIGHT away in game
If $Window Then
MouseClick("left", 60+Random(0,110,1),280+Random(0,15,1)) ;button to resume game from main menu
RandomSleepShort($loadtime)
$Window = False
ExitLoop
ElseIf $Dead or $Logout Then
ExitLoop
EndIf
;;Waypoint 1 - Top left
MouseMove(0,0,1)
MouseDown("middle")
Sleep(100)
Send("1")
Sleep(2500)
Send("1")
Send("4")
Sleep(2500)
;Send("1")
Send("{SPACE}")
Sleep(1000)
Send("{SPACE}")
MouseUp("middle")
Sleep(1500)
Send("{SPACE}")
Sleep(1500)
Send("{SPACE}")
Sleep(4200)
Send("{SPACE}")
;;To Tyrael
MouseClick("middle", 1205, 393) ;waits ~1 second then [waypoint 2]
RandomSleepShort(3000)
;;Talk to Tyrael
MouseClick("left",894,493)
RandomSleepShort(1000)
Send("{ESC}")
Sleep(300)
Send("{ESC}")
Sleep(300)
SLeep(2000)
;;Go Through Portal
MouseClick("left",330,126)
Sleep(7500)
;;Portal Prompt
Send("{ESC}")
Sleep(250)
Send("{Enter}")
Sleep(4000)
;;Attack Area
MouseMove(817,462,1) ;hovers over Attack area
RandomSleepShort(10)
Send("{SHIFTDOWN}")
MouseDown("right") ;attack middle
RandomSleepShort(12000)
Send("{SHIFTUP}")
MouseUp("right")
MouseClick("left",817,462)
Sleep(1500)
RandomSleepShort(400)
Send("t")
RandomSleepShort($tptime)
Call("RandomSleep")
;;Go to main menu
RandomSleepShort(300)
Send("{ESCAPE}") ;menu
RandomSleepShort(200)
MouseClick("left", 668,414) ;button to leave game
RandomSleepShort($loadtime)
Sleep(Random(2000,5000,1))
MouseClick("left", 57+Random(0,180,1),334+Random(0,20,1))
Sleep(500)
MouseClick("left", 267+Random(0,180,1),429+Random(0,20,1))
Sleep(500)
MouseClick("left", 859,610)
Sleep(500)
MouseClick("left", 601,451)
Sleep(1500)
MouseClick("left", 57+Random(0,180,1),280+Random(0,20,1)) ;button to resume game from main menu
RandomSleepShort($loadtime)
EndIf
WEnd
Call("RestartRun")
EndFunc
Func RandomSleep()
If $Timer And Random(1,50) = 20 Then
Sleep(Random(30000,60000)
EndIf
EndFunc
Func Pause()
$Leave = False
EndFunc
Func Stop() ;to allow the script to stop
Exit
EndFunc
Func RandomSleepShort($ms) ;@$ms -> standard sleeptime
$variance = Random(0,$ms/5,1)
Sleep($ms+$variance)
Endfunc
Func Leave()
$Leave = True
EndFunc