Well, my changes start earlier in the script and end later, some are interspersed, but the order is important:
Code:
$celrmovewait=2200 ;Time (in ms) the script will wait for you to walk from the end of the teleport line to in front of the cellar. Slow this down for slower move speeds
MouseMove(Round(0 * $x_ratio),Round(250 * $y_ratio), 1) ;starts the main run
Send("{3 down}")
Sleep(1600)
Send("{3 up}")
Send($DiamondSkin)
$celrwait=0
Do
sleep(20)
$celrwait=$celrwait+1
$Pixel28 = PixelSearch(Round(550*$x_ratio),Round(550*$y_ratio), Round(100*$x_ratio), Round(100*$y_ratio),0x668CE7, 37) ; Save time if cellar isn't there
Until (Not @Error OR $celrwait=10)
if Not @error Then
MouseClick("middle",Round(0*$x_ratio),Round(700*$y_ratio)) ;get a better view of the cellar for better identification - reduces miss clicks
Moving($celrmovewait)
EndIf
If CheckDead() Then
Return
EndIf
$celrwait=0
Do
sleep(20)
$celrwait=$celrwait+1
$Pixel2 = PixelSearch(Round(1269*$x_ratio),Round(337*$y_ratio), Round(797*$x_ratio), Round(0*$y_ratio),0x668CE7, 10)
Until (Not @Error OR $celrwait=3)
If Not @error Then
MouseMove($Pixel2[0],$Pixel2[1]) ; Move mouse on cellar to change the color of the pixels to be brighter to avoid false positives
Sleep(300) ; Give the cursor time to move
$celrwait2=0
Do
sleep(20)
$celrwait2=$celrwait2+1
$Pixel23 = PixelSearch(Round(1269*$x_ratio),Round(337*$y_ratio), Round(797*$x_ratio), Round(0*$y_ratio), 0xAFEEFB, 5) ; Make sure it's cellar and not mob
Until (Not @Error OR $celrwait=5)
EndIf
If Not @error Then
GUICtrlSetData($lblStatus, "Status: Cellar - Found")
$cellarCount += 1
MouseClick("left",$Pixel23[0],$Pixel23[1]) ;Entrance to cellar