Results 1 to 2 of 2

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

  1. #1
    Join Date
    Dec 2011
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

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

    Thanks to everyone that told me about ACA 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

    Simba Code:
    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

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    There is another thread about it, it's a problem in FindObj, try searching for it, forgot what was said about it.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •