Originally Posted by
Elemt
I have the CheckRare() function because in the few cases when a rare ring is in say, row 5, column 10, Everytime, upon resume, it will say you are full. It will go repair, sell but it won't sell that ring and will continue to be full, so the CheckRare() essentially fixes that hang if it occurs. I was going to add a Stash() function that just looped through checking for white and call it after repair/sell like you did.
That's just why I couldn't figure out why it was put in that way, because that situation is avoided completely by just stashing rares upon every full inventory.
Code:
Func InvRepair()
DEBUG("Going to repair")
$slot1x = 538 ; first slot x coordinate
$slot1y = 367 ; first slot y coordinate
$offset = 27 ; offset for each slot
TownPortal()
If InTown() == 1 Then ; TP interrupted, leave game before trying to repair because you are not in Town
Return
Else
Debug("In town, beginning repair trip")
MouseClick("left",465,172) ; clicks stash after town portal
Sleep(1000)
Call("StashLoot")
Send("{SPACE}") ; close stash
MouseClick("left", 686, 94) ; begins movement towards merchant
Sleep(2400)
MouseClick("left", 505, 153) ; clicks merchant
Sleep(1200)
For $i = 0 To 9
For $j = 0 To 5
MouseClick("right", $slot1x + ($i * $offset), $slot1y + ($j * $offset), 1, Random(0,1))
Sleep(Random(35,40))
Next
Next
Click(294, 296) ; open up repair menu
Sleep(200)
Click(186, 326) ; pay for repairs
Sleep(500)
$inBag = PixelSearch(780, 474, 782, 476, 0x130C08,5)
If @error Then
DEBUG("Not at shop")
Send("{ESCAPE}") ; opens menu
Sleep(400)
Click(407, 345) ; leaves
Sleep(12000)
Else
Send("{ESCAPE}") ; closes shop
Sleep(50)
Send("{ESCAPE}") ; opens menu
Sleep(400)
Click(407, 345) ; leaves
Sleep(2000)
EndIf
EndIf
EndFunc
and
Code:
Func StashLoot()
$StashRares = PixelSearch(524,353,796,515,0xFFFFFF)
If Not @error Then
MouseClick ('right', $StashRares[0], $StashRares[1])
Sleep(250)
Call("StashLoot")
EndIf
$StashPattern = PixelSearch(524,353,796,515,0x9F8259, 5)
If Not @error Then
MouseClick ('right', $StashPattern[0], $StashPattern[1])
Sleep(250)
Call("StashLoot")
EndIf
EndFunc
Is just the way I have mine set up. That way I don't even have to worry about the scenario you described, or checking for rares. That goes through as soon as my inventory is full. TP's to town, stops at the stash, drops off all unID'd gear and blacksmith\JC patterns, then goes to sell the loot.