solemn wishes
2006-03-25 08:26:52
hi,
im not sure why i made this but it should find the centre of a road or any object and the click it (it should :D)
*edit* i remember why i made it know :D, im going to make some walking procedures :D
im not sure why i made this but it should find the centre of a road or any object and the click it (it should :D)
*edit* i remember why i made it know :D, im going to make some walking procedures :D
[FONT="Courier New"]
program findcentreroad;
{.include SRL\SRL.scar}
function findcentreroad(Rcolor : integer; x1,y1,x2,y2:integer; tol :integer):boolean;
var
spaces ,x, y, ys, xs :integer;
a, b, c ,cent ,back :integer;
n, e , s, w :integer;
dir:string;
begin
c:=0;
ys:=0;
xs:=0;
if (FindColorTolerance(x, y, RColor, x1, y1, x2, y2, tol)) then
begin
Mmouse(x,y,3,4)
getmousepos(a,b)
cent:=a; back:=b;
begin
dir:='North';
spaces:=0;
repeat
c:=c-1;
movemousesmooth(a,b + c) Getmousepos(x,y)
wait(250+random(50))
spaces:=spaces+1;
until(not(getcolor(x,y) =Rcolor)or(spaces=20))
n:=spaces;
begin
Mmouse(cent,back,0,0)
dir:='South';
spaces:=0;
c:=1;
repeat
c:=c+1;
movemousesmooth(a,b + c) Getmousepos(x,y)
wait(250+random(50))
spaces:=spaces+1;
until(not(getcolor(x,y) =Rcolor)or(spaces=20))
s:=spaces;
begin
Mmouse(cent,back,0,0)
dir:='East';
spaces:=0;
c:=1;
repeat
c:=c+1;
movemousesmooth(a -c, b) Getmousepos(x,y)
wait(250+random(50))
spaces:=spaces+1;
until(not(getcolor(x,y) =Rcolor)or(spaces=20))
e:=spaces;
begin
Mmouse(cent,back,0,0)
dir:='west';
spaces:=0;
c:=0;
repeat
c:=c-1;
movemousesmooth(c, b) Getmousepos(x,y)
wait(250+random(50))
spaces:=spaces+1;
until(not(getcolor(x,y) =Rcolor)or(spaces=20))
w:=spaces;
begin
cent:=n/s
back:=e/w
a:=a+cent;
b:=b+back;
mouse(a,b,0,0,true)
flag;
end;
end;
end;
end;
end;
end;
end;[/FONT]