Code:
;Make sure we are in the right area before beginning run
If CheckFor("OldRuins", "Area") Then
Sleep(100)
GUICtrlSetData($lblLocation, "Location: Old Ruins")
;If $StartingGold = 0 Then Call("GoldPerHour")
;Start Run
RandClick("middle", Round(500*$x_ratio), Round(250*$y_ratio), 5*$x_ratio, 5*$y_ratio) ;starts the run [waypoint 1]
Moving(1125)
Send($skillSmokeScreen)
Moving(440)
RandClick("middle", 1, Round(370*$y_ratio), 5*$x_ratio, 5*$y_ratio, 1, 5) ;waits ~1 second then [waypoint 2]
Moving(1875)
RandClick("middle", Round(400*$x_ratio), Round(600*$y_ratio), 5*$x_ratio, 5*$y_ratio) ;middle of courtyard [waypoint 3]
Moving(50)
Send($skillSmokeScreen)
Moving(25)
Send($skillPreperation)
Moving(750)
Send($skillCaltrops)
Sleep(300)
RandMove(Round(300*$x_ratio),Round(80*$y_ratio), 5*$x_ratio, 5*$y_ratio)
Sleep (500)
;Check for Cellar
$Pixel2 = PixelSearch(0,0, Round(600*$x_ratio), Round(600*$y_ratio),0x334FB7,3)
;Sleep($cellarCheckSleep)
If Not @error Then
GUICtrlSetData($lblStatus, "Status: Cellar - Found")
MouseClick("left")
Moving(750)
Send($skillSmokeScreen)
Moving(2500)
Else ;ABORT RUN
GUICtrlSetData($lblStatus, "Status: Cellar - Not Found" & @CRLF)
Sleep(10)
RandClick("middle", Round(1100*$x_ratio), Round(600*$y_ratio)) ;moves between caltrops for safety before teleporting back to town
Moving(250)
Send($skillCaltrops)
Sleep(200)
Send($skillSmokeScreen)
Sleep(40)
Call("TownPortal")
If Not CheckDead() Then
Call("ClosedCellar")
Call("LeaveGame")
EndIf
Return
EndIf
Else
Call("TownPortal")
If Not CheckDead() Then
Call("ClosedCellar")
Call("LeaveGame")
EndIf
Return
EndIf
;Checks that the player is in the Dank Cellar
If CheckFor("DankCellar", "Area") Then
GUICtrlSetData($lblLocation, "Location: Dank Cellar")
RandClick("middle", Round(120*$x_ratio), Round(1020*$y_ratio), 10*$x_ratio, 10*$y_ratio) ;moves to doorway leading to rare inside cellar
Moving(2000)
GUICtrlSetData($lblStatus, "Status: Attacking Sarkoth")
RandMove(Round(450*$x_ratio),Round(70*$y_ratio), 5*$x_ratio, 5*$y_ratio) ;hovers over the rare Sarkoth
Sleep(10)
Send("{SHIFTDOWN}")
MouseDown("right") ;ATTACK
Send($skillCompanion)
Sleep(Random(2700, 3200))
MouseUp("right")
Sleep(100)
MouseDown("left")
Sleep(Random(1200, 1500))
MouseUp("left")
Sleep (100)
Send("{SHIFTUP}")
Sleep(500)
RandClick("Middle", Round(530*$x_ratio),Round(180*$y_ratio), 10*$x_ratio, 10*$y_ratio) ;Move to Sarkoth's corpse.
GUICtrlSetData($lblStatus, "Status: Collecting Looting")
Moving(1950)
If $LootGPHOnly = 0 then
GUICtrlSetData($lblStatus, "Status: Looting")
Call("Loot")
RandSleep(30, 60, 3)
EndIf
Call("TownPortal")
Else
;Do something here ?
Call("TownPortal")
If Not CheckDead() Then
Call("ClosedCellar")
Call("LeaveGame")
EndIf
Return
EndIf
;After successful run
If Not CheckDead() Then
Sleep(300)
If $mLootIn = 1 And CheckFor("NewTristram", "Area") Then ;If its time to manage loot and we are in town
If $StashLoot == 1 Then
Call("StashLoot")
EndIf
$mLootIn = Round(Random($mLoot - $mLootOff, $mLoot + $mLootOff)) ;Reset Counter
ElseIf Not CheckFor("NewTristram", "Area") Then
GUICtrlSetData($lblStatus, "Status: Skipping vendor, not in New Tristram")
Sleep(3000)
ElseIf $mLootIn <= 0 Then
$mLootIn = 1
Else
$mLootIn -= 1
EndIf
If Not CheckDead() Then
Call("OpenCellar")
Call("LeaveGame")
EndIf
Return
Else
Return
EndIf
EndIf
EndFunc ;==>RestartRun
I removed his Cellar Function call, since it required the PNG of the cellar on the minimap and as a DH, you wont get close enough to the cellar for that PNG to even show.