Code:
Global $Paused
HotKeySet("=","Leave")
HotKeySet("-", "Pause")
HotKeySet("x", "Stop")
$default_resolutionX = 1920
$default_resolutionY = 1080
$x_ratio = @Desktopwidth / $default_resolutionX
$y_ratio = @Desktopheight / $default_resolutionY
$go = True
$Leave = False
While $go
if($Leave) Then
$Pixel1 = PixelSearch((1482 * $x_ratio),(20 * $y_ratio),(1535 * $x_ratio),(95 * $y_ratio),0xFFF000) ;searches top right screen for yellow of broken armor
If Not @error Then
Send("t")
Sleep(8000)
MouseClick("left", Round(1480 * $x_ratio),Round(281 * $y_ratio));begin movement towards merchant
Sleep(1500)
MouseClick("left", Round(1316 * $x_ratio),Round(206 * $y_ratio)) ;moves to get merchant in screen
Sleep(1500)
MouseClick("left", Round(845 * $x_ratio),Round(225 * $y_ratio)) ;NPC Merchant to the right of cain's home
Sleep(1500)
MouseClick("left", Round(521 * $x_ratio),Round(506 * $y_ratio)) ;button to open up repair menu
Sleep(1500)
MouseClick("left", Round(260 * $x_ratio),Round(595 * $y_ratio)) ;button to pay for repairs
Sleep(2500)
Send("{ESCAPE}") ;exits store menu
Sleep(250)
Send("{ESCAPE}") ;opens menu
Sleep(1000)
MouseClick("left", Round(956 * $x_ratio),Round(579 * $y_ratio)) ;button to leave game
Sleep(8000)
MouseClick("left", Round(230 * $x_ratio),Round(416 * $y_ratio)) ;button to resume game from main menu
Sleep(8000)
Else
MouseClick("left", Round(587 * $x_ratio),Round(333 * $y_ratio)) ;starts the main run
Sleep(1800)
Send("2")
MouseClick("left", Round(96 * $x_ratio),Round(383 * $y_ratio))
Sleep(800)
Send("1")
Sleep(1500)
MouseClick("left", Round(417 * $x_ratio),Round(422 * $y_ratio)) ;middle of area outside of cellar
Send("1")
Sleep(2000)
Send("3")
Send("2")
MouseMove(Round(115 * $x_ratio),Round(210 * $y_ratio),1) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
Sleep(2000)
$Pixel2 = PixelSearch(0,0,(960 * $x_ratio),(540 * $y_ratio),0x3B62E3,3) ;searches for the specific blue pixel that only occurs when mouse hovers over open cellar
If Not @error Then
MouseClick("left",Round(115 *$x_ratio),Round(210 * $y_ratio)) ;Entrance to cellar
Sleep(1900)
Send(2)
Sleep(1800)
MouseClick("left",Round(531 *$x_ratio),Round(769 * $y_ratio))
Sleep(2000)
MouseClick("left",Round(547 *$x_ratio),Round(490 * $y_ratio)) ;moves to doorway leading to rare inside cellar
Sleep(1500)
MouseMove(Round(579 * $x_ratio),Round(209 * $y_ratio),1) ;hovers over the rare Sarkoth
Send(4)
Sleep(1000)
Send("{SHIFTDOWN}")
MouseDown("right") ;attack middle
Sleep(3800)
MouseMove(Round(467 * $x_ratio),Round(269 * $y_ratio),1) ;attack left, add more sleep time if you can't kill minion on left
Sleep(3000)
MouseMove(Round(682 * $x_ratio),Round(147 * $y_ratio),1) ;attack right
Sleep(800)
MouseMove(Round(579 * $x_ratio),Round(209 * $y_ratio),1) ;move back to middle
Sleep(1000)
MouseUP("right")
Sleep(300)
Send("{SHIFTUP}")
Sleep(500)
MouseClick("left",Round(579 *$x_ratio),Round(209 * $y_ratio)) ;location of sarkoth after death
Sleep(2500)
MouseClick("left",Round(866 *$x_ratio),Round(324 * $y_ratio)) ;moves to right top corner for gold
Sleep(1500)
MouseClick("left",Round(902 *$x_ratio),Round(954 * $y_ratio)) ;moves to bottom middle for gold
Sleep(1500)
MouseClick("left",Round(687 *$x_ratio),Round(413 * $y_ratio)) ;moves to left top corner for gold
Sleep(1500)
Send("t")
Sleep(8200)
Send("{Escape}") ;menu
MouseClick("left",Round(956 *$x_ratio),Round(579 * $y_ratio)) ;button to leave game
Sleep(13000)
MouseClick("left",Round(230 *$x_ratio),Round(416 * $y_ratio)) ;button to resume game from main menu
Sleep(7000)
Else
MouseClick("left",Round(900 *$x_ratio),Round(900 * $y_ratio)) ;moves down screen away from cellar in attempt for safety before teleporting back to town
Sleep(1200)
Send("t")
Sleep(8200)
Send("{ESCAPE}") ;menu
MouseClick("left",Round(956 *$x_ratio),Round(579 * $y_ratio)) ;button to leave game
Sleep(13000)
MouseClick("left",Round(230 *$x_ratio),Round(416 * $y_ratio)) ;button to resume game from main menu
Sleep(8000)
EndIf
EndIf
EndIf
WEnd
Func Pause()
$Leave = False
EndFunc
Func Stop() ;to allow the script to stop
Exit
EndFunc
Func Leave()
$Leave = True
EndFunc