Log in

View Full Version : Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of



i need to bot!
01-19-2012, 07:03 AM
Thanks to everyone that told me about ACA :D now, I keep getting this though ...

'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.'

What is causing this.. im running my script in smart btw

program MehScript;

{$DEFINE Smart}
{$i srl/srl.simba}

procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Pin := '';
Players[0].Active := true;
LoginPlayer
end;

var
DTM: integer;
x, y: integer;


function BankColour: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.19, 0.49);

if not (FindColorsTolerance(arP, 4664116, MSX1, MSY1, MSX2, MSY2, 11)) 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;

function PieShell: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.20, 0.35);

if not (FindColorsTolerance(arP, 4552348, MSX1, MSY1, MSX2, MSY2, 1)) 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;

function Strawberry: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.20, 0.35);

if not (FindColorsTolerance(arP, 4552348, MSX1, MSY1, MSX2, MSY2, 1)) 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;

function Watermelon: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06, 0.08);

if not (FindColorsTolerance(arP, 2710312, MSX1, MSY1, MSX2, MSY2, 6)) 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;
function Apple: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.40, 0.07);

if not (FindColorsTolerance(arP, 1076776, MSX1, MSY1, MSX2, MSY2, 12)) 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 camera;
begin
makecompass(180);
end;

procedure bankbanker;
begin
if findobjcustom(x, y, ['ank'], [BankColour], 2) then
begin
repeat
Mouse(x, y, 0, 0, false);
chooseoption ('Bank Banker');
until (bankscreen);
end;
end;

procedure Depositstuff;
begin
if (bankscreen) then
begin
if (InvCount > 0) then
begin
depositall;
end;
end;
end;

procedure Withdraw1;
begin
if (bankscreen) then
begin
if findobjcustom(x, y, ['Pie shell'], [PieShell], 2) then
begin
repeat
Mouse(x, y, 0, 0, false);
chooseoption ('Withdraw-7');
until (invcount > 6);
end;
end;
end;

procedure withdraw2;
begin
if (invcount > 6) then
begin
if findobjcustom(x, y, ['Strawberry'], [Strawberry], 2) then
begin
Mouse(x, y, 0, 0, false);
chooseoption ('Withdraw-7');
end;
end;
end;
procedure Withdraw3;
begin
if (bankscreen) then
begin
if findobjcustom(x, y, ['Watermelon'], [Watermelon], 2) then
begin
Mouse(x, y, 0, 0, false);
chooseoption ('Withdraw-7');
end;
end;
end;
procedure Withdraw4;
begin
if (bankscreen) then
begin
if findobjcustom(x, y, ['Apple'], [Apple], 2) then
begin
repeat
Mouse(x, y, 0, 0, false);
chooseoption ('Withdraw-7');
until (invcount > 27)
closebank;
end;
end;
end;


procedure UsePieShell;
begin
if (bankscreen) then
closebank;
begin
if findobjcustom(x, y, ['Pie Shell'], [PieShell], 2) then
begin
Mouse(x, y, 0, 0, true);
chooseoption ('Use');
end;
end;
end;

begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
camera;
bankbanker;
Depositstuff;
if (invcount = 0) then
begin
repeat
Withdraw1;
until (invcount = 7);
if (invcount = 7) then
begin
repeat
Withdraw2;
until (invcount = 14);
repeat
Withdraw3;
until (invcount = 21);
repeat
Withdraw4;
until (invcount = 28);
UsePieShell;
end;
end;
end.

thanks xD

YoHoJo
01-19-2012, 07:04 AM
There is another thread about it, it's a problem in FindObj, try searching for it, forgot what was said about it.