Func DoRepair()
$repairCount += 1
If CheckDead() Then
Return
EndIf
If CheckFor("NewTristram", "Area") Then
Sleep(12000)
RandMove(Round(1530 * $x_ratio), Round(0 * $y_ratio), 1, 1) ;begin movement towards merchant
Send("{3 down}")
Sleep(1200)
Send("{3 up}")
MouseClick("left", Round(796 * $x_ratio), Round(474 * $y_ratio), 3) ;NPC Merchant to the right of cain's home
Sleep(1000)
RandClick("left", Round(521 * $x_ratio), Round(506 * $y_ratio), 1, 1) ;button to open up repair menu
Sleep(400)
RandClick("left", Round(260 * $x_ratio), Round(595 * $y_ratio), 1, 1) ;button to pay for repairs
Sleep(200)
Send("{Escape}")
EndIf
EndFunc ;==>DoRepair