Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- ;-----------------------------------------------------
- ;-----------------------------------------------------
- ; Settings
- $SearchForWhite = False ;True / False Activate/Deactivate white looting (will not pick potions / gems either)
- $SearchForBlue = True ;True / False Activate/Deactivate blue looting
- $KeepPotion = True ;True / False Activate/Deactivate dropping potion in stash
- $KeepGems = False ;True / False Activate/Deactivate dropping in stash
- $SarkothKillBeforeVendoring = 10 ;Number of kill before going to town to deposit and vendor
- $LootingLoopCount = 2 ;Number of times you try looting items on the ground (increasing will increase the chance of unstucking yourself and keep looting)
- $TimeOffset = 0 ;Increase this if you stop running before reaching the cellar door (1000 = 1 second)
- $SalvageBlues = True ;True / False Activate/Deactivate Salavage of blues
- ;-----------------------------------------------------
- ;-----------------------------------------------------
- $go = True
- $Run = False
- $runMade = 0
- While $go
- if($Run) Then
- $Pixel1 = PixelSearch(1500,57,1535,95,0xFFF000) ;searches top right screen for yellow of broken armor
- If Not @error Then
- ;we need to repair
- Send("t")
- Sleep(8000)
- MouseClick("left", 1480, 281) ;begin movement towards merchant
- Sleep(1500)
- MouseClick("left", 1316, 206) ;moves to get merchant in screen
- Sleep(1500)
- MouseClick("left", 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(200);
- ResumeGame()
- Else
- ;starts the run
- MouseClick("left", 54, 129)
- Sleep(1300)
- Send("2")
- Sleep(600)
- Send("1")
- Sleep(1000)
- MouseClick("left", 87, 429)
- Sleep(1500 + $TimeOffset)
- Send("1")
- Sleep(random(800,1000))
- Send("3")
- MouseMove(203, 186,1) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
- Sleep(Random(500,750))
- if(StatusCheck()) Then
- $Pixel2 = PixelSearch(92,123,247,187,0xffffff) ;searches for the white pixel in the cellar name
- If Not @error Then
- MouseClick("left",203, 186) ;Entrance to cellar
- Sleep(2000)
- Send(2)
- Sleep(2800)
- while Loading()
- ; "pause" the script until loading is over
- WEnd
- MouseClick("left", 531, 769)
- Send(4)
- Sleep(2000)
- MouseClick("left", 547, 490) ;moves to doorway leading to rare inside cellar
- Sleep(1500)
- MouseMove(624,258,1) ;hovers over the rare Sarkoth
- Send("{SHIFTDOWN}")
- MouseDown("right")
- Sleep(5200)
- MouseMove(474, 273, 1) ;attack left, add more sleep time if you can't kill minion on left
- Sleep(1000)
- MouseMove(732, 232, 1) ;attack right
- Sleep(500)
- MouseMove(624,258, 1) ;attack mid again
- Sleep(1000)
- MouseUP("right")
- Send("{SHIFTUP}")
- Sleep(1500)
- Looting()
- if (StatusCheck()) Then
- Sleep(1500)
- Send("t")
- Sleep(10200)
- Town()
- ResumeGame()
- EndIf
- Else
- if(StatusCheck()) Then
- Sleep(random(300,450))
- Send(3);added/changed
- Sleep(random(150,200))
- Send(3)
- Sleep(random(125,225))
- Send(2)
- Sleep(random(100,125)); added/CHANGED
- Send("t")
- Sleep(8200)
- ResumeGame()
- 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()
- $cnt = 0
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(0,0,1950,1120,0x6969ff)
- if Not @error Then
- Send("{ALTDOWN}")
- Send("{ALTUP}")
- MouseClick("left", $Pixel3[0], $Pixel3[1])
- Sleep(1000)
- $cnt = $cnt + 1
- if $cnt > 8 Then
- $Searching = False
- EndIf
- Else
- $Searching = False
- EndIf
- WEnd
- EndFunc
- Func SearchYellow()
- $cnt = 0
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(0,0,1950,1120,0xe0e205)
- if Not @error Then
- Send("{ALTDOWN}")
- Send("{ALTUP}")
- MouseClick("left", $Pixel3[0], $Pixel3[1])
- Sleep(1000)
- $cnt = $cnt + 1
- if $cnt > 8 Then
- $Searching = False
- EndIf
- Else
- $Searching = False
- EndIf
- WEnd
- $cnt = 0
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(0,0,1950,1120,0xc5c509)
- if Not @error Then
- Send("{ALTDOWN}")
- Send("{ALTUP}")
- MouseClick("left", $Pixel3[0], $Pixel3[1])
- Sleep(1000)
- $cnt = $cnt + 1
- if $cnt > 8 Then
- $Searching = False
- EndIf
- Else
- $Searching = False
- EndIf
- WEnd
- $cnt = 0
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(0,0,1950,1120,0xd4d711)
- if Not @error Then
- Send("{ALTDOWN}")
- Send("{ALTUP}")
- MouseClick("left", $Pixel3[0], $Pixel3[1])
- Sleep(1000)
- $cnt = $cnt + 1
- if $cnt > 8 Then
- $Searching = False
- EndIf
- Else
- $Searching = False
- EndIf
- WEnd
- $cnt = 0
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(0,0,1950,1120,0xdddd00)
- if Not @error Then
- Send("{ALTDOWN}")
- Send("{ALTUP}")
- MouseClick("left", $Pixel3[0], $Pixel3[1])
- Sleep(1000)
- $cnt = $cnt + 1
- if $cnt > 8 Then
- $Searching = False
- EndIf
- Else
- $Searching = False
- EndIf
- WEnd
- EndFunc
- Func SearchOrange()
- $cnt = 0
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(0,0,1950,1120,0x9b5227)
- if Not @error Then
- Send("{ALTDOWN}")
- Send("{ALTUP}")
- MouseClick("left", $Pixel3[0], $Pixel3[1])
- Sleep(1000)
- $cnt = $cnt + 1
- if $cnt > 8 Then
- $Searching = False
- EndIf
- Else
- $Searching = False
- EndIf
- WEnd
- EndFunc
- Func SearchWhite()
- ;if $SearchForWhite = 1 Then
- $cnt = 0
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(350,200,1350,800,0xeeeeee)
- if Not @error Then
- Send("{ALTDOWN}")
- Send("{ALTUP}")
- MouseClick("left", $Pixel3[0], $Pixel3[1])
- Sleep(1000)
- $cnt = $cnt + 1
- if $cnt > 8 Then
- $Searching = False
- EndIf
- Else
- $Searching = False
- EndIf
- WEnd
- ; EndIf
- EndFunc
- Func Town()
- $runMade = $runMade + 1
- If $runMade > $SarkothKillBeforeVendoring Then
- $runMade = 0
- if($SalvageBlues)Then
- ReachBlacksmith()
- Sleep(3500)
- Else
- MouseClick("left", 1064, 256) ;go to chest
- Sleep(2000)
- EndIf
- MouseClick("left", 517, 251) ; 1st tab
- Sleep(500);
- DropInChest();
- MouseClick("left", 517, 378) ; 2nd tab
- Sleep(500);
- DepositRare()
- MouseClick("left", 517, 500) ; 3rd tab
- Sleep(500);
- DepositRare()
- Sleep(500);
- Send("{ESCAPE}") ;close windows
- Sleep(500)
- MouseClick("left", 1541, 238) ;go half way to vendor
- Sleep(2000)
- if($SalvageBlues)Then
- MouseClick("left", 956, 132) ;go to vendor
- Else
- MouseClick("left", 1105, 225) ;go to vendor
- EndIf
- Sleep(2000)
- VendorAll()
- MouseClick("left", 506, 483) ;click repair tab
- Sleep(200)
- MouseClick("left", 242, 528) ;click repair
- Sleep(200)
- Send("{ESCAPE}") ;close windows
- Sleep(500)
- EndIf
- 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
- Return True
- EndFunc
- Func Looting()
- For $i = 1 To $LootingLoopCount
- if ($SearchForBlue) Then
- SearchBlue()
- EndIf
- SearchYellow()
- SearchOrange()
- if ($SearchForWhite) Then
- SearchWhite()
- EndIf
- Sleep(500)
- Next
- EndFunc
- Func DropInChest()
- ; Tome of secret
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x507554 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; mystic potion
- if($KeepPotion) Then
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x4a1008 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- EndIf
- if ($KeepGems = False) Then
- Return
- EndIf
- ; Yellow gems
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xce8200 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; Yellow gems
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xc17900 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; Green gems
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x319e31 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; Green gems
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x3db835 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; Red gems
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xf01d1f)
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; Red gems
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xe90b0b)
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; Red gems
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xe80a0a)
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; Red gems
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xef0d11)
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; Purple gems
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x9905db )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; Purple gems
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xb110f7 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- DepositCraftingMats()
- EndFunc
- Func DepositCraftingMats()
- ;inferno dust
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xc6a6e3 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ;hell dust
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xddd2a5 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; brimstone
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xac2a02 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; hell yellow mats
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xe0c49f )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; inferno yellow mats
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xffbea5 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- EndFunc
- Func VendorAll()
- For $i = 0 To 9 Step 1
- MouseClick("right", 1432 + (50 * $i), 609)
- Sleep(25)
- MouseClick("right", 1432 + (50 * $i), 609 + 50)
- Sleep(25)
- MouseClick("right", 1432 + (50 * $i), 609 + 100)
- Sleep(25)
- MouseClick("right", 1432 + (50 * $i), 609 + 150)
- Sleep(25)
- MouseClick("right", 1432 + (50 * $i), 609 + 200)
- Sleep(25)
- MouseClick("right", 1432 + (50 * $i), 609 + 250)
- Sleep(25)
- Next
- EndFunc
- Func SellBlue($mouseBtn)
- ; 1st color
- ; 2 slots items
- ;$Searching = True
- ;while $Searching
- ; $Pixel3 = PixelSearch(1400,584,1900,874,0x161829 )
- ; if Not @error Then
- ; TrayTip("found blue:", "color: 1", 1)
- ; MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
- ; Sleep(500)
- ; Else
- ; $Searching = False
- ; EndIf
- ;WEnd
- ; 1 slots items
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x161c36 )
- if Not @error Then
- TrayTip("found blue:", "color: 2", 1)
- MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; more color
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x13233c )
- if Not @error Then
- TrayTip("found blue:", "color: 3", 1)
- MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; more color
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x182343 )
- if Not @error Then
- TrayTip("found blue:", "color: 4", 1)
- MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; more color
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x233055 )
- if Not @error Then
- TrayTip("found blue:", "color: 5", 1)
- MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; more color
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x102039 )
- if Not @error Then
- TrayTip("found blue:", "color: 6", 1)
- MouseClick($mouseBtn, $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- EndFunc
- Func SellWhite()
- ; more color
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xffffff )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- endFunc
- Func DepositRare()
- ;Yellow
- ;1st color
- ; 2 slots items
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x604f0b )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; 1 slots items
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x5a4d10 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; more color
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x5d4e10 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; more color
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x66580f )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; more color
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0xf5f500 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; more color
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x554914 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ;orange
- ; 2 slots items
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x593212 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- ; 1 slots items
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(1400,584,1900,874,0x693e12 )
- if Not @error Then
- MouseClick("right", $Pixel3[0], $Pixel3[1])
- Sleep(500)
- Else
- $Searching = False
- EndIf
- WEnd
- 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
- 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
- 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
- MouseClick("left", 910, 630)
- ResumeGame()
- Return False
- EndIf
- EndIf
- Return True
- EndFunc
- Func ReachBlacksmith()
- MouseClick("left", 1800, 500)
- Sleep(2000)
- MouseClick("left", 1475, 400)
- Sleep(1000)
- MouseClick("left", 260, 300)
- Sleep(500)
- SellBlue("left")
- Sleep(1000)
- Send("{ESCAPE}")
- Sleep(500)
- MouseClick("left", 30, 280)
- EndFunc
- Func Loading()
- $Pixel3 = PixelSearch(1700,168,1775,240,0x00a6ff )
- if Not @error Then
- ; pixel found = loading is over
- Return False
- EndIf
- ;Still on loading screen
- return True
- 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
- MouseClick("left", 956, 579) ;button to leave game
- $Searching = False
- Else
- Send("{ESCAPE}") ;opens menu
- Sleep(1000)
- EndIf
- WEnd
- ; check if profile screen is open
- $Pixel3 = PixelSearch(1565,98,1593,126,0xffd794 )
- if Not @error Then
- Send("{ESCAPE}") ;close profile
- EndIf
- $Searching = True
- while $Searching
- $Pixel3 = PixelSearch(60,384,411,450,0x3c0700 )
- if Not @error Then
- MouseClick("left", 230, 416) ;button to resume game from main menu
- ;Sleep(8000)
- $Searching = False
- EndIf
- WEnd
- while Loading()
- ;will get out of the loop when loading is over and resume resume the script
- WEnd
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement