Thank you, now how would I make it check for a color every 20 or so seconds and if it finds it then it starts the procedure?
Edit:
Here's what I have so far, this is supposed to be for a RSC private server.
SCAR Code:
program Autofighter;
//Sean's Auto Fighter, for Runescape Classic private servers.
//Log in once then start the script.
var
x, y: integer;
procedure login;
begin
if FindColor(x, y, 3647357, 339, 321, 339, 321) then //Logs you in.
clickMouse(252, 313, True);
wait(1000);
KeyDown(13);
wait(500);
KeyUp(13);
wait(500) ;
KeyDown(13);
wait(500);
KeyUp(13);
wait(500);
KeyDown(13);
wait(500);
KeyUp(13);
wait(1500);
if FindColor(x,y,65535,270,162,270,162) then
clickMouse(279, 221, True);
end;
procedure sleep; //Sleeping, works on ******* ***, not used yet.
begin
moveMouse(489, 39);
wait(1000);
moveMouse(289, 75);
wait(1500);
clickMouse(
289, 75,True);
end;
procedure logincheck; //Checks if your logged in not needed?
begin
if FindColor(x,y,130219,271,88,271,88) then
login;
end;
procedure main; //Calls other procedures
begin
wait(10000);
logincheck;
end;
begin
repeat
main;
until(false)
end.
Please tell me if this kind of script is not aloud,
also, tell me how I can make the script simpler, as this is my first one.
Edit: also, it's working how It's supposed to, but is there a better way to do it?