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.