hi guys im new here and would like to thank you all for the great help you guys gave me.
I had an issue with the latest script from wet willy regarding the path that the character took.
So i decide to combien notares and wetwilly's script into one .
So this scripts does the autorepair and pick up blue and yellow items.
once your inventory is full its sells all the blue item and pute the yellow ones in your stash.(for this to work you need to make sure that the first page of your stash is empty.
I've been running it all day without any issue .
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
$walktime = 3000 ; 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 (repair icon)
$red = 0xD90000 ; red color code (repair icon)
$LootRares = True ; Change this to false if you don't want the bot to pick up rares (good for legendary/set only, recommend setting LootGems to False)
$LootGems = False ; Change this to true if you want to pick up gems (messy, can fill up bag with whites/blues)
$Amethyst = 0xAC7FFF
$Ruby = 0xB01D2D
$Emerald = 0x58EE33
$Topaz = 0xFFFF59
$go = True
$Leave = False
$default_resolutionX = 1920
$default_resolutionY = 1080
$x_ratio = @Desktopwidth / $default_resolutionX
$y_ratio = @Desktopheight / $default_resolutionY
$i = 0
While $go
if($Leave) Then
Call("CheckDead")
Call("CheckLogout")
Call("CheckBag")
Call("Logout")
$Pixel1 = PixelSearch(1482,20,1535,95,0xFFF000) ;searches top right screen for yellow of broken armor
If Not @error Then
Send("t")
Sleep(7200)
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}") ;opens menu
Sleep(10)
Send("{ESCAPE}") ;opens menu
Sleep(1000)
MouseClick("left", 956, 579) ;button to leave game
Sleep(4000)
MouseClick("left", 230, 416) ;button to resume game from main menu
Sleep(4000)
Else
$i = 0
MouseClick("middle", Round(500*$x_ratio), Round(250*$y_ratio)) ;starts the run [waypoint 1]
Sleep(900)
Send("2")
Sleep(250)
MouseClick("middle", 1, Round(370*$y_ratio)) ;waits ~1 second then [waypoint 2]
Sleep(1500)
MouseClick("middle", Round(400*$x_ratio), Round(600*$y_ratio)) ;middle of courtyard [waypoint 3]
Sleep(40)
Send("2")
Sleep(20)
Send("3")
Sleep(600)
Send("1")
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(790)
Call("CheckDead")
Call("CheckLogout")
$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
MouseClick("left",Round(300*$x_ratio),Round(100*$y_ratio)) ;Entrance to cellar
Sleep(300)
Send("2")
Sleep($walktime)
MouseClick("middle",Round(110*$x_ratio),Round(1000*$y_ratio)) ;moves to doorway leading to rare inside cellar
Sleep(2500)
MouseMove(Round(440*$x_ratio),Round(80*$y_ratio),1) ;hovers over the rare Sarkoth
Sleep(10)
Send("{SHIFTDOWN}")
MouseDown("right") ;attack middle
Sleep(1200)
Send("4")
Sleep(3000)
MouseUp("right")
MouseClick("left",Round(440*$x_ratio),Round(80*$y_ratio),2)
MouseMove(Round(240*$x_ratio),Round(75*$y_ratio),1) ;attack left
Sleep(40)
MouseDown("right")
Sleep(2800)
MouseUp("right")
MouseMove(Round(590*$x_ratio),Round(50*$y_ratio),1) ;attack right
MouseDown("right")
Sleep(1800)
MouseUp("right")
MouseDown("left")
MouseMove(Round(Random(240,260)*$x_ratio),Round(75*$y_ratio),1) ;attack left
Sleep(1200)
MouseMove(Round(Random(560,600)*$x_ratio),Round(50*$y_ratio),1) ;attack right
Sleep(1200)
MouseUP("left")
Sleep(10)
MouseClick("right",Round(620*$x_ratio),Round(20*$y_ratio),2) ;break the table & chair
Sleep(10)
Send("{SHIFTUP}")
Sleep(400)
MouseClick("middle",Round(530*$x_ratio),Round(170*$y_ratio)) ;location of sarkoth after death
Sleep(2100)
MouseClick("middle",Round(580*$x_ratio),Round(460*$y_ratio)) ;move to left top corner for gold
Sleep(1100)
MouseClick("middle",Round(1330*$x_ratio),Round(330*$y_ratio)) ;move to right top corner for gold
Sleep(1100)
Send("4")
MouseClick("middle",Round(1010*$x_ratio),Round(940*$y_ratio)) ;move to middle before looting
Call("CheckLoot")
Sleep(800)
Call("CheckBag")
Sleep(800)
Send("t")
Sleep(7200)
Call("CheckDead")
Call("Logout")
Else
Sleep(10)
MouseClick("middle",Round(1100*$x_ratio),Round(600*$y_ratio)) ;moves between caltrops for safety before teleporting back to town
Sleep(200)
Send("1")
Sleep(620)
Send("2")
Sleep(40)
Send("t")
Sleep($tptime)
Call("CheckDead")
Call("Logout")
EndIf
EndIf
EndIf
WEnd
Func CheckLoot()
If ($i < 8) Then
Sleep(Random(300,600))
Call("CheckBag")
$Pixel12 = PixelSearch(378, 317, 1412, 731, 0x6969FF); magic loot
If Not @error Then
MouseClick ('left', $Pixel12[0], $Pixel12[1])
Sleep(Random(400,800))
Call("CheckLoot")
EndIf
$Pixel4 = PixelSearch(378, 317, 1412, 731,0xBF642F,1) ; legendary lootz
If Not @error Then
MouseClick ('left', $Pixel4[0], $Pixel4[1])
Sleep(Random(400,800))
Call("CheckLoot")
EndIf
$Pixel5 = PixelSearch(378, 317, 1412, 731, 0xFFFF00,1) ; rare lootz
If Not @error Then
MouseClick ('left', $Pixel5[0], $Pixel5[1])
Sleep(Random(400,800))
Call("CheckLoot")
EndIf
$Pixel10 = PixelSearch(378, 317, 1412, 731, 0x00FF00,1); set loot
If Not @error Then
MouseClick ('left', $Pixel10[0], $Pixel10[1])
Sleep(Random(400,800))
Call("CheckLoot")
EndIf
$Pixel11 = PixelSearch(378, 317, 1412, 731, 0x6969FF); magic loot 2
If Not @error Then
MouseClick ('left', $Pixel11[0], $Pixel11[1])
Sleep(Random(400,800))
Call("CheckLoot")
EndIf
$i = $i + 1
EndIf
EndFunc
Func CheckDead()
$Pixeltest = PixelGetColor(740, 850)
If Hex($Pixeltest, 6) == "0C0404" OR Hex($Pixeltest, 6) == "310000" Then
Sleep(100)
Send("{Escape}")
Sleep(10)
MouseClick("left", 956,579) ;button to leave game
Sleep(10000)
Sleep(4000)
MouseClick("left", 230,416) ;button to resume game from main menu
Sleep(4000)
EndIf
EndFunc
Func Logout()
$Pixeltest1 = PixelGetColor(704, 918)
If Hex($Pixeltest1, 6) == "598A8D" Then
Sleep(100)
Send("{Escape}")
Sleep(10)
MouseClick("left", 956,579) ;button to leave game
Sleep(4000)
MouseClick("left", 230,416) ;button to resume game from main menu
Sleep(4000)
EndIf
EndFunc
Func CheckLogout()
$Pixeltest3 = PixelGetColor(960, 290)
If Hex($Pixeltest3, 6) == "400400" Then
Sleep(10000)
Sleep(4000)
MouseClick("left", 230, 416) ;button to resume game from main menu
Sleep(4000)
EndIf
EndFunc
Func CheckBag()
Send("i")
Sleep(500)
$Pixel7 = PixelSearch(1651, 82, 1655, 78, 0xC8C55D)
If Not @error Then
Sleep(300)
$Pixel7 = PixelSearch(1869, 794, 1871, 815, 0x140C08, 1)
If Not @error Then
Send("i")
Sleep(500)
Else
Send("i")
Sleep(100)
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)
;selling items
MouseClick("right", 1436, 612);1
Sleep(Random(80, 200))
MouseClick("right", 1436, 680);1.5
Sleep(Random(80, 200))
MouseClick("right", 1478, 613);2
Sleep(Random(80, 200))
MouseClick("right", 1530, 615);3
Sleep(Random(80, 200))
MouseClick("right", 1573, 608);4
Sleep(Random(80, 200))
MouseClick("right", 1622, 607);5
Sleep(Random(80, 200))
MouseClick("right", 1670, 610);6
Sleep(Random(80, 200))
MouseClick("right", 1722, 609);7
Sleep(Random(80, 200))
MouseClick("right", 1786, 610);8
Sleep(Random(80, 200))
MouseClick("right", 1809, 612);9
Sleep(Random(80, 200))
MouseClick("right", 1886, 612);10
Sleep(Random(80, 200))
MouseClick("right", 1869, 703);11
Sleep(Random(80, 200))
MouseClick("right", 1818, 703);12
Sleep(Random(80, 200))
MouseClick("right", 1759, 706);13
Sleep(Random(80, 200))
MouseClick("right", 1728, 706);14
Sleep(Random(80, 200))
MouseClick("right", 1672, 706);15
Sleep(Random(80, 200))
MouseClick("right", 1628, 703);16
Sleep(Random(80, 200))
MouseClick("right", 1578, 705);17
Sleep(Random(80, 200))
MouseClick("right", 1529, 703);18
Sleep(Random(80, 200))
MouseClick("right", 1481, 707);19
Sleep(Random(80, 200))
MouseClick("right", 1432, 705);20
Sleep(Random(80, 200))
MouseClick("right", 1432, 804);21
Sleep(Random(80, 200))
MouseClick("right", 1483, 802);22
Sleep(Random(80, 200))
MouseClick("right", 1530, 802);23
Sleep(Random(80, 200))
MouseClick("right", 1582, 804);24
Sleep(Random(80, 200))
MouseClick("right", 1625, 808);25
Sleep(Random(80, 200))
MouseClick("right", 1675, 799);26
Sleep(Random(80, 200))
MouseClick("right", 1722, 802);27
Sleep(Random(80, 200))
MouseClick("right", 1775, 799);28
Sleep(Random(80, 200))
MouseClick("right", 1821, 802);29
Sleep(Random(80, 200))
MouseClick("right", 1865, 799);30
Sleep(Random(80, 200))
MouseClick("right", 1434, 748);25
Sleep(Random(80, 200))
MouseClick("right", 1483, 752);26
Sleep(Random(80, 200))
MouseClick("right", 1532, 752);27
Sleep(Random(80, 200))
MouseClick("right", 1437, 846);28
Sleep(Random(80, 200))
MouseClick("right", 1484, 846);29
Sleep(Random(80, 200))
MouseClick("right", 1531, 850);30
Sleep(Random(80, 200))
MouseClick("left", 521, 506) ;button to open up repair menu
Sleep(1000)
MouseClick("left", 260, 595) ;button to pay for repairs
Sleep(2000)
Send("{ESCAPE}") ;menu
Sleep(500)
MouseClick("left", 257, 1044)
Sleep(2300)
MouseClick("left", 756, 684)
Sleep(1700)
MouseClick ('left', 810, 545)
Sleep(500)
;storing items
MouseClick("right", 1436, 612);1
Sleep(Random(80, 200))
MouseClick("right", 1436, 680);1.5
Sleep(Random(80, 200))
MouseClick("right", 1478, 613);2
Sleep(Random(80, 200))
MouseClick("right", 1530, 615);3
Sleep(Random(80, 200))
MouseClick("right", 1573, 608);4
Sleep(Random(80, 200))
MouseClick("right", 1622, 607);5
Sleep(Random(80, 200))
MouseClick("right", 1670, 610);6
Sleep(Random(80, 200))
MouseClick("right", 1722, 609);7
Sleep(Random(80, 200))
MouseClick("right", 1786, 610);8
Sleep(Random(80, 200))
MouseClick("right", 1809, 612);9
Sleep(Random(80, 200))
MouseClick("right", 1886, 612);10
Sleep(Random(80, 200))
MouseClick("right", 1869, 703);11
Sleep(Random(80, 200))
MouseClick("right", 1818, 703);12
Sleep(Random(80, 200))
MouseClick("right", 1759, 706);13
Sleep(Random(80, 200))
MouseClick("right", 1728, 706);14
Sleep(Random(80, 200))
MouseClick("right", 1672, 706);15
Sleep(Random(80, 200))
MouseClick("right", 1628, 703);16
Sleep(Random(80, 200))
MouseClick("right", 1578, 705);17
Sleep(Random(80, 200))
MouseClick("right", 1529, 703);18
Sleep(Random(80, 200))
MouseClick("right", 1481, 707);19
Sleep(Random(80, 200))
MouseClick("right", 1432, 705);20
Sleep(Random(80, 200))
MouseClick("right", 1432, 804);21
Sleep(Random(80, 200))
MouseClick("right", 1483, 802);22
Sleep(Random(80, 200))
MouseClick("right", 1530, 802);23
Sleep(Random(80, 200))
MouseClick("right", 1582, 804);24
Sleep(Random(80, 200))
MouseClick("right", 1625, 808);25
Sleep(Random(80, 200))
MouseClick("right", 1675, 799);26
Sleep(Random(80, 200))
MouseClick("right", 1722, 802);27
Sleep(Random(80, 200))
MouseClick("right", 1775, 799);28
Sleep(Random(80, 200))
MouseClick("right", 1821, 802);29
Sleep(Random(80, 200))
MouseClick("right", 1865, 799);30
Sleep(Random(80, 200))
MouseClick("right", 1434, 748);25
Sleep(Random(80, 200))
MouseClick("right", 1483, 752);26
Sleep(Random(80, 200))
MouseClick("right", 1532, 752);27
Sleep(Random(80, 200))
MouseClick("right", 1437, 846);28
Sleep(Random(80, 200))
MouseClick("right", 1484, 846);29
Sleep(Random(80, 200))
MouseClick("right", 1531, 850);30
Sleep(Random(80, 200))
Send("{ESCAPE}") ;menu
Sleep(500)
EndIf
EndIf
EndFunc
Func Pause()
$Leave = False
EndFunc
Func Stop() ;to allow the script to stop
Exit
EndFunc
Func Leave()
$Leave = True
EndFunc