rapid_spitfire
2014-05-11 14:34:49
Hey all, i've made an Al-Kharid tanner script, using mostly modified code from mayors all in one tutorial. It works alright but sometimes it fails to find "Ellis"(tanner) because he's behind a wall or something while its searching for his color, then it runs back to the bank without tanning the cowhides. Anyways just wondering how i could make it keep searching for him until it finds him and right clicks him. Here's the code i use. I'm 3 days in so its very novice.
procedure Rtan();
var
myBox: TBox;
x, y,i,d: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
wait(randomRange(500,1500));
findColorsSpiralTolerance(x, y, TPA, 15333370, mainScreen.getBounds(), 1, colorSetting(2, 0.99, 10.96));
if length(TPA) < 1 then
exit;
smartImage.debugTPA(TPA, false);
ATPA := TPA.toATPA(30,30);
ATPA.filterBetween(0, 3);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
MiddleTPAEx((ATPA[i]), x, y);
mouse(x, y, 10, 30, MOUSE_MOVE);
if isMouseOverText(['llis'], 5000) then
begin
// GetMousePos(x,y);
fastClick(MOUSE_RIGHT);
if chooseOption.select(['ides'])then
wait(randomRange(1200,3400));
myBox := intToBox(287, 329, 508, 350);
mouseBox(myBox, MOUSE_LEFT);
smartImage.clear;
wait(randomRange(100,1000));
end;
end;
end;
