how do i get the mouse to move along a line of a specific color??
so in paint if you draw a red line how can you get the mouse to follow it from start to finish?
thanks
If it is a straight and constant line, maybe try using coords?
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
SCAR Code:procedure FollowLine(color, tol: Integer);
var
x, y, mY: Integer;
begin
MoveMouse(4000,4000);
GetMousePos(x,mY);
x := 1;
while FindColorTolerance(x, y, color, x, 1, x + 1, mY, tol) do
begin
MoveMouse(x,y);
Inc(x);
Wait(10);
end;
end;
That *should* work, though I'm not sure.
By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.
Try increasing the Wait time as it may be that it just went along the entire line to quickly then ran out of colours so failed.
By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.
this'll work on any line, curved or w/e, as long as it doesn't overlap
SCAR Code:program New;
{.include srl/srl.scar}
Procedure followline(color,x1,y1,x2,y2:integer);
var
TTPA:tpointarray;
ATPA: T2dPointArray;
x,y,l: integer;
begin
findcolorstolerance(TTPA,color,x1,y1,x2,y2,0);
ATPA := SplitTPA(TTPA,3);
for l := 0 to high(TTPA) do
begin
MoveMouse(ATPA[0][l].x,ATPA[0][l].y);
wait(5);
end;
end;
begin
setupsrl;
ActivateClient;
end.
Originally Posted by That guy that wrote forefeathers
maybe that will do? if not edit the "0,0" in findcolorsspiraltolerance to about where you want the line to start, i'm sure that will workSCAR Code:program New;
{.include srl/srl.scar}
Procedure followline(color,x1,y1,x2,y2:integer);
var
TTPA:tpointarray;
ATPA: T2dPointArray;
x,y,l: integer;
begin
findcolorsspiraltolerance(0,0,TTPA,color,x1,y1,x2,y2,0);
ATPA := SplitTPA(TTPA,3);
for l := 0 to high(TTPA) do
begin
MoveMouse(ATPA[0][l].x,ATPA[0][l].y);
wait(1);
end;
end;
begin
setupsrl;
ActivateClient;
end.
Originally Posted by That guy that wrote forefeathers
There are currently 1 users browsing this thread. (0 members and 1 guests)