SRL Archive - Help and Support

This


Pure1993

2008-05-02 16:26:11

Hi,
I tried to work out that thing with autocoloring using RGB coloring, but i failed miserably, but that doesn't change the fact that i need an autocoloring function for a building in lumbirdge, here is a pic, i put a red box around the building. Could anyone please make me one which actually works? the thing is with "autocolorthis" is that the roadcolor and the color of that building get to close to each other, so that it mistakes them.
If anyone would o this for me, I'd be reallz greatful! :)
Thank you,
Pure1993
PS: I am still eager to learn, so if anyone wants to take it upon himself/herself to teach me, just leave me a message :D

Cazax

2008-05-02 16:29:05

function HouseColor: Integer; 
var
X,Y,Z : Extended;
R,G,B,P,A,TestColor,xx,xy : Integer;
TPA : TPointArray;
begin
if Not(LoggedIn) then Exit;
xx:= MMCX;
xy := MMCY;
FindColorsSpiralTolerance(xx, xy, TPA, 4739921, MMX1, MMY1, MMX2, MMY2, 60)
P := High(TPA);
for A := 0 to P do
begin
if RS_OnMinimap(TPA[A].X, TPA[A].Y) then
begin
TestColor := GetColor(TPA[A].X, TPA[A].Y);
if SimilarColors(TestColor, 4739921, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -22, 18) then
if InRange(R - B, -11, 29) then
if InRange(G - B, -9, 31) then
if InRange(Round(X) - Round(Y), -7, 7) then
if InRange(Round(Y) - Round(Z), -6, 8) then
if GetColor(TPA[A].X + 2, TPA[A].Y + 2) = TestColor then
if GetColor(TPA[A].X + 1, TPA[A].Y + 1) = TestColor then
begin
Writeln(HouseColor = +Inttostr(TestColor));
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find Color!');
Result := 0;
end;
If you want to know how to make 'em click in my sig :)

Pure1993

2008-05-02 17:12:56

Haha, guess on which thread i learned the basics but failed on the advanced stuff? I am having problems with defining the right values in the InRange thing, but I will go over your guide once more, maybe i missed something ;)
But thanks a lot! Your name is alreadz in the credits. :) (now let's just hope I am going to finish this, so the credits will go public :D)