Code:
;Credit Due, gg-bots for his t6 chest script, his pixel location/ hex color tool was valuable to this project, as well as his legendary pickup script.
#include <ImageSearch.au3>
HotKeySet("{F7}", "ExitScript")
Global $casenumber = 0
Global $number = 0
Global $gamecount = 1
while 1
Resume()
wend
Func ExitScript()
Exit
EndFunc
func print($Print)
ToolTip($Print & ", Game # " & $gamecount, 10, 10)
sleep(10)
EndFunc
Func Resume();Main menu, checks to see if at default character screen, opens game settings, checks to see if there, selects ghom quest both if you didn't kill ghom and if you did kill him in previous game.
winactivate("Diablo III")
local $Counter = 0
While $Counter <=1
MenuCheck(1)
IF $number = 1 Then
Print("Found Home Screen")
$number = 0
MouseClick("left", 250, 570, 1, 0)
$Counter = $Counter + 1
sleep(1000)
Else
Print("Didn't find Home Screen")
Send("{ESC}")
sleep(500)
MenuCheck(2)
If $number = 2 Then
Print("Found GameSettings Menu")
Send("{ESC}")
$number = 0
EndIf
sleep(500)
MenuCheck(3)
If $number = 3 Then
LeaveGame()
$Counter = $Counter + 1
$number = 0
EndIf
EndIf
WEnd
Print("Creating Game")
MouseClick("left", 950, 665, 1, 0);Clicks change button
sleep(400)
MouseClick("left", 1178, 716, 2, 0);Clicks arrow down
sleep(400)
MouseClick("left", 1178, 716, 2, 0);Clicks arrow down
sleep(400)
MouseClick("left", 1178, 716, 2, 0);Clicks arrow down
sleep(1000)
local $y = 0, $x = 0
If _ImageSearchArea("breached.png", 1, 700, 308, 1185, 732, $x, $y, 10) Then
MouseClick("left", $x, $y, 1, 0)
EndIf
$y = 0
$x = 0
sleep(300)
If _ImageSearchArea("ghom.png", 1, 700, 308, 1185, 732, $x, $y, 0) or _ImageSearchArea("ghom2.png", 1, 700, 308, 1185, 732, $x, $y, 0)Then;Searches for ghom, then selects, extra clicks, i know was lazy, but needed if it is a new ghom kill.
MouseClick("left", $x, $y, 2, 0);Selects Quest
sleep(400)
MouseClick("left", 880, 780, 1, 0);Ok button 1
sleep(400)
MouseClick("left", 1150, 870, 1, 0);Start button
sleep(400)
MouseClick("left", 850, 655, 1, 0);Ok button 2
sleep(400)
MouseClick("left", 1150, 870, 1, 0);Start button
Print("Entering Game")
sleep(10000)
Ghom()
EndIf
EndFunc
Func Ghom();checks to see if in the town yet.
Local $Counter = 0
while $Counter <=10
$InGame = PixelSearch(1642, 137, 1676, 156, 0x68C3E1, 10);In town yet?
IF @error Then
Sleep(2000)
$Counter = $Counter + 1
If $Counter = 10 Then
$number = 3
LeaveGame()
EndIf
Else
Print("In Town")
$Counter = 11
Ghom1()
EndIf
WEnd
EndFunc
Func Ghom1();clicks the depths 3 on map, checks to see if in depths 3
Send("{M Down}")
Send("{M UP}")
Sleep(400)
MouseClick("left", 692, 785, 1, 0);Click depths 3 on map
Sleep(500)
$Counter = 0
While $Counter <=10
$Depths3 = PixelSearch(1174, 732, 1240, 773, 0x15020E, 5);In Depths 3 yet?
IF @error Then
Sleep(2000)
$Counter = $Counter + 1
If $Counter = 10 Then
$number = 3
LeaveGame()
EndIf
Else
Print("Going to Larder")
$Counter = 11
Sleep(500)
Ghom2()
EndIf
WEnd
EndFunc
Func Ghom2();clicks the larder, checks to see if in room
MouseClick("left",1681, 265, 2, 0);Click the Larder
sleep(500)
$Counter = 0
While $Counter <=10
$TheLarder = PixelSearch(514, 628, 551, 641, 0x171500, 5);In the Larder yet?
If @error Then
Sleep(2000)
$Counter = $Counter + 1
If $Counter = 10 Then
$number = 3
LeaveGame()
EndIf
Else
Print("Going to Ghom")
$Counter = 11
Sleep(300)
Ghom3()
EndIf
WEnd
EndFunc
Func Ghom3();Moves to ghom
MouseClick("left", 1607, 52, 1, 0);first click down hallway
Sleep(3000)
MouseClick("left", 1626, 71, 1, 0);click into boss room
Sleep(8500)
MouseClick("left", 1411, 377, 1, 0);postition character for boss fight
Sleep(3000)
MouseMove(946, 439, 0);center mouse on character for when ghom comes into melee range, has better chance of targeting him.
CheckBoss()
EndFunc
Func CheckBoss();Checks to see if boss is alive, if he is he only attacks until he is dead.
Local $Counter = 0
While $Counter <=1
$Boss = PixelSearch(780, 67, 797, 88, 0x8B682D, 5);Boss dead?
If @error Then
Print("Boss Dead")
Sleep(1500)
Print("Looting")
Send("{ESC}")
Loot()
Sleep(200)
Send("{ESC DOWN}")
Send("{ESC UP}")
Sleep(200)
LeaveGame()
$Counter = 2
Else
Print("Boss Alive")
StartFight()
EndIf
WEnd
EndFunc
Func StartFight()
Send("{LSHIFT DOWN}")
Send("1")
sleep(40)
Send("2")
Sleep(40)
Send("3")
Sleep(40)
Send("4")
Print("Sending Right Click")
MouseDown("right")
Sleep(3000)
MouseUp("right")
Print("Sending Left Click")
MouseDown("left")
Sleep(2000)
MouseUp("left")
Send("{LSHIFT UP}")
Sleep(300)
EndFunc
Func Loot() ;//These functions basically look for Chests/Bodies and also loots Legs/Sets.
$LegColor = PixelSearch(780, 278, 1188, 679, 0xFF8000, 2)
If Not @error Then
MouseClick("left", $LegColor[0], $LegColor[1], 1, 1)
Sleep(1800)
EndIf
Sleep(150)
$SetColor = PixelSearch(780, 278, 1188, 679, 0x00FF00, 2)
If Not @error Then
MouseClick("left", $SetColor[0], $SetColor[1], 1, 1)
Sleep(1800)
EndIf
Sleep(150)
$GemColor = PixelSearch(780, 278, 1188, 679, 0x99BBFF, 2)
If Not @error Then
MouseClick("left", $GemColor[0], $GemColor[1], 1, 1)
Sleep(1800)
EndIf
Sleep(150)
$LegColor = PixelSearch(780, 278, 1188, 679, 0xFF8000, 2)
If Not @error Then
MouseClick("left", $LegColor[0], $LegColor[1], 1, 1)
Sleep(1800)
EndIf
Sleep(150)
$SetColor = PixelSearch(780, 278, 1188, 679, 0x00FF00, 2)
If Not @error Then
MouseClick("left", $SetColor[0], $SetColor[1], 1, 1)
Sleep(1800)
EndIf
Sleep(150)
$GemColor = PixelSearch(780, 278, 1188, 679, 0x99BBFF, 2)
If Not @error Then
MouseClick("left", $GemColor[0], $GemColor[1], 1, 1)
Sleep(1800)
EndIf
Sleep(150)
$LegColor = PixelSearch(780, 278, 1188, 679, 0xFF8000, 2)
If Not @error Then
MouseClick("left", $LegColor[0], $LegColor[1], 1, 1)
Sleep(1800)
EndIf
Sleep(150)
$SetColor = PixelSearch(780, 278, 1188, 679, 0x00FF00, 2)
If Not @error Then
MouseClick("left", $SetColor[0], $SetColor[1], 1, 1)
Sleep(1800)
EndIf
Sleep(150)
$GemColor = PixelSearch(780, 278, 1188, 679, 0x99BBFF, 2)
If Not @error Then
MouseClick("left", $GemColor[0], $GemColor[1], 1, 1)
Sleep(1800)
EndIf
EndFunc
Func MenuCheck($casenumber)
Switch $casenumber
Case 1
$MainMenu = PixelSearch(496, 657, 526, 684, 0x4A1408, 2);Main Menu
If Not @error Then
$number = 1
EndIf
case 2
$GameSettings = PixelSearch(873, 258, 1021, 362, 0xBB1CBE, 2);Gamesettings menu
If Not @error Then
$number = 2
EndIf
case 3
$LeaveGameMenu = PixelSearch(851, 962, 878, 986, 0x290400, 8);Leave game menu
If Not @error Then
$number = 3
EndIf
EndSwitch
EndFunc
Func LeaveGame()
Print("Leaving Game")
Local $Counter = 0
MenuCheck(3)
If $number = 3 Then
MouseClick("left", 236, 480, 1, 0)
$number = 0
Sleep(14000)
$gamecount = $gamecount + 1
Else
Send("{ESC DOWN}")
Send("{ESC UP}")
Sleep(200)
EndIf
EndFunc