Better solution to finding cave exit?
I'm currently working on a troll fighting script, and one procedure I have is to exit the troll cave. Right now I'm locating the top of the barrels near the exit, and doing a messy mouse move with coordinates for where the exit should be. Is there a more elegant and reliable solution that anyone can think of? (If you're testing this I used DirectX for the colors, it seems to work on all machines)
Note: This is for the troll cave north of Burthorpe.
Simba Code:
procedure exitCave();
var
x, y, i : Integer;
cavePoint : TPoint;
bucketArray : TPointArray;
bucket2Array : T2DPointArray;
begin
minimap.clickCompass(false);
mainScreen.setAngle(MS_ANGLE_HIGH);
findColorsSpiralTolerance(x, y, bucketArray, 7105611, mainScreen.getBounds(), 3, colorSetting(2, 16.51, 0.38));
if (length(bucketArray) < 1) then
begin
writeLn('Failed to find bucket, make debug here');
terminatescript;
end;
bucket2Array := bucketArray.toATPA(15, 15);
bucket2Array.filterBetween(1, 30);
bucket2Array.sortBySize(true);
if (length(bucket2Array) < 1) then
writeLn('Failed to find bucket 2D, make debug here');
terminatescript;
smartimage.debugATPA(bucket2Array);
for (i := 0) to high(bucket2Array) do
begin
cavePoint.create(bucket2Array[0].getMiddle().x - 60, bucket2Array[0].getMiddle().y + 50);
mouse(cavePoint, MOUSE_MOVE, MOUSE_HUMAN);
if (isMouseOverText(['nter'])) then
begin // mouseover found, click and exit
fastClick(MOUSE_LEFT);
smartImage.clear();
wait(5000);
minimap.clickCompass(false);
mainScreen.setAngle(MS_ANGLE_HIGH);
exit;
end
end;
begin
writeLn('Could not locate cave entrance, make debug here');
terminatescript;
end;
end;