SCAR Code:
{*******************************************************************************
function RadialWalk2(TheColor: Integer; StartRadial, EndRadial, Xmod,
Ymod: Integer; Randoms, OffRoad: Boolean): Boolean;
By: n3ss3s
Description: option for randoms and offroad , antiwall, other lil changes.
click.
*******************************************************************************}
function RadialWalk2(TheColor: Integer; StartRadial, EndRadial, Xmod,
Ymod: Integer; Randoms, OffRoad: Boolean): Boolean;
var
Tempx, Tempy, Fx, Fy, SR, ER, i, X1, Y1, Tempi, Radius: Integer;
D1, D2: Boolean;
Oper: string;
begin
Radius := 70;
SR := StartRadial;
ER := EndRadial;
if (RoadColorChecker) then
if (DebugRadialRoad) then
WriteLn(' THROUGH RADIALROADWALK= ---> ' + IntToStr(RoadColor));
if (SR = ER) then
begin
if(not(SR = 0))then
begin
SR := SR - 1;
ER := ER + 1;
end else
begin
SR := SR;
ER := ER + 2;
end;
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
if(FindColorCircleTolerance(Fx, Fy, 16250871, x, y, 5, 10))then
begin
if(GetColor(Fx, Fy + 3) = 16250871)then
begin
Writeln('Oh noes! We tried to clickie a wall!');
Writeln('Me likey not clicking wall :(');
Writeln('Exitting VarrockRadialRoadWalk');
Exit;
end;
end else
begin
if(OffRoad)then
begin
TempX := X;
TempY := Y;
case Random(2) + 1 of
1: Oper := 'minus';
2: Oper := 'plus';
end;
repeat
while Tempi <= 5 do
begin
case Oper of
'plus': TempX := TempX + 1;
'minus': TempX := TempY - 1;
end;
if(not(GetColor(TempX, TempY) = TheColor))then
begin
X := TempX;
Y := TempY;
D2 := True;
D1 := True;
end;
if(Tempi = 5)then
begin
case Oper of
'plus': Oper := 'minus';
'minus': Oper := 'plus';
end;
end;
end;
until(D1) and (D2);
end;
MouseFindNoFlag(X,Y,Xmod,Ymod);
Result := True;
if(Randoms)then
begin
while FlagDistance > 10 do
begin
FTWait(1);
Wait(10);
end;
end;
Exit;
end;
end;
end;
Radius := Radius - 4;
until (Radius <= 1);
end else
begin
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
if(FindColorCircleTolerance(Fx, Fy, 15723511, x, y, 5, 10))then
begin
Writeln('Oh noes! We tried to clickie a wall!');
Writeln('Me likey not clicking wall :(');
Writeln('Exitting VarrockRadialRoadWalk');
Exit;
end else
begin
if(OffRoad)then
begin
TempX := X;
TempY := Y;
case Random(2) + 1 of
1: Oper := 'minus';
2: Oper := 'plus';
end;
repeat
while Tempi <= 8 do
begin
Wait(20);
case Oper of
'plus': TempX := TempX + 1;
'minus': TempX := TempY - 1;
end;
if(not(GetColor(TempX, TempY) = TheColor))then
begin
X := TempX;
Y := TempY;
D2 := True;
D1 := True;
end;
if(Tempi = 5)then
begin
case Oper of
'plus': Oper := 'minus';
'minus': Oper := 'plus';
end;
end;
end;
until(D1) and (D2);
end;
MouseFindNoFlag(X,Y,Xmod,Ymod);
Result := True;
if(Randoms)then
begin
while FlagDistance > 10 do
begin
FTWait(1);
Wait(10);
end;
end;
Exit;
end;
end;
end;
Radius := Radius - 4;
until (Radius <= 1);
end;
end;
end;
Yeh tell me ways that I could make it better.
SCAR Code:
{*******************************************************************************
function DetectEnt(TreeColors: TIntegerArray): Boolean;
By: n3ss3s
Description: Finds many as possible tree pixels, waits 1/2 sec and detects the
ent by that if the pixels are not in their places anymore.
*******************************************************************************}
function DetectEnt(TreeColors: TIntegerArray): Boolean;
var
TPA: TPointArray;
var
ECA: TIntegerArray;
var
I, C, F: Integer;
Dx, Dy: Integer;
MovedPixs: Integer;
begin
for I := 0 to GetArrayLength(TreeColors) - 1 do
begin
if(FindColorTolerance(Dx, Dy, TreeColors[i],
MSX1, MSY1, MSX2, MSY2, 10))then
begin
Dx := TPA[i].x;
Dy := TPA[i].y;
ECA[i] := TreeColors[i];
F := F + 1;
end;
end;
Wait(500 + Random(25));
for C := 0 to F do
begin
if(not(GetColor(TPA[f].x, TPA[f].y) = ECA[f]))then
begin
MovedPixs := MovedPixs + 1;
end;
end;
if(MovedPixs > 5)then
begin
Result := True;
Writeln('Ent Found!!');
Exit;
end;
end;