SRL Archive - General

help with scar find color function


stuckman

2007-03-11 09:45:43

here is my code

program New;
var x, y: integer;
Begin
findcolor(x,y,true,13421619);
if(x<>0)then
begin
clickmouse(x,y,true);
end.

and it says i have invalid parameters in the findcolor function
anyhelp very welcome

Pentti

2007-03-11 09:57:40

You need to have coordinates of "box" where you search after your color like this:
findcolor(x,y,true,13421619,1,2,500,300);

(x1,y1)
-------------------
| |
| |
| |
| |
-------------------
(x2,y2)
in my findcolor number 1 is for x1 and number 2 is for y1. Number 500 is for x2 and number 300 is for y2. and these coordinates makes this box where you search your color.

stuckman

2007-03-11 10:13:29

thanks
now i have this

program New;
var x, y: integer;
Begin
findcolor(x,y,true,13421619,1,1,500,370);
if(x<>0)then
begin
clickmouse(x,y,true);
end.
and now it still says invalid parameters for some reason

Pentti

2007-03-11 10:23:02

Take that "True" off from color finding… It will be like this:
findcolor(x,y,13421619,1,1,500,370);

stuckman

2007-03-11 10:32:34

took it off and it said identifyer expected

Pentti

2007-03-11 10:41:09

You have two begins in your script, so you'll need two ends in your script:
program New;
var x, y: integer;
Begin
findcolor(x,y,13421619,1,1,500,370);
if(x<>0)then
begin
clickmouse(x,y,true);
end;
end.

stuckman

2007-03-11 10:44:49

thanks all of you as my script works now

Pentti

2007-03-11 10:46:05

No problems, man.