SRL Archive - Help and Support

AutoColor ASAP please.


faster789

2008-04-26 01:44:02

Hello members,
this thread is mainly to the SRL Devs, I was wandering if there will be a Rev 17 released sometime soon due to the bug in the autocolor? Please make it asap as I am very excited in making my own Varrock Owner which requires "lots" of autocoloring!
Thanks :)

-BoBo

Naum

2008-04-26 04:27:03

FindVarrockRoadColor?

faster789

2008-04-26 11:10:08

lol no I need it to find dirt color..and radial walk..which it's not doing :(

Cazax

2008-04-26 11:30:42

Function FindDirtRoadColor : 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, 2513511, 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, 2513511, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -6, 29) then
if InRange(R - B, 30, 75) then
if InRange(G - B, 31, 64) then
if InRange(Round(S) - Round(H), 28, 48) then
if InRange(Round(L) - Round(H), 1, 21) then
if InRange(Round(S) - Round(L), 12, 44) then
if InRange(Round(X) - Round(Y), -8, 9) then
if InRange(Round(Y) - Round(Z), -4, 13) 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('DirtRoadColor = '+Inttostr(TestColor));
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find DirtRoadColor!');
Result := 0;
end;
Test it in lumby.

faster789

2008-04-26 11:38:30

Thanks I'll test and tell you, btw does anyone know the what function I suppose to use if I am walking on the GE floor?

Cazax

2008-04-26 11:45:07

I have a tut on autocoloring…click in my sig or here:
Autocoloring with RGB,HSL and XYZ!

faster789

2008-04-26 12:07:57

dang its kind of hard, but can you check your thread and is there any way else that I can do this for GE grounds?

Cazax

2008-04-26 12:11:09

From: faster789
dang its kind of hard, but can you check your thread and is there any way else that I can do this for GE grounds?


Give me a couple of colors of the GE ground and they must be different and ill give the function :)

faster789

2008-04-26 12:28:19

Color Picked: 6383978 at (932, 385)
Color Picked: 7436666 at (924, 399)
Color Picked: 7305080 at (928, 412)

here ya go thanks a lot~ ;)

Cazax

2008-04-26 12:37:08

Function GEFloorColor : 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, 6910322, 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, 6910322, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -9, 9) then
if InRange(R - B, 0, 17) then
if InRange(G - B, 1, 17) then
if InRange(Round(S) - Round(H), -23, 0) then
if InRange(Round(L) - Round(H), 16, 34) then
if InRange(Round(S) - Round(L), -57, -19) then
if InRange(Round(X) - Round(Y), -8, 6) then
if InRange(Round(Y) - Round(Z), -4, 6) 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('GEFloorColor = '+Inttostr(TestColor));
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find GEFloorColorColor!');
Result := 0;
end;
TESETED: WORKED!.

I want more than a thanks ;)

faster789

2008-04-26 12:44:23

:p A rep, credits and a HUG ;)

edit: sorry but apparently I've just given you a rep, so take 2 hugs :p

faster789

2008-04-26 12:53:45

hey cazax can you chek this over as it is your autocoloring? What it suppose to do is go east of GE which it does, but then it suppose to find dirt color and run there but all it does is writes in debug box the "dirt color" and executes it doesnt actualy move there.
please help thanks!

program Yewchopper;
{.include SRL/SRL/misc/SMART.scar}
{.include SRL/SRL.scar}

var x, y : integer;

const

//Smart Setup//
SmartWorld = 118; // what world do you want to login to??
Signed = True; // leave alone..

procedure DeclarePlayers;
begin
HowManyPlayers :=1; // how many players do you want
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0
Players[0].Name := ''; //Character Name
Players[0].Pass := ''; //Character Pass
Players[0].Nick := ''; //Nickname 3 - 4 Letter's of char name
Players[0].Active := True; //true if you want this player to be ran in the script false if you dont want it to run
end;

procedure SetupSmart;
begin
SmartSetupEx(SmartWorld, false, Signed);
ClearDebug;
WriteLn('Setting up Smart... Please Hold...');
Wait(10000 + random(5000));
SetTargetDC(SmartGetDC);
While not(SmartReady) do Wait(100);
end;

Function GEFloorColor : Integer; // by Cazaz --- THANKS!
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, 6910322, 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, 6910322, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -9, 9) then
if InRange(R - B, 0, 17) then
if InRange(G - B, 1, 17) then
if InRange(Round(S) - Round(H), -23, 0) then
if InRange(Round(L) - Round(H), 16, 34) then
if InRange(Round(S) - Round(L), -57, -19) then
if InRange(Round(X) - Round(Y), -8, 6) then
if InRange(Round(Y) - Round(Z), -4, 6) 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('GEFloorColor = '+Inttostr(TestColor));
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find GEFloorColorColor!');
Result := 0;
end;


Function myFindDirtRoadColor : Integer; // Thanks for editing CAZAX! :)
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, 2513511, 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, 2513511, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -6, 29) then
if InRange(R - B, 30, 75) then
if InRange(G - B, 31, 64) then
if InRange(Round(S) - Round(H), 28, 48) then
if InRange(Round(L) - Round(H), 1, 21) then
if InRange(Round(S) - Round(L), 12, 44) then
if InRange(Round(X) - Round(Y), -8, 9) then
if InRange(Round(Y) - Round(Z), -4, 13) 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('DirtRoadColor = '+Inttostr(TestColor));
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find DirtRoadColor!');
Result := 0;
end;

function Energy20: Boolean;
var
Colour: string;
Level: Integer;
begin
Level := GetMMLevels('energy', Colour);
Result := Level > 50;
end;

procedure WalktoYews;
begin
Status('setting up');
SetAngle(True);
MakeCompass('n');
if Energy20 then
begin
SetRun(true);
end;
begin
Status('Walking to yews');
RadialWalk(GEFloorColor,80,100,65,-2,0);
FFlag(0);
RadialWalk(myFindDirtRoadColor,70,110,65,-2,0);
FFlag(0);
RadialWalk(myFindDirtRoadColor,340,390,65,-2,0);
FFlag(0);
if FindSymbol(x,y,'tree')then
Status('found tree symbol');
begin
Mouse(x,y,2,2,True);
end;
end;
end;

function FindTree(var tx, ty: Integer):boolean; //Made by Me :)...
var
i: integer;
YewPoints: TPointArray;
Yew2D : T2DPointArray;
YewPoint : TPoint;
begin
if not LoggedIn then exit;
x:= MSCX;
y:= MSCY;
begin
FindColorsSpiralTolerance(tx,ty,YewPoints,2832993,MSX1,MSY1,MSX2,MSY2,6);
Yew2D:= TPAtoATPAEx(YewPoints,3,3);
for i:= 0 to length(Yew2D)-1 do
begin
if not LoggedIn then exit;
Yewpoint:= MiddleTPA(Yew2D[i]);
tx:= YewPoint.X;
ty:= YewPoint.Y;
MMouse(tx,ty,2,2);
wait(90+random(50));
if isuptext('hop')then
begin
GetMousePos(tx,ty);
result:= true;
Exit;
end else Continue;
end;
end;
end;


begin
SetupSmart;
SetupSRL;
DeclarePlayers;
LoginPlayer;
WalktoYews;
end.

Cazax

2008-04-26 13:01:59

From: faster789
hey cazax can you chek this over as it is your autocoloring? What it suppose to do is go east of GE which it does, but then it suppose to find dirt color and run there but all it does is writes in debug box the "dirt color" and executes it doesnt actualy move there.
please help thanks!

program Yewchopper;
{.include SRL/SRL/misc/SMART.scar}
{.include SRL/SRL.scar}

var x, y : integer;

const

//Smart Setup//
SmartWorld = 118; // what world do you want to login to??
Signed = True; // leave alone..

procedure DeclarePlayers;
begin
HowManyPlayers :=1; // how many players do you want
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0
Players[0].Name := ''; //Character Name
Players[0].Pass := ''; //Character Pass
Players[0].Nick := ''; //Nickname 3 - 4 Letter's of char name
Players[0].Active := True; //true if you want this player to be ran in the script false if you dont want it to run
end;

procedure SetupSmart;
begin
SmartSetupEx(SmartWorld, false, Signed);
ClearDebug;
WriteLn('Setting up Smart... Please Hold...');
Wait(10000 + random(5000));
SetTargetDC(SmartGetDC);
While not(SmartReady) do Wait(100);
end;

Function GEFloorColor : Integer; // by Cazaz --- THANKS!
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, 6910322, 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, 6910322, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -9, 9) then
if InRange(R - B, 0, 17) then
if InRange(G - B, 1, 17) then
if InRange(Round(S) - Round(H), -23, 0) then
if InRange(Round(L) - Round(H), 16, 34) then
if InRange(Round(S) - Round(L), -57, -19) then
if InRange(Round(X) - Round(Y), -8, 6) then
if InRange(Round(Y) - Round(Z), -4, 6) 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('GEFloorColor = '+Inttostr(TestColor));
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find GEFloorColorColor!');
Result := 0;
end;


Function myFindDirtRoadColor : Integer; // Thanks for editing CAZAX! :)
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, 2513511, 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, 2513511, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -6, 29) then
if InRange(R - B, 30, 75) then
if InRange(G - B, 31, 64) then
if InRange(Round(S) - Round(H), 28, 48) then
if InRange(Round(L) - Round(H), 1, 21) then
if InRange(Round(S) - Round(L), 12, 44) then
if InRange(Round(X) - Round(Y), -8, 9) then
if InRange(Round(Y) - Round(Z), -4, 13) 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('DirtRoadColor = '+Inttostr(TestColor));
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find DirtRoadColor!');
Result := 0;
end;

function Energy20: Boolean;
var
Colour: string;
Level: Integer;
begin
Level := GetMMLevels('energy', Colour);
Result := Level > 50;
end;

procedure WalktoYews;
begin
Status('setting up');
SetAngle(True);
MakeCompass('n');
if Energy20 then
begin
SetRun(true);
end;
begin
Status('Walking to yews');
RadialWalk(GEFloorColor,80,100,65,-2,0);
FFlag(0);
RadialWalk(myFindDirtRoadColor,70,110,65,-2,0);
FFlag(0);
RadialWalk(myFindDirtRoadColor,340,390,65,-2,0);
FFlag(0);
if FindSymbol(x,y,'tree')then
Status('found tree symbol');
begin
Mouse(x,y,2,2,True);
end;
end;
end;

function FindTree(var tx, ty: Integer):boolean; //Made by Me :)...
var
i: integer;
YewPoints: TPointArray;
Yew2D : T2DPointArray;
YewPoint : TPoint;
begin
if not LoggedIn then exit;
x:= MSCX;
y:= MSCY;
begin
FindColorsSpiralTolerance(tx,ty,YewPoints,2832993,MSX1,MSY1,MSX2,MSY2,6);
Yew2D:= TPAtoATPAEx(YewPoints,3,3);
for i:= 0 to length(Yew2D)-1 do
begin
if not LoggedIn then exit;
Yewpoint:= MiddleTPA(Yew2D[i]);
tx:= YewPoint.X;
ty:= YewPoint.Y;
MMouse(tx,ty,2,2);
wait(90+random(50));
if isuptext('hop')then
begin
GetMousePos(tx,ty);
result:= true;
Exit;
end else Continue;
end;
end;
end;


begin
SetupSmart;
SetupSRL;
DeclarePlayers;
LoginPlayer;
WalktoYews;
end.


the RadialWalk is failing for some reason… try:
If RadialWalk(bla) then
begin
……
end else
Writeln('We arent at varrock');

faster789

2008-04-26 13:19:28

:( not it says couldnt find dirt color and then writes ln " we arent in varrock'
:(

Cazax

2008-04-26 15:12:31

From: faster789
:( not it says couldnt find dirt color and then writes ln " we arent in varrock'
:(


here is the fixed function:
Function FindDirtRoadColor : 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, 2513511, 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, 2513511, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -9, 32) then
if InRange(R - B, 27, 78) then
if InRange(G - B, 28, 67) then
if InRange(Round(S) - Round(H), 25, 51) then
if InRange(Round(L) - Round(H), -2, 24) then
if InRange(Round(S) - Round(L), 9, 47) then
if InRange(Round(X) - Round(Y), -9, 9) then
if InRange(Round(Y) - Round(Z), -4, 13) 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('DirtRoadColor = '+Inttostr(TestColor));
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find DirtRoadColor!');
Result := 0;
end;