excellent tutorial, but hey could this possibly be used to check if one is logged out? and to look for specific colors in certain areas?
excellent tutorial, but hey could this possibly be used to check if one is logged out? and to look for specific colors in certain areas?
alright sweet! =)
Thanks man, cant wait to put this into my script![]()
R: 95
G: 96
B: 88
H: 18.75
S: 4.34782579541206
L: 36.0784322023392
X: 10.6636375115794
Y: 11.5032188520144
Z: 10.8908279770015
Umm this is what I got now what do i do with this?
Lol i did, but what I mean is when you did yours you didnt have decimals in it so I'm asking if its right. -_-//
i have a 25 "sort of " tolerance cause im trying to autocolor the color of a oak tree on the mini map..
SCAR Code:function MMoakcolor: Integer;
var
R,G,B : Integer; // Red, Blue and Red we are going to use them
H,S,L : Extended; // HSL have decimal numbers
X,Y,Z : Extended; // This one too!
MyColor,NewColor : Integer; // The color we are going to 'AutoColor' and the new color is the new color :S
ColorsTPA : TPointArray; // We are going to use TPA's
C1,C2 : TIntegerArray; // we are going to use them later
i : Integer;
begin
MyColor := 18195;
FindColorsSpiralTolerance(MMCX, MMCY, ColorsTPA, MyColor, MMX1, MMY1, MMX2, MMY2, 60);
C1 := GetColors(ColorsTPA);
ClearSameIntegers(C1);
for i := 0 to Length(C1) - 1 do
begin
if rs_OnMinimap(ColorsTPA[i].X, ColorsTPA[i].Y) then
begin
NewColor := GetColor(ColorsTPA[i].X, ColorsTPA[i].Y);
if SimilarColors(NewColor, MyColor, 50) then
begin
ColorToRGB(NewColor, R, G, B);
ColorToHSL(NewColor, H, S, L);
ColorToXYZ(NewColor, X, Y, Z);
if InRange(R - G, -77, -27) then
if InRange(R - B, -6, 44) then
if InRange(G - B, 56, 106) then
if InRange(Round(S) - Round(H), -96, -46) then
if InRange(Round(L) - Round(H), -40, 10) then
if InRange(Round(S) - Round(L), 61, 111) then
if InRange(Round(X) - Round(Y), -17, 13) then
if InRange(Round(Y) - Round(Z), -11, 19) then
if GetColor(colorsTPA[i].X + 2, colorsTPA[i].Y + 2) = NewColor then
if GetColor(colorsTPA[i].X + 1, colorsTPA[i].Y + 1) = NewColor then
begin
Writeln('Color = '+Inttostr(NewColor));
Result := NewColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find the Color!');
Result := 0;
end;
IT WILL NEVER WORK! .. Please tell me why.. and please tell me possible fixes..? Im gonna rep you now for helping me
you might want to show how you changed your second program and implemented it to the myfirstautocolor funcction...because apparently you didnt use the same range of the second program to the autocolor function, because they both are differnt..
Test itSCAR Code:Function FindMMOakTree : Integer;
var
H,S,L,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, 1068078, 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, 1068078, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -50, -10) then
if InRange(R - B, 10, 54) then
if InRange(G - B, 32, 99) then
if InRange(Round(S) - Round(H), 22, 73) then
if InRange(Round(L) - Round(H), -17, 2) then
if InRange(Round(S) - Round(L), 30, 75) then
if InRange(Round(X) - Round(Y), -9, 5) then
if InRange(Round(Y) - Round(Z), 2, 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('MMOakColor = '+Inttostr(TestColor));
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find MMOakColor!');
Result := 0;
end;
So.... ummmm do i call the function in the script and it will find color and idk what to do next rofl.
if you dont know the basics of colors and what autocoloring is used for then go to simpler tuts first
"Failure is the opportunity to begin again more intelligently" (Henry Ford)
Hey Cazax, I promised I would go through your tut again, and guess what, here I am
I am not quite done (well, reading it over for the third time, but this time I will try to really concentrate), but I noticed one thing:
should beSCAR Code:ClearSameInteger(C1);
just a hint for those of you who get the (i think it was) type mismatch error.SCAR Code:ClearSameIntegers(C1);
I will edit this post when I am done and I understood it
EDIT: Well, finished an (mostly) understood (still having problems getting the correct ranges, but I guess that's just a matter of time and practice till I get good enough with it).
Now I only have two questions left:
1.) Why the heck didn't i get this the first and second time I read this?!?!?!!?
2.) Why the heck isn't this stickied? I think it deserves it! Autocoloring is a huge part of rs cheat writing scripts, and everyone should understand what the are using...
Thanks for an awesome guide, rep++ for you.
PS: Now the function which you made for me looks official:
Now it looks like it came straight from the srl librarySCAR Code:{*******************************************************************************
function HouseColor: Integer;
By: Cazax;
Modified by: Pure1993 (Only ironing out the few type mismatches ;D )
Description: Detects the color of the house in the Lumbridge graveyard in which
the ghost appears in the Restless Ghost quest.
*******************************************************************************}
function HouseColor: Integer;
var
X,Y,Z, H, S, L : 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, 3227710, 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;.
There is nothing right in my left brain and there is nothing left in my right brain.
Dang, thanks for this it really helped me out with my script. You get some rep++.
Np Cazax, but you still didn't change the thing i mean, you missed the "s" in ClearSameIntegers.![]()
There is nothing right in my left brain and there is nothing left in my right brain.
There are currently 1 users browsing this thread. (0 members and 1 guests)