Log in

View Full Version : Help With Finding Astral Altar Unique Colours



kingob
01-27-2012, 03:57 AM
So I am currently messing around with Simba by going through scripts, looking for things that I dont understand and then trying to figure them out by using the Function, Procedure etc in a different place in runescape so that I am forced to change it. It has been working out well so far and I have learnt a bunch of new stuff, but this has been bugging me.

I have started using the DTM editor to find unique colours in places that seem to be all the same colour e.g. Astral Alter all the rocks are the same colour or in Lumbridge Caves all the stepping stones are the same Colour as the ground. But here I actually managed to find some unique colours up to a tolerance of 5. But when I try them out using a function from one of Flights scripts it is not able to find the unique colours.

Any help would be appreciated as I have been messing around with this one test for about 2 hours!
Thanks!

AColours := [9147026, 8748931, 9278355];

Function FindAltar(Var X,Y: Integer): Boolean;

var
B: TBox;
Loop: Boolean;
TPA: TPointArray;
Hmod,Smod: Extended;
L,i,Tol,CTS,Col,F,MSP: Integer;
ATPA: T2DPointArray;
label
Start;
begin
Result := False;
Loop := False;
CTS := GetColorToleranceSpeed;

Start:
ColorToleranceSpeed(2);
ReturnValues(AColours, Hmod, Smod, Col, Tol);
SetColorSpeed2Modifiers(Hmod, SMod);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Col, MSX1, MSY1, MSX2, MSY2, 10);
ColorToleranceSpeed(CTS);

if (Length(TPA) < 1) then
Exit;

ATPA := TPAToATPAEx(TPA, 20, 20);
SortATPAFrom(ATPA, Point(MSCX,MSCY));
L := High(ATPA);
SetArrayLength(ATPA, L+1);

for i := 0 to L do
begin
if (GetArrayLength(ATPA[i]) > 30) then
begin
B := GetTPABounds(ATPA[i]);

MiddleTPAEx(ATPA[i], X, Y);
MSP := MouseSpeed;
MouseSpeed := (RandomRange(26, 33));
HumanMMouse(X, Y, 15, 15);
MouseSpeed := MSP;
if WaitUpTextMulti(['-rune', 'unec', 'rafting'], 555) then
begin
Result := True;
GetMousePos(X, Y);
Exit;
end else
begin
Inc(F);
if (F > 7) then
Exit;
Loop := True;
Break;
end;

end;
end;
if Loop then
goto Start;

end;

shadowmarkus
01-27-2012, 04:02 AM
Increase tolerance, or download ACA and use autocolor? (http://villavu.com/forum/showthread.php?t=26944)

THIS is goodies. Really good for visualizing the colors.

Flight
01-27-2012, 04:32 AM
Use this mate:

Function FindObjEx_F(ColorA, ColorB, Tol, Bounds, sX, sY: Integer; UpText: TStringArray; Var X, Y: Integer): Boolean;
var
B: TBox;
TPA: TPointArray;
L,i,CTS: Integer;
ATPA,ATPA2: T2DPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(sX, sY, TPA, ColorA, MSX1, MSY1, MSX2, MSY2, Tol);
if Length(TPA) < 1 then
begin
ColorToleranceSpeed(CTS);
Exit;
end;
ATPA := TPAtoATPAEx(TPA, Bounds, Bounds);
L := High(ATPA);
SetArrayLength(ATPA2, L+1);
for i := 0 to L do
begin
B := GetTPABounds(ATPA[i]);
with B do
begin
FindColorsSpiralTolerance(sX, sY, ATPA2[i], ColorB, B.X1-Bounds, B.Y1-Bounds, B.X2+Bounds, B.Y2+Bounds, Tol);
ColorToleranceSpeed(CTS);
if Length(ATPA2[i]) > 0 then
begin
MiddleTPAEx(ATPA2[i], X, Y);
HumanMMouse(X, Y, 5, 5);
if WaitUpTextMulti(UpText, 150) then
begin
Result := True;
GetMousePos(X, Y);
Exit;
end;
end;
end;
end;
end;


And here is the correct settings for finding the Astral altar (personally used in Astralz (http://stats.villavu.com/script/115))

if FindObjEx_F(6514535, 10133921, 15, 10, MSCX+50, MSCY, ['Craft','rune','Altar'], X, Y) then
begin

kingob
01-27-2012, 12:27 PM
Thanks Flight! But what was I doing wrong? Was I just using wrong colours, or was it the tolerance?

shadowmarkus
01-28-2012, 03:10 AM
Thanks Flight! But what was I doing wrong? Was I just using wrong colours, or was it the tolerance?

If you study his script, and compare it to yours, you will spot the difference :P