sibeliina
01-05-2012, 05:48 PM
program new;
{$i srl/srl.scar}
function Sheepcolor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.00);
if not (FindColorsTolerance(arP, 3487288, MSX1, MSY1, MSX2, MSY2, 0)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
procedure shearsheep;
var x, y: integer;
begin
if FindObj(x, y, 'hear', sheepcolor, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('hear');
end;
end;
begin
ClearDebug();
SetupSRL();
shearsheep;
end.
and when i run it...it gives this:
SRL Compiled in 16 msec
AutoColor = 3487288
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Successfully executed.
{$i srl/srl.scar}
function Sheepcolor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.00);
if not (FindColorsTolerance(arP, 3487288, MSX1, MSY1, MSX2, MSY2, 0)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
procedure shearsheep;
var x, y: integer;
begin
if FindObj(x, y, 'hear', sheepcolor, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('hear');
end;
end;
begin
ClearDebug();
SetupSRL();
shearsheep;
end.
and when i run it...it gives this:
SRL Compiled in 16 msec
AutoColor = 3487288
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Successfully executed.