Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Global $Paused
- HotKeySet("=","Leave") ;script started by pressing =
- HotKeySet("-", "Pause") ;script paused by pressing -
- HotKeySet("x", "Stop") ;script stopped by pressing x
- $walktime = 4000 ; 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 = 3200 ; 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
- $red = 0xD90000 ; red color code
- $go = True
- $Leave = False
- $Dead = False
- $Window = False
- $default_resolutionX = 1920
- $default_resolutionY = 1080
- $x_ratio = @Desktopwidth / $default_resolutionX
- $y_ratio = @Desktopheight / $default_resolutionY
- While $go
- if($Leave) Then
- $i = 0
- Call("CheckDead")
- If $Window Then
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- $Window = False
- EndIf
- Sleep(1800) ;had to add this since the icon doesn't show up RIGHT away in game
- Call("CheckRepair")
- MouseClick("middle", Round(500*$x_ratio), Round(250*$y_ratio)) ;starts the run [waypoint 1]
- Sleep(1400)
- Send("1")
- Send("2")
- MouseClick("middle", 1, Round(370*$y_ratio)) ;waits ~1 second then [waypoint 2]
- Sleep(2100)
- MouseClick("middle", Round(400*$x_ratio), Round(600*$y_ratio)) ;middle of courtyard [waypoint 3]
- Sleep(20)
- Send("3")
- Sleep(300)
- MouseMove(Round(300*$x_ratio),Round(100*$y_ratio),1) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
- Sleep(700)
- Call("CheckDead")
- $Pixel2 = PixelSearch(0,0, Round(600*$x_ratio), Round(600*$y_ratio),0x334FB7,3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be)
- If Not @error Then
- Send("3")
- Sleep(140)
- MouseClick("left",Round(300*$x_ratio),Round(100*$y_ratio)) ;Entrance to cellar
- Sleep(220)
- Send("2")
- Sleep($walktime)
- MouseClick("middle",Round(133*$x_ratio),Round(875*$y_ratio)) ;moves to doorway leading to rare inside cellar
- Sleep(2100)
- MouseMove(Round(440*$x_ratio),Round(85*$y_ratio),1) ;hovers over the rare Sarkoth
- Sleep(10)
- Send(4)
- Send("{SHIFTDOWN}")
- MouseDown("right") ;attack middle
- Sleep(4750)
- MouseUp("right")
- MouseClick("left",Round(440*$x_ratio),Round(80*$y_ratio),2)
- MouseMove(Round(250*$x_ratio),Round(110*$y_ratio),1) ;attack left
- Sleep(40)
- MouseDown("left")
- Sleep(1600)
- MouseUp("left")
- Send("{SHIFTUP}")
- Call("CheckDead")
- Sleep(200)
- MouseClick("middle",Round(579*$x_ratio),Round(209*$y_ratio)) ;location of sarkoth after death
- Sleep(1100)
- MouseClick("middle",Round(866*$x_ratio),Round(324*$y_ratio)) ;moves to right top corner for gold
- Sleep(1100)
- MouseClick("middle",Round(902*$x_ratio),Round(850*$y_ratio)) ;moves to bottom middle for gold
- Sleep(1100)
- MouseClick("middle",Round(587*$x_ratio),Round(413*$y_ratio)) ;moves to left top corner for gold
- Sleep(500)
- Call("CheckLoot")
- Sleep(300)
- Send("t")
- Sleep($tptime)
- Call("CheckDead")
- Call("CheckWindow")
- If Not $Dead And Not $Window Then
- Sleep(100)
- Send("{ESCAPE}") ;menu
- Sleep(10)
- MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
- Sleep($loadtime)
- Send("{SPACE}") ;close any open windows
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- ElseIf $Window Then
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- $Window = False
- EndIf
- Else
- Sleep(10)
- MouseClick("middle",Round(800*$x_ratio),Round(600*$y_ratio)) ;moves between caltrops for safety before teleporting back to town
- Sleep(300)
- Send("4")
- Sleep(900)
- Send("t")
- Sleep($tptime)
- Call("CheckDead")
- Call("CheckWindow")
- If Not $Dead And Not $Window Then
- Sleep(100)
- Send("{ESCAPE}") ;menu
- Sleep(10)
- MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
- Sleep($loadtime)
- Send("{SPACE}") ;close any open windows
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- ElseIf $Window Then
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- $Window = False
- EndIf
- EndIf
- EndIf
- WEnd
- Func CheckDead()
- Call("CheckWindow")
- $Pixeltest = PixelGetColor(Round(740*$x_ratio), Round(850*$y_ratio))
- If Hex($Pixeltest, 6) == "0C0404" OR Hex($Pixeltest, 6) == "310000" Then
- If Not $Window Then
- $Dead = True
- Sleep(100)
- Send("{Escape}")
- Sleep(10)
- MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
- Sleep(12500)
- Sleep($loadtime)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- ElseIf $Window Then
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- $Window = False
- EndIf
- ElseIf Hex($Pixeltest, 6) == "0C0000" OR Hex($Pixeltest, 6) == "030101" Then
- Sleep(10000)
- If Not $Window Then
- $Dead = True
- Sleep($loadtime)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- ElseIf $Window Then
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- $Window = False
- EndIf
- Else
- $Dead = False
- EndIf
- EndFunc
- Func CheckWindow()
- $Pixeltest2 = PixelGetColor(Round(1580*$x_ratio), Round(100*$y_ratio))
- If Hex($Pixeltest2, 6) == "653B23" Then
- Sleep(200)
- Send("{SPACE}") ;close any open windows
- $Window = True
- Else
- $Window = False
- EndIf
- Sleep(300)
- EndFunc
- Func CheckRepair()
- $RepairArea = PixelSearch(Round(1480*$x_ratio), 0, Round(1900*$x_ratio), Round(50*$y_ratio), $yellow)
- If Not @error Then
- Call("DoRepair")
- EndIf
- $RepairAreaRed = PixelSearch(Round(1480*$x_ratio), 0, Round(1900*$x_ratio), Round(50*$y_ratio), $red)
- If Not @error Then
- Call("DoRepair")
- EndIf
- EndFunc
- Func DoRepair()
- Sleep(100)
- Send("t")
- Sleep($tptime)
- 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(1200)
- MouseClick("left", Round(521*$x_ratio),Round(506*$y_ratio)) ;button to open up repair menu
- Sleep(400)
- MouseClick("left", Round(260*$x_ratio),Round(595*$y_ratio)) ;button to pay for repairs
- Sleep(100)
- Call("CheckDead")
- Call("CheckWindow")
- If Not $Dead Then
- Send("{ESCAPE}") ;closes repair tab
- Sleep(100)
- Send("{ESCAPE}") ;menu
- Sleep(10)
- MouseClick("left", Round(956*$x_ratio),Round(579*$y_ratio)) ;button to leave game
- Sleep($loadtime)
- MouseClick("left", Round(230*$x_ratio),Round(416*$y_ratio)) ;button to resume game from main menu
- Sleep($loadtime)
- EndIf
- EndFunc
- Func CheckLoot()
- Sleep(Random(1200,3200))
- $Pixel4 = PixelSearch(Round(270*$x_ratio), 0, Round(1690*$x_ratio), Round(900*$y_ratio), 0xBF642F, 1) ;searches main window for color of legendary lootz
- If Not @error Then
- MouseClick ('left', $Pixel4[0], $Pixel4[1])
- Sleep(Random(800,1200))
- $i+= 1
- If $i < 8 Then
- Call("CheckLoot")
- EndIf
- EndIf
- $Pixel5 = PixelSearch(Round(270*$x_ratio), 0, Round(1690*$x_ratio), Round(900*$y_ratio), 0xFFFF00, 1) ; rare lootz (also f3f45b)
- If Not @error Then
- MouseClick ('left', $Pixel5[0], $Pixel5[1])
- Sleep(Random(800,1800))
- $i+= 1
- If $i < 8 Then
- Call("CheckLoot")
- EndIf
- EndIf
- $Pixel6 = PixelSearch(Round(270*$x_ratio), 0, Round(1690*$x_ratio), Round(900*$y_ratio), 0x00FF00, 1) ; set lootz
- If Not @error Then
- MouseClick ('left', $Pixel6[0], $Pixel6[1])
- Sleep(Random(800,1200))
- $i+= 1
- If $i < 8 Then
- Call("CheckLoot")
- EndIf
- EndIf
- EndFunc
- Func Pause()
- $Leave = False
- EndFunc
- Func Stop() ;to allow the script to stop
- Exit
- EndFunc
- Func Leave()
- $Leave = True
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment