Code:
Global $Paused
HotKeySet("=","Leave") ;script can START by pressing =
HotKeySet("-", "Pause") ;script can be Pause by pressing -
HotKeySet("x", "Stop") ;script can be Stopped by pressing x
HotKeySet("6", "IDAll") ;script will ID by pressing 6
HotKeySet("7", "Craft") ;script will craft by pressing 7
HotKeySet("8", "Craft2") ;testing
;-----------------------------------------------------
;-----------------------------------------------------
; Settings
$SearchForlightblue = True ;Default: True ;True / False Activate/Deactivate lightblue looting (will not pick potions / gems either)
$SearchForBlue = True ;Default: True ;True / False Activate/Deactivate blue looting
$SearchForYellow = True ;Default: True ;True / False Activate/Deactivate yellow looting
$KeepPotion = True ;Default: True ;True / False Activate/Deactivate dropping potion in stash
$KeepGems = True ;Default: True ;True / False Activate/Deactivate dropping in stash
$KillBeforeVendoring = 6 ;Default: 5 ;Number of kill before going to town to deposit and vendor
$KillBeforeVendoringJunk = 22 ;Default 20 ;Number of kills before selling accidentally picked up junk
$LootingLoopCount = 2 ;Default: 2 ;Number of times you try looting items on the ground (increasing will increase the chance of unstucking yourself and keep looting)
$TimeOffset = 0 ;Default: 0 ;Increase this if you stop running before reaching the cellar door (1000 = 1 second)
$SalvageBlues = False ;Default: False ;True / False Activate/Deactivate Salavage of blues
$LessDeathMode = False ;Default: True ;True / False Activate / deactivate the run back when cellar is closed. Makes the run longer but reduces the deaths
$ShootingTime = 8000 ;Default: 5000 ;Time in 1/1000 sec to shoot at sarkoth. Increase if you can't kill him.
;-----------------------------------------------------
;-----------------------------------------------------
; Time
; in game to Resume button Cellar closed (includes loading): 18s
; in game to Resume button Cellar closed (less death mode)(includes loading): 22s
; in game to Sarkoth death(includes loading): 22s
; Salvage blues (from portal to back to chest): 10s + .4s/item
; Run from chest to vendor to ready to resume game (includes repair): 10s
; Vendor all(once every 5 runs (by default) and is $SearchForlightblue = true): 22s
; Vendor blue only (lightblue looting off): .4s / item
;-----------------------------------------------------
;-----------------------------------------------------
; areas
Global $LootArea[4]
$LootArea[0] = 450
$LootArea[1] = 115
$LootArea[2] = 1550
$LootArea[3] = 864
Global $FullScreen[4]
$FullScreen[0] = 0
$FullScreen[1] = 0
$FullScreen[2] = 1920
$FullScreen[3] = 1080
Global $InventoryArea[4]
$InventoryArea[0] = 1400
$InventoryArea[1] = 584
$InventoryArea[2] = 1900
$InventoryArea[3] = 1874
Global $InventoryAreaB[4]
$InventoryAreaB[0] = 1400
$InventoryAreaB[1] = 584
$InventoryAreaB[2] = 1900
$InventoryAreaB[3] = 825
$go = True
$Run = False
$runMade = 0
$runMadeB = 0
While $go
if($Run) Then
$Pixel1 = PixelSearch(1482,20,1535,95,0xFFF000) ;searches top right screen for yellow of broken armor
If Not @error Then
;we need to repair
Sleep(Random(500,600))
Send("4")
Sleep(Random(500,600))
Send("3")
While(Teleport())
; idle until teleport is over
WEnd
Sleep(8000)
MouseClick("middle", 1480, 281) ;begin movement towards merchant
Sleep(1500)
MouseClick("middle", 1316, 206) ;moves to get merchant in screen
Sleep(1500)
MouseClick("middle", 845, 225) ;NPC Merchant to the right of cain's home
Sleep(1500)
MouseClick("left", 521, 506) ;button to open up repair menu
Sleep(1500)
MouseClick("left", 260, 595) ;button to pay for repairs
Sleep(2500)
Send("{ESCAPE}") ;close windows
Sleep(100)
StatusCheck()
Sleep(200);
ResumeGame()
Else
;starts the run
$runMade = $runMade + 1
$runMadeB = $runMadeB + 1
if(StatusCheck()) Then
If $runMade >= $KillBeforeVendoring Or $runMadeB >= $KillBeforeVendoringJunk Then
if (StatusCheck()) Then
While(Teleport())
; idle until teleport is over
WEnd
Town()
Sleep(200)
Resumegame();
EndIf
Else
Sleep(50)
MouseClick("left", 1878, 379) ;hide objectives
Sleep(50)
while (Loading())
Sleep(100)
; idle until we're done loading
Return true
WEnd
Sleep(300)
StartRun()
if(StatusCheck()) Then
Send("2")
if($LessDeathMode) Then
MouseMove("middle", 1800 + GetRandomInt(0, 10), 520 + GetRandomInt(0, 10))
Sleep(200)
EndIf
TeleportAndResume();
EndIf
EndIf
EndIf
EndIf
EndIf
WEnd
Func Pause()
$Run = False
EndFunc
Func Stop() ;to allow the script to stop
Exit
EndFunc
Func Leave()
$Run = True
EndFunc
Func SearchBlue()
Send("{ALTDOWN}")
Send("{ALTUP}")
Sleep(50)
MouseActionOnPixelColor("left", 0x6969ff, $LootArea, 8, 500)
EndFunc
Func SearchYellow()
Send("{ALTDOWN}")
Send("{ALTUP}")
Sleep(50)
MouseActionOnPixelColor("left", 0xdddd00, $LootArea, 8, 500)
Send("{ALTDOWN}")
Send("{ALTUP}")
Sleep(50)
MouseActionOnPixelColor("left", 0xe0e205, $LootArea, 8, 500)
Send("{ALTDOWN}")
Send("{ALTUP}")
Sleep(50)
MouseActionOnPixelColor("left", 0xc5c509, $LootArea, 8, 500)
Send("{ALTDOWN}")
Send("{ALTUP}")
Sleep(50)
MouseActionOnPixelColor("left", 0xd4d711, $LootArea, 8, 500)
EndFunc
Func SearchOrange()
Send("{ALTDOWN}")
Send("{ALTUP}")
Sleep(50)
MouseActionOnPixelColor("left", 0xbf642f, $LootArea, 8, 500)
Send("{ALTDOWN}")
Send("{ALTUP}")
Sleep(50)
MouseActionOnPixelColor("left", 0x9b5227, $LootArea, 8, 500)
Send("{ALTDOWN}")
Send("{ALTUP}")
Sleep(50)
MouseActionOnPixelColor("left", 0x9C5612, $LootArea, 8, 500)
EndFunc
Func SearchGreen()
Send("{ALTDOWN}")
Send("{ALTUP}")
Sleep(50)
MouseActionOnPixelColor("left", 0x00ff00, $LootArea, 8, 500)
EndFunc
Func Searchlightblue()
Send("{ALTDOWN}")
Send("{ALTUP}")
Sleep(50)
MouseActionOnPixelColor("left", 0x99BBFF, $LootArea, 8, 500)
EndFunc
Func SearchGold()
Send("{ALTDOWN}")
Send("{ALTUP}")
Sleep(50)
$coord = PixelSearch(1,100,1557,879,0xede041,10)
If Not @error Then
MouseClick("middle",$coord[0], $coord[1], 1)
Else
Sleep(50)
EndIf
EndFunc
Func Town()
If $runMade >= $KillBeforeVendoring Then
$Pixel3 = PixelSearch(1667,190,1668,191,0x764526 )
if @error Then
StatusCheck()
Return
EndIf
$runMade = 0
StatusCheck()
Chest()
EndIf
If $runMadeB >= $KillBeforeVendoringJunk Then
$Pixel3 = PixelSearch(1667,190,1668,191,0x764526 )
if @error Then
StatusCheck()
Return
EndIf
StatusCheck()
Chest()
EndIf
EndFunc
Func Chest()
StatusCheck()
MouseClick("left", 1064 + GetRandomInt(0,5), 256 + GetRandomInt(0,5)) ;go to chest
Sleep(2000)
MouseClick("left", 517 + GetRandomInt(0,5), 251 + GetRandomInt(0,5)) ; 1st tab
Sleep(600);
DepositLegendary()
Sleep(50)
DropInChest();
MouseClick("left", 517 + GetRandomInt(0,5), 378 + GetRandomInt(0,5)) ; 2nd tab
Sleep(600);
DepositLegendary()
Sleep(50)
DepositRare()
Sleep(50)
MouseClick("left", 517 + GetRandomInt(0,5), 500 + GetRandomInt(0,5)) ; 3rd tab
Sleep(600);
DepositLegendary()
Sleep(50)
DepositRare()
Sleep(50)
Sleep(600);
Send("{ESCAPE}") ;close windows
Sleep(50)
StatusCheck()
Sleep(500)
If $runMadeB >= $KillBeforeVendoringJunk Then
IDAll()
Sleep(50)
Send("{ESCAPE}") ;close windows
Sleep(50)
StatusCheck()
Sleep(50)
Endif
MouseClick("middle", 1515 + GetRandomInt(0,5), 69 + GetRandomInt(0,5)) ;go half way to vendor
Sleep(2000)
if($SalvageBlues)Then
MouseClick("left", 1055 + GetRandomInt(0,5), 225 + GetRandomInt(0,5)) ;go to vendor
Else
MouseClick("left", 1105 + GetRandomInt(0,5), 225 + GetRandomInt(0,5)) ;go to vendor
EndIf
Sleep(2000 + GetRandomInt(0,50))
VendorAll()
MouseClick("left", 506 + GetRandomInt(0,5), 483 + GetRandomInt(0,5)) ;click repair tab
Sleep(200)
MouseClick("left", 242 + GetRandomInt(0,5), 528 + GetRandomInt(0,5)) ;click repair
Sleep(200)
Send("{ESCAPE}") ;close windows
StatusCheck()
Sleep(50)
Sleep(500)
EndFunc
Func StatusCheck()
if Not CheckDeath() Then
TrayTip("Status", "NOT OK:: Death", 1)
Return False
EndIf
if Not CheckConnection() Then
TrayTip("Status", "NOT OK:: Connection", 1)
Return False
EndIf
if Not CheckError() Then
TrayTip("Status", "NOT OK:: Error", 1)
Return False
EndIf
Return True
EndFunc
Func Looting()
For $i = 1 To $LootingLoopCount
SearchOrange()
SearchGreen()
if ($SearchForYellow) Then
SearchYellow()
SearchOrange()
SearchGreen()
EndIf
if ($SearchForBlue) Then
SearchBlue()
SearchOrange()
SearchGreen()
EndIf
SearchOrange()
SearchGreen()
SearchGold()
if ($SearchForlightblue) Then
Searchlightblue()
SearchOrange()
SearchGreen()
EndIf
Sleep(20)
Next
EndFunc
Func DropInChest()
;MouseActionOnPixelColor("right", 0xc62821, $InventoryArea, 3, 500) ; tome of secret
MouseActionOnPixelColor("right", 0x591110, $InventoryArea, 3, 500) ; tome of secret
;MouseActionOnPixelColor("right", 0x4a1008, $InventoryArea, 3, 500) ; mystic potion
MouseActionOnPixelColor("right", 0xd81617, $InventoryAreaB, 3, 500) ; mystic potion
if ($KeepGems) Then
;MouseActionOnPixelColor("right", 0xd60a06, $InventoryArea, 3, 500) ; square ruby deposits 1h xbows in 10th column, one up from bottom
;MouseActionOnPixelColor("right", 0xa40706, $InventoryArea, 3, 500) ; square ruby deposits quivers in 7th column, bottom
MouseActionOnPixelColor("right", 0xf53333, $InventoryArea, 3, 500) ;
;MouseActionOnPixelColor("right", 0xef1616, $InventoryArea, 3, 500) ; flawless square ruby
MouseActionOnPixelColor("right", 0xF76967, $InventoryArea, 3, 500) ; flawless square ruby
;MouseActionOnPixelColor("right", 0x37ad34, $InventoryArea, 3, 500) ; square emerald
MouseActionOnPixelColor("right", 0x3ab838, $InventoryArea, 3, 500) ; square emerald
;MouseActionOnPixelColor("right", 0x46da43, $InventoryArea, 3, 500) ; flawless square emerald
MouseActionOnPixelColor("right", 0x87e187, $InventoryArea, 3, 500) ; flawless square emerald
;MouseActionOnPixelColor("right", 0x874900, $InventoryArea, 3, 500) ; square topaz
MouseActionOnPixelColor("right", 0xf0ac26, $InventoryArea, 3, 500) ; square topaz
MouseActionOnPixelColor("right", 0xc57c00, $InventoryArea, 3, 500) ; flawless square topaz
MouseActionOnPixelColor("right", 0x60008d, $InventoryArea, 3, 500) ; square ametyst
MouseActionOnPixelColor("right", 0xebd6f4, $InventoryArea, 3, 500) ; flawless square ametyst
;MouseActionOnPixelColor("right", 0x68059a, $InventoryArea, 3, 500) ; flawless square ametyst
EndIf
MouseActionOnPixelColor("right", 0xb5ab81, $InventoryArea, 3, 500) ; whisful essence
MouseActionOnPixelColor("right", 0xa98a6f, $InventoryArea, 3, 500) ; encrusted hoof
MouseActionOnPixelColor("right", 0xceaeef, $InventoryArea, 3, 500) ; equisite essence
MouseActionOnPixelColor("right", 0xffbea5, $InventoryArea, 3, 500) ; iridescent tear
MouseActionOnPixelColor("right", 0xe66808, $InventoryArea, 3, 500) ; fiery brimstone
EndFunc
Func VendorAll()
$runMadeB = $runMadeB
If $runMadeB >= $KillBeforeVendoringJunk Then
$runMadeB = 0
For $i = 0 To 9 Step 1
MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + GetRandomInt(0,5))
Sleep(25)
MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + 50 + GetRandomInt(0,5))
Sleep(25)
MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + 100 + GetRandomInt(0,5))
Sleep(25)
MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + 150 + GetRandomInt(0,5))
Sleep(25)
MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + 200 + GetRandomInt(0,5))
Sleep(25)
;MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + 250 + GetRandomInt(0,5))
Sleep(25)
Next
EndIf
if $SearchForlightblue Then
SellBlue("right");
Return
EndIf
For $i = 0 To 9 Step 1
MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + GetRandomInt(0,5))
Sleep(25)
MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + 50 + GetRandomInt(0,5))
Sleep(25)
MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + 100 + GetRandomInt(0,5))
Sleep(25)
MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + 150 + GetRandomInt(0,5))
Sleep(25)
MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + 200 + GetRandomInt(0,5))
Sleep(25)
MouseClick("right", 1432 + (50 * $i) + GetRandomInt(0,5), 609 + 250 + GetRandomInt(0,5))
Sleep(25)
Next
EndFunc
Func SellBlue($mouseBtn)
MouseActionOnPixelColor($mouseBtn, 0x161c36, $InventoryArea, 12, 400)
MouseActionOnPixelColor($mouseBtn, 0x13233c, $InventoryArea, 12, 400)
MouseActionOnPixelColor($mouseBtn, 0x182343, $InventoryArea, 12, 400)
MouseActionOnPixelColor($mouseBtn, 0x233055, $InventoryArea, 12, 400)
MouseActionOnPixelColor($mouseBtn, 0x102039, $InventoryArea, 12, 400)
EndFunc
Func IDAll()
Send("i")
Sleep(200)
For $i = 1 To 40
ID()
Sleep(Random(100))
Next
EndFunc
Func ID()
$coord = PixelSearch(1400,584,1900,1874,0x00389c,1)
If Not @error Then
MouseMove($coord[0], $coord[1], 10)
Sleep(Random(200,300))
MouseDown("right")
Sleep(100)
MouseUp("right")
Sleep(Random(200,300))
MouseMove(966 + GetRandomInt(10, 20), 38 + GetRandomInt(10, 20), 10)
Sleep(2000)
Else
Sleep(50)
EndIf
EndFunc
Func Craft()
For $i = 1 To 30
MouseClick("left", 259 , 783 )
Sleep(3000)
Next
EndFunc
Func Craft2()
For $i = 1 To 30
DropInChest()
Sleep(100)
Next
EndFunc
Func DepositRare()
Sleep(50)
;Question Marks
MouseActionOnPixelColor("right", 0x00389C, $InventoryArea, 8, 400)
;Plans
;MouseActionOnPixelColor("right", 0x321D19, $InventoryArea, 8, 400)
;MouseActionOnPixelColor("right", 0x654a2a, $InventoryArea, 8, 400)
;MouseActionOnPixelColor("right", 0x9f7d60, $InventoryArea, 8, 400) ;deposits soverign helms in 3rd column
;MouseActionOnPixelColor("right", 0x81644f, $InventoryArea, 8, 400) ;don't need this line since plans get deposited with legendaries
EndFunc
Func DepositLegendary()
;Green
MouseActionOnPixelColor("right", 0x00ff00, $InventoryArea, 8, 400)
;Orange
MouseActionOnPixelColor("right", 0x563313, $InventoryArea, 8, 400)
MouseActionOnPixelColor("right", 0x4e2c0c, $InventoryArea, 8, 400)
MouseActionOnPixelColor("right", 0x552e0c, $InventoryArea, 8, 400)
;Plans
;MouseActionOnPixelColor("right", 0x9f7d60, $InventoryArea, 8, 400)
MouseActionOnPixelColor("right", 0x81644f, $InventoryArea, 8, 400)
EndFunc
Func CheckDeath()
$Pixel3 = PixelSearch(830,840,860,850,0xe69f4f )
if Not @error Then
$Pixel3 = PixelSearch(700,830,730,860,0x180000 )
if Not @error Then
Sleep(200)
ResumeGame()
Return False
EndIf
EndIf
$Pixel3 = PixelSearch(830,840,860,850,0x4b4742 )
if Not @error Then
$Pixel3 = PixelSearch(700,830,730,860,0x060201 )
if Not @error Then
Sleep(200)
ResumeGame()
Return False
EndIf
EndIf
Return True
EndFunc
Func CheckConnection()
$Pixel3 = PixelSearch(860,417,1068,438,0xf09901 )
if Not @error Then
$Pixel3 = PixelSearch(900,620,920,640,0x230400 )
if Not @error Then
Sleep(10)
MouseClick("left", 910, 630)
Sleep(200)
ResumeGame()
Return False
EndIf
EndIf
Return True
EndFunc
Func CheckError()
$Pixel3 = PixelSearch(934,614,999,636,0xf09901 )
if Not @error Then
$Pixel3 = PixelSearch(900,620,920,640,0x340a00 )
if Not @error Then
Sleep(10)
MouseClick("left", 941, 626)
Sleep(200)
ResumeGame()
Return False
EndIf
EndIf
Return True
EndFunc
Func ReachBlacksmith()
MouseClick("middle", 1790 + GetRandomInt(0,20), 490 + GetRandomInt(0,20))
Sleep(2000 + GetRandomInt(0,200))
MouseClick("left", 1465 + GetRandomInt(0,20), 390 + GetRandomInt(0,20))
Sleep(1000 + GetRandomInt(0,100))
MouseClick("left", 250 + GetRandomInt(0,20), 290 + GetRandomInt(0,20))
Sleep(500 + GetRandomInt(0,50))
SellBlue("left")
Sleep(1000 + GetRandomInt(0,100))
Send("{ESCAPE}")
Sleep(50)
StatusCheck()
Sleep(500 + GetRandomInt(0,50))
MouseClick("left", 20 + GetRandomInt(0,20), 260 + GetRandomInt(0,20))
EndFunc
Func Loading()
$Pixel3 = PixelSearch(1700,168,1775,240,0x00a6ff )
if Not @error Then
Sleep(10)
; pixel found = loading is over
Return False
EndIf
Statuscheck()
;Still on loading screen
Sleep(10)
return True
EndFunc
Func Teleport()
Sleep(Random(500,600))
Send("4")
Sleep(Random(500,600))
Send("3")
Sleep(Random(500,600))
Send("2")
Sleep(Random(900,1000))
Send("t")
Sleep(Random(6500,7500))
while (Loading())
Sleep(100)
; idle until we're done loading
Return true
WEnd
Sleep(300)
EndFunc
Func TeleportAndResume()
Sleep(Random(500,600))
Send("4")
Sleep(Random(500,600))
Send("3")
Sleep(Random(500,600))
Send("2")
Sleep(Random(900,1000))
Send("t")
Sleep(Random(6500,7500))
;while (Loading())
; idle until we're done loading
;WEnd
Sleep(300)
ResumeGame()
EndFunc
Func GetRandomInt($min, $max)
Return Round(Random($min, $max))
EndFunc
Func StartRun()
Sleep(Random(600,650))
Send("4")
Sleep(Random(600,650))
Send("3")
Sleep(Random(600,650))
SearchforMobs()
Sleep(20)
MouseClick("middle", 1173, 880)
Sleep(Random(500,750))
SearchforMobs()
Sleep(20)
SearchforMobs()
Sleep(20)
MouseClick("middle", 1173, 880)
Sleep(20)
SearchforMobs()
Sleep(20)
SearchforMobs()
Sleep(20)
Statuscheck()
Looting()
Sleep(20)
MouseClick("middle", 1919, 1001)
Sleep(Random(2000,2500))
Send("1")
SearchforMobs()
Sleep(20)
SearchforMobs()
Sleep(20)
SearchforMobs()
Sleep(20)
Statuscheck()
Looting()
Sleep(20)
MouseClick("middle", 1465, 364)
Sleep(Random(500,750))
SearchforMobs()
Sleep(20)
SearchforMobs()
Sleep(20)
SearchforMobs()
Sleep(20)
Statuscheck()
Looting()
Sleep(20)
endFunc
Func MouseActionOnPixelColor($mouseBtn, $color, $area, $searchCount, $timeBetweenFinds = 0, $randomRange = 4)
$cnt = 0
$Searching = True
while $Searching
$Pixel3 = PixelSearch($area[0],$area[1],$area[2],$area[3],$color)
if Not @error Then
MouseClick($mouseBtn, $Pixel3[0] + GetRandomInt(0,$randomRange), $Pixel3[1] + GetRandomInt(0,$randomRange))
Sleep($timeBetweenFinds)
$cnt = $cnt + 1
if $cnt > $searchCount Then
$Searching = False
EndIf
Else
$Searching = False
EndIf
WEnd
EndFunc
Func SearchForMobs()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("right")
Sleep(Random(500,600))
MouseUp("right")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("left")
Sleep(Random(1500,2500))
MouseUp("left")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("right")
Sleep(Random(500,600))
MouseUp("right")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("left")
Sleep(Random(1500,2500))
MouseUp("left")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("right")
Sleep(Random(500,600))
MouseUp("right")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("left")
Sleep(Random(1500,2500))
MouseUp("left")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("right")
Sleep(Random(500,600))
MouseUp("right")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("left")
Sleep(Random(1500,2500))
MouseUp("left")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("right")
Sleep(Random(500,600))
MouseUp("right")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("left")
Sleep(Random(1500,2500))
MouseUp("left")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("right")
Sleep(Random(500,600))
MouseUp("right")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
MouseMove($coord[0], $coord[1], 1)
Sleep(Random(50,100))
Send("{SPACE DOWN}")
Sleep(Random(50,100))
MouseDown("left")
Sleep(Random(1500,2500))
MouseUp("left")
Send("{SPACE UP}")
Else
Sleep(10)
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
$coord = PixelSearch(1,100,1900,900,0x780000,10)
If Not @error Then
Return False
EndIf
CheckDeath()
CheckHealth()
CheckHealthB()
Return True
EndFunc
Func CheckHealth()
$Pixel6 = PixelSearch(530,943,548,957,0x473f22,20 )
If Not @error Then
Send("2")
Sleep(10)
Else
$Pixel6 = PixelSearch(537,1000,557,1012,0x473f22,20 )
If Not @error Then
Send("q")
Sleep(10)
Else
Sleep(10)
EndIf
EndIf
EndFunc
Func CheckHealthB()
$Pixel6 = PixelSearch(537,1000,557,1012,0x473f22,20 )
If Not @error Then
Send("q")
Sleep(10)
Else
Sleep(10)
EndIf
EndFunc
Func CheckCount()
If $runMade >= $KillBeforeVendoring Then
Sleep(Random(500,600))
Teleport()
Town()
Else
If $runMadeB >= $KillBeforeVendoringJunk Then
Sleep(Random(500,600))
Teleport()
Town()
Else
Sleep(Random(500,600))
Send("4")
Sleep(Random(500,600))
Send("3")
Sleep(Random(900,1000))
Send("t")
Sleep(Random(6500,7500))
EndIf
EndIf
EndFunc
Func ResumeGame()
; move the mouse to be sure it's not over the pixel we're looking for
MouseMove(100, 100, 1)
$Searching = True
while $Searching
$Pixel3 = PixelSearch(800,550,1125,610,0xf3aa55 )
if Not @error Then
$Pixel = PixelSearch(800, 610, 1125, 660, 0xf3aa55)
if Not @error Then
; this check return if there is a button under the one we,re going to click. If there is not, we're on the select character screen and would click on "exit game" if we proceed
Sleep(100)
MouseClick("left", GetRandomInt(810,1115), GetRandomInt(560, 600)) ;button to leave game
Sleep(1000)
$Searching = False
EndIf
Else
Sleep(500)
Send("{ESCAPE}") ;opens menu
Sleep(50)
StatusCheck()
Sleep(1000)
EndIf
WEnd
; check if profile screen is open
$Pixel3 = PixelSearch(1565,98,1593,126,0xffd794 )
if Not @error Then
Sleep(50)
Send("{ESCAPE}") ;close profile
Sleep(50)
StatusCheck()
Sleep(50)
EndIf
$Searching = True
while $Searching
$Pixel3 = PixelSearch(60,384,411,450,0x3c0700 )
if Not @error Then
Sleep(2000)
MouseClick("left", GetRandomInt(70,401), GetRandomInt(394,440)) ;button to resume game from main menu
Sleep(1000)
$Searching = False
EndIf
WEnd
Sleep(100)
while Loading()
Sleep(100)
;will get out of the loop when loading is over and resume the script
WEnd
EndFunc