Killerdou
08-16-2007, 01:40 PM
var
RoadPoints : TPointArray;
RoadCount : Integer;
function RadialRoadWalk(TheColor: Integer; StartRadial, EndRadial: Integer;
Radius: Integer; Xmod, Ymod: Integer): Boolean; // By Wizzup? and WT-Fakawi.
var
i, X1, Y1: Integer;
begin
if (RoadColorChecker) then
if (DebugRadialRoad) then
WriteLn(' THROUGH RADIALROADWALK= ---> ' + IntToStr(RoadColor));
if (StartRadial = EndRadial) then
begin
WriteLn('Using LinearRoadWalk, equal values.')
if LinearRoadWalk(TheColor, StartRadial, Radius, Xmod, Ymod) then
Result := True;
end
else if (StartRadial < EndRadial) then
begin
repeat
for i := StartRadial to EndRadial do
begin
x1 := Round(Radius * Sine(i)) + 646;
y1 := Round(-Radius * Cose(i)) + 84;
if Not LoggedIn then Exit;
if (FindColor(x, y, TheColor, X1, Y1, X1 + 1, Y1 + 1)) then
begin
MouseFindNoFlag(X,Y,Xmod,Ymod);
Result := True;
CountFlag(10);
Exit;
end;
end;
Radius := Radius - 4;
until (Radius <= 1);
end else
if (StartRadial > EndRadial) then
begin
repeat
for i := StartRadial downto EndRadial do
begin
x1 := Round(Radius * Sine(i)) + 646;
y1 := Round(-Radius * Cose(i)) + 84;
if Not LoggedIn then Exit;
if (FindColor(x, y, TheColor, X1, Y1, X1 + 1, Y1 + 1)) then
begin
FindColorsSpiralTolerance(X, Y, RoadPoints, TheColor, X - 10, Y - 10, X + 10, Y + 10, 0);
X := 0;
Y := 0;
For RoadCount := 0 to Length(RoadPoints) - 1 do
begin
X := X + RoadPoints[RoadCount].x;
Y := Y + RoadPoints[RoadCount].y;
end;
X := Round(X div Length(RoadPoints));
Y := Round(X div Length(RoadPoints));
MouseFindNoFlag(X,Y,Xmod,Ymod);
Result := True;
CountFlag(10);
Exit;
end;
end;
Radius := Radius - 4;
until (Radius <= 1);
end
end;
it 'draws a box' around the point it finds, then it finds all roadcolor then and finds the middle but i havent tested it(not sure if it compiles or anything) just an idea that came to my mind:)
RoadPoints : TPointArray;
RoadCount : Integer;
function RadialRoadWalk(TheColor: Integer; StartRadial, EndRadial: Integer;
Radius: Integer; Xmod, Ymod: Integer): Boolean; // By Wizzup? and WT-Fakawi.
var
i, X1, Y1: Integer;
begin
if (RoadColorChecker) then
if (DebugRadialRoad) then
WriteLn(' THROUGH RADIALROADWALK= ---> ' + IntToStr(RoadColor));
if (StartRadial = EndRadial) then
begin
WriteLn('Using LinearRoadWalk, equal values.')
if LinearRoadWalk(TheColor, StartRadial, Radius, Xmod, Ymod) then
Result := True;
end
else if (StartRadial < EndRadial) then
begin
repeat
for i := StartRadial to EndRadial do
begin
x1 := Round(Radius * Sine(i)) + 646;
y1 := Round(-Radius * Cose(i)) + 84;
if Not LoggedIn then Exit;
if (FindColor(x, y, TheColor, X1, Y1, X1 + 1, Y1 + 1)) then
begin
MouseFindNoFlag(X,Y,Xmod,Ymod);
Result := True;
CountFlag(10);
Exit;
end;
end;
Radius := Radius - 4;
until (Radius <= 1);
end else
if (StartRadial > EndRadial) then
begin
repeat
for i := StartRadial downto EndRadial do
begin
x1 := Round(Radius * Sine(i)) + 646;
y1 := Round(-Radius * Cose(i)) + 84;
if Not LoggedIn then Exit;
if (FindColor(x, y, TheColor, X1, Y1, X1 + 1, Y1 + 1)) then
begin
FindColorsSpiralTolerance(X, Y, RoadPoints, TheColor, X - 10, Y - 10, X + 10, Y + 10, 0);
X := 0;
Y := 0;
For RoadCount := 0 to Length(RoadPoints) - 1 do
begin
X := X + RoadPoints[RoadCount].x;
Y := Y + RoadPoints[RoadCount].y;
end;
X := Round(X div Length(RoadPoints));
Y := Round(X div Length(RoadPoints));
MouseFindNoFlag(X,Y,Xmod,Ymod);
Result := True;
CountFlag(10);
Exit;
end;
end;
Radius := Radius - 4;
until (Radius <= 1);
end
end;
it 'draws a box' around the point it finds, then it finds all roadcolor then and finds the middle but i havent tested it(not sure if it compiles or anything) just an idea that came to my mind:)