Markus
2007-05-15 10:35:58
I created this function as a combination of Linearwalk and Radialwalk.
Walks from middle out of the radial within maxrange until a certain color is found. If the specified color is not found it will lower the radius and look again.
Demonstration script, use this in paint and it will draw the way of colorfinding.
DONT USE THIS IN RUNESCAPE!
Please tell me what you think of it.
Markus
Walks from middle out of the radial within maxrange until a certain color is found. If the specified color is not found it will lower the radius and look again.
{*******************************************************************************
function RadialLineWalk(TheColor, radial, maxrange, radius, xmod, ymod : integer) : boolean;
By: Markus, based on Linearwalk and Radial walk by WT-Fakawi and Wizzup
Description: Walks from middle out of the radial within maxrange until a certain color is found.
If the specified color is not found it will lower the radius and look again.
*******************************************************************************}
function RadialLineWalk(TheColor, radial, maxrange, radius, xmod, ymod : integer) : boolean;
var count, x1, y1, initradial : integer;
begin
initradial := radial;
repeat
for count := 0 to maxrange do
begin
radial := radial + count;
x1 := Round(Radius * Sin(radial * pi / 180)) + mmcx;
y1 := Round(-Radius * Cos(radial * pi / 180)) + mmcy;
if GetColor(x1, y1) = TheColor then
begin
MouseFindFlag(x1, y1, Xmod, Ymod);
result := true;
exit;
end;
radial := radial - count;
x1 := Round(Radius * Sin(radial * pi / 180)) + mmcx;
y1 := Round(-Radius * Cos(radial * pi / 180)) + mmcy;
if GetColor(x1, y1) = TheColor then
begin
MouseFindFlag(x1, y1, Xmod, Ymod);
result := true;
exit;
end;
end;
radius := radius - 4;
until(radius < 4);
end;
Demonstration script, use this in paint and it will draw the way of colorfinding.
DONT USE THIS IN RUNESCAPE!
program RLDemo;
procedure RadialLineWalk2(radial, maxrange, radius, xmod, ymod : integer);
var count, x1, y1, initradial : integer;
begin
initradial := radial;
repeat
for count := 0 to maxrange do
begin
radial := initradial + count;
x1 := Round(Radius * Sin(radial * pi / 180)) + mmcx;
y1 := Round(-Radius * Cos(radial * pi / 180)) + mmcy;
// writeln('x1 : ' + inttostr(x1) + ' y1 : ' + inttostr(y1));
MoveMouse(x1, y1);
ClickMouse(x1, y1, true);
wait(10);
radial := initradial - count;
x1 := Round(Radius * Sin(radial * pi / 180)) + mmcx;
y1 := Round(-Radius * Cos(radial * pi / 180)) + mmcy;
// writeln('x1 : ' + inttostr(x1) + ' y1 : ' + inttostr(y1));
MoveMouse(x1, y1);
ClickMouse(x1, y1, true);
wait(10);
end;
radius := radius - 4;
until(radius < 4);
end;
begin
RadialLineWalk2(340, 20, 70, 1, 1);
RadialLineWalk2(20, 10, 30, 1, 1);
RadialLineWalk2(180, 40, 65, 1, 1);
end.
Please tell me what you think of it.
Markus