NOTE: I realy dident know were to post this i hope this is right XD
this script acuretly and fully makes a function that will search the screen for a TPA a return were abouts it is (thats wat x and y are for)
all you enter is:
3 colours
weather to clear the debug and teh text at the top for checking that ur on teh right thing 
for those of you who dnt know wat a TPA is it searches for a colour with a tolerance (made by the script so its acureter than normal
) and then checks to make sure your clicking on the right thing
(eg it searches for a rock (the colour being the ore colour) checks to make sure your on the right thing and returns were it is)
with special thank to Mastaraymond and ProphesyOfWolf! who's guide thaught me this and for making all of this soooo easy 
EDIT :thx for editing it i looked at it and though i realy cba and dnt know enough about colours to figure out wat i need and wat i dnt so i just put all of it in and edited the bits i needed afterwards and if it wasent for u id still b using crappy findcolor XD
SCAR Code:
program TPAFinderMaker;
const
//Fill in this bit:
//the already filled in values is an exsample for an oak tree
colour1 = 2715745;// Pick 3 colours of the thing you whant to click
colour2 = 3439726;// Place them respectively in colour 1, 2 & 3
colour3 = 6467489;
TheUpText = 'Oak';//when it checks to see what your clicking this is
//what is in the top right hand courner (only use the important bit)
//eg Chop down Oak - the important bit is oak..
DoClearDebug = true;//sould it clear the debug when it runs
//Well done now press run and dont alter anything below this..
var
H, S, L, HueMod, SatMod, tolerance :extended;
midcolor: integer;
HueString, SatString:string;
I,II : integer;
HSLColor : Array[1..3] of Extended;
HSL: Array[0..1] of Array[1..3] of Extended;
Colors : TIntegerArray;
procedure Print;
begin
if docleardebug then cleardebug;
writeln('Function TPAFinder(var x, y: Integer): Boolean;');
writeln(' //Made by Bazzbarretts TPA Maker!');
writeln(' //with special thank to Mastaraymond and ProphesyOfWolf!');
writeln('Var');
writeln(' CTS, I: Integer;');
writeln(' TPA: TPointArray;');
writeln(' ATPA: Array of TPointArray;');
writeln('begin');
writeln(' CTS := GetColorToleranceSpeed;');
writeln(' ColorToleranceSpeed(2);');
writeln(' SetColorSpeed2Modifiers('+ HueString +', ' + satstring +');');
writeln(' FindColorsSpiralTolerance(MSCX, MSCY, TPA, ' + inttostr(midcolor) +' , MSX1, MSY1, MSX2, MSY2, ' + inttostr(round(tolerance+0.5)) + ');');
writeln(' ColorToleranceSpeed(CTS);');
writeln(' ATPA := TPAToATPAEx(TPA, 15, 15);');
writeln(' For I := 0 to High(ATPA) do');
writeln(' begin');
writeln(' MiddleTPAEx(ATPA[i], x, y);');
writeln(' MMouse(x, y, 2, 2);');
writeln(' If(IsUpTextMultiCustom(['''+ TheUpText +'''])) then');
writeln(' begin');
writeln(' Result := True;');
writeln(' GetMousePos(x, y);');
writeln(' Break;');
writeln(' end;');
writeln(' end;');
writeln('end;');
writeln('');
writeln('');
end;
procedure dotheworkingout;//This Bit is By Mastaraymond
//(but i modded it so we just get the stuf we whant XD)
//hope u dont mind if you do just pm me and i will have the whole thing removed
begin
colors := [colour1, colour2, colour3]
For I:= 1 to 3 do
begin;
HSL[0][i] := 255; //Max is 240?
end;
For I:= 0 to High(Colors) do
begin;
ColortoHSL(Colors[i],HSLColor[1],HSLColor[2],HSLColor[3]);
For II:= 1 to 3 do
begin;
HSL[0][II] := MinE(HSLColor[II],HSL[0][II]);
HSL[1][II] := MaxE(HSLColor[II],HSL[1][II]);
end;
end;
For I:= 0 to 9 do
begin;
end;
H := HSL[1][1] - HSL[0][1];
S := HSL[1][2] - HSL[0][2];
L := HSL[1][3] - HSL[0][3];
midcolor := HSLToColor((HSL[1][1] + HSL[0][1]) div 2,(HSL[1][2] + HSL[0][2]) div 2,(HSL[1][3] + HSL[0][3]) div 2);
HueMod := (H/L);
SatMod := (S/L);
tolerance := L;
Huestring := floattostr(HueMod);
SatString := floattostr(SatMod);
setlength(HueString,4);
setlength(SatString,4);
end;
begin
dotheworkingout;
Print;
end.