Claymore
2008-10-18 21:09:01
My progress for creating the Law Runecrafting script is progressing well. But i am having problems walking to the Law alter from the ship in the dock. Any tips from professional scripters on how this works? Thanks ;p
2008-10-18 21:09:01
2008-10-18 21:30:56
2008-10-18 21:33:17
2008-10-18 21:49:14
2008-10-18 22:09:08
function FindMMAlter: Boolean;
var
TPA: TPointArray;
P: TPoint;
X, Y: Integer;
begin
FindColorsTolerance(TPA, 537660, MMX1, MMY1, MMX2, MMY2, 5);
Result := (Length(TPA) > 5);
if (Result) then
begin
P := MiddleTPA(TPA);
X := P.X;
Y := P.Y;
Mouse(X, Y, 5, 5, True);
FFlag(5);
Exit;
end;
Exit;
end;
2008-10-19 01:14:43
2008-10-19 02:13:10
function FindTreeColor: Integer;
var
GC, A, L, TestColor: Integer;
P: TPointArray;
begin
GC := 801817;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 70);
L := GetArrayLength(P);
for A := 0 to L-1 do
begin
if rs_OnMinimap(P[A].X, P[A].Y) then
begin
TestColor := GetColor(P[A].X, P[A].Y);
if GetColor(P[A].X+1, P[A].Y) = TestColor - 525792 then
begin
Result := TestColor;
WriteLn('Tree Color = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
WriteLn('Could not find Tree Color.');
Result := 0;
end;

2008-10-19 12:18:36
2008-10-19 12:38:09
2008-10-19 12:48:33
From: Deathscytex
tarajunky, the auto-color works no more (The difference) but i changed it and it works now, wont tell the range because i get a feeling a jagex staff is watching… ;p stange feeling thing.
If InRange(A - B, LowestDifference, HighestDifference) Then 2008-10-19 12:51:56
2008-10-19 12:56:50
From: Deathscytex
Slappy-my-face
Why didnt i think of that!…
Wait, whats a and b?
a := getcolor(original)
b := getcolor(next to original)
or is it one of those RGB/XYZ auto colors?
Max(a, b) - Min(a, b)iAbs(a - b) they are the same.
2008-10-19 13:01:33
function FindTree: Integer;
var
GC, A, L, TestColor, NextColor: Integer;
P: TPointArray;
begin
GC := 279098;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
L := GetArrayLength(P);
for A := 0 to L-1 do
begin
if rs_OnMinimap(P[A].X, P[A].Y) then
begin
NextColor := GetColor(P[A].X-1, P[A].Y);
TestColor := GetColor(P[A].X, P[A].Y);
if InRange(NextColor - TestColor, 1504, 525792) then
begin
Result := TestColor;
WriteLn('Tree Color = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
WriteLn('Could not find Tree Color.');
Result := 0;
end;
2008-10-19 13:12:55
From: Deathscytex
if InRange(TestColor - GetColor(P[A].X-1, P[A].Y), 1504, 525792) then
I forgot to tell you the difference range are a bit…. spread out.
ColorToRGB(A, VarR, VarG, VarB); // HSL or XYZ
...
ColorToRGB(GetColor(Blah, Blah), VarR2, VarG2, VarB2);
If ((R - R2 < X) And (R - R2 > X)) And ((G - G2 < X) And (G - G2 > X)) And ((B - B2 < X) And (B - B2 > X)) Then
2008-10-19 13:35:43
function FindTree: Integer;
var
GC, A, L, TestColor, NextColor: Integer;
P: TPointArray;
R1, G1, B1, R2, G2, B2: Integer;
//X, Y, Z: Extended;
begin
GC := 279098;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
L := GetArrayLength(P);
for A := 0 to L-1 do
begin
if rs_OnMinimap(P[A].X, P[A].Y) then
begin
TestColor := GetColor(P[A].X, P[A].Y);
ColorToRGB(TestColor, R1, G1, B1);
ColorToRGB(GetColor(P[A].X-1, P[A].Y), R2, G2, B2);
if (R1 - R2 >= 28) and (R1 - R2 <= 34) and (G1 - G2 >= -6) and (G1 - G2 <= 0) and (B1 - B2 >= -1) and (B1 - B2 <= 1) then
begin
Result := TestColor;
WriteLn('Tree Color = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
WriteLn('Could not find Tree Color.');
Result := 0;
end;
2008-10-19 14:04:04
From: Deathscytex
Alright, i got it, thanks
function FindTree: Integer;
var
GC, A, L, TestColor, NextColor: Integer;
P: TPointArray;
R1, G1, B1, R2, G2, B2: Integer;
//X, Y, Z: Extended;
begin
GC := 279098;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
L := GetArrayLength(P);
for A := 0 to L-1 do
begin
if rs_OnMinimap(P[A].X, P[A].Y) then
begin
TestColor := GetColor(P[A].X, P[A].Y);
ColorToRGB(TestColor, R1, G1, B1);
ColorToRGB(GetColor(P[A].X-1, P[A].Y), R2, G2, B2);
if (R1 - R2 >= 28) and (R1 - R2 <= 34) and (G1 - G2 >= -6) and (G1 - G2 <= 0) and (B1 - B2 >= -1) and (B1 - B2 <= 1) then
begin
Result := TestColor;
WriteLn('Tree Color = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
WriteLn('Could not find Tree Color.');
Result := 0;
end;
EDIT:
So is this correct? Because it is working. (Im adding XYZ later.), im fonna take it to the test corner and get people to help. Than release it to SRL hopefully (I want to have my name written in the Includes…ahhhh.)
2008-10-19 14:21:10
2008-10-20 14:23:08