Results 1 to 7 of 7

Thread: OpenBankNPC broken?

  1. #1
    Join Date
    Feb 2007
    Location
    Estonia.
    Posts
    1,938
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default OpenBankNPC broken?

    Hi,
    OpenBankNPC gives me out of range error.
    I'm using it like this atm:
    Code:
    if OpenBankNPC then
    begin
    Writeln('Opened bank via OpenBankNPC.');
    Result := True;
    end;
    And it gives me:
    Code:
    SRL Compiled in 15 msec
    Error: Out Of Range at line 1649
    The line is in bank.simba:
    Code:
      end;
    Any advice?

    ~Eerik.

  2. #2
    Join Date
    Dec 2011
    Location
    Texas
    Posts
    348
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I noticed your missing a semicolon in the begin

    Simba Code:
    if OpenBankNPC then
    [B]begin[/B]
    Writeln('Opened bank via OpenBankNPC.');
    Result := True;
    end;

  3. #3
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    What 'end;' is that?

    Something was updated so line 1649 is different for me.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  4. #4
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by Jhangir View Post
    I noticed your missing a semicolon in the begin

    Simba Code:
    if OpenBankNPC then
    [B]begin[/B]
    Writeln('Opened bank via OpenBankNPC.');
    Result := True;
    end;
    wat... you don't use semicolons after begins.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  5. #5
    Join Date
    Dec 2011
    Location
    Texas
    Posts
    348
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Harry View Post
    wat... you don't use semicolons after begins.
    Oh fawk me, answered this question while smoking hookah...

  6. #6
    Join Date
    Feb 2007
    Location
    Estonia.
    Posts
    1,938
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Narcle:
    Code:
    function OpenBankFast(Location: String): Boolean;
    var
      bo, i, l, c, z: Integer;
      Info: TVariantArray;
      Booths: TPointArray;
      ABooths: T2DPointArray;
      UpText: TStringArray;
      B: TBox;
    begin
      result := false;
      if (not LoggedIn) then
        Exit;
      if BankScreen or PinScreen then
      begin
        Result := True;
        Exit;
      end;
      UpText := ['ooth', 'Bo', 'ot'];
    
      case LowerCase(Location) of {            Sort X     Sort Y     Color    Tol   Hue   Sat   Count  SplitTPA?  W   H }
        'akb', 'al kharid':           Info := [MSCX - 50, MSCY,      11196157, 20,   0.20, 1.15, 100,   False,   10, 10]; // Fixed 12/7, #40
        'lb', 'lumbridge':            Info := [MSCX,      MSCY - 50, 6780805,  10,   0.19, 0.27, 100,   False,   10, 10]; // Fixed 12/7, #40
        'veb', 'varrock east':        Info := [MSCX,      MSCY + 50, 3037545,  5,    0.41, 1.32, 100,   False,   10, 10]; // Fixed 12/7, #40
        'vwb', 'varrock west':        Info := [MSCX,      MSCY,      3037545,  5,    0.41, 1.32, 100,   False,   10, 10]; // Fixed 12/7, #40
        'feb', 'falador east':        Info := [MSCX,      MSCY + 50, 5008519,  10,   0.22, 0.67, 100,   False,   10, 10]; // Fixed 12/7, #40
        'fwb', 'falador west':        Info := [MSCX,      MSCY + 50, 5074569,  15,   0.22, 0.67, 50,    False,   10, 10]; // Fixed 12/7, #40
        'db', 'draynor': begin UpText := ['ount', 'unte', 'oun', 'unter'];
                                      Info := [MSCX - 50, MSCY,      5136741,  5,    0.73, 0.49, 15,    False,   10, 10]; // Fixed 12/7, #40
                         end;
        'eb', 'edgeville bank':       Info := [MSCX + 20, MSCY,      3561835,  20,   0.32, 0.61, 50,    False,   10, 10]; // Fixed 12/7, #40
        'ctb', 'catherby bank':       Info := [MSCX,      MSCY,      3239049,  8,    0.20, 0.20, 100,   False,   10, 10];
        'clt', 'camelot bank':        Info := [MSCX,      MSCY,      7636882,  5,    0.20, 0.20, 100,   False,   10, 10];
        'nab', 'north ardougne bank': Info := [MSCX,      MSCY,      4084572,  5,    0.20, 0.20, 100,   False,   10, 10];
        'sab', 'south ardougne bank': Info := [MSCX,      MSCY,      4084572,  5,    0.20, 0.20, 100,   False,   10, 10];
        'ynb', 'yanille bank':        Info := [MSCX,      MSCY,      3239049,  7,    0.20, 0.20, 100,   False,   10, 10];
        'ngb', 'north gnome bank':    Info := [MSCX,      MSCY,      3239049,  7,    0.20, 0.20, 100,   False,   10, 10];
        'sgb', 'south gnome bank':    Info := [MSCX,      MSCY,      3239049,  7,    0.20, 0.20, 100,   False,   10, 10];
        'wgb', 'warrior guild bank':  Info := [MSCX,      MSCY,      2578286,  7,    0.20, 0.20, 100,   False,   10, 10];
        'fgb', 'fishing guild bank':  Info := [MSCX,      MSCY,      2908796,  10,   0.20, 0.20, 100,   False,   10, 10];
        else
        begin
          srl_Warn('OpenBankFast', 'Unknown bank: '+Location, warn_AllVersions);
          Exit;
        end;
      end;
    
      MakeCompass('n');
      z := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(Info[4], Info[5]);
    
      FindColorsSpiralTolerance(Info[0], Info[1], Booths, Info[2], MSX1, MSY1, MSX2, MSY2, Info[3]);
      ColorToleranceSpeed(z);
      SetColorSpeed2Modifiers(0.2, 0.2);
    
      { Split to ATPA. }
      if Info[7] then
        ABooths := SplitTPA(Booths, 1)
      else
        ABooths := TPAtoATPA(Booths, 10);
    
      Booths := [];
    
      { Go through ATPA. }
      l := GetArrayLength(ABooths) -1;
      for i := 0 to l do
      begin
        { Too few pixels. }
        if (Length(ABooths[i]) < Info[6]) then
          Continue;
    
        { Too small TPA bounds. }
        B := GetTPABounds(ABooths[i]);
        If ((B.X2 - B.X1) < Info[8]) Or ((B.Y2 - B.Y1) < Info[9]) Then
          Continue;
    
        Inc(bo);
        SetArrayLength(Booths, bo);
        Booths[bo-1] := MiddleTPA(ABooths[i]);
    
      end;
    
      SortTPAFrom(Booths, Point(Info[0], Info[1]));
    
      l := GetArrayLength(Booths) -1;
      for i := 0 to l do
      begin
    
        MMouse(Booths[i].X, Booths[i].Y, 3, 3);
        if WaitUpTextMulti(UpText, 1000) Then
        begin
          GetMousePos(Booths[i].X, Booths[i].Y);
          Mouse(Booths[i].X, Booths[i].Y, 0, 0, mouse_right);
          if WaitOptionMulti(['uickly', 'uick', 'ickly', 'ckl'], 1000) then
          begin
            FFLag(0);
            MarkTime(c);
            repeat
              Wait(100);
            until (BankScreen) or (PinScreen) or (TimeFromMark(c) > 10000);
            Wait(Random(300));
            if (HowManyPlayers > 0) then
              if (Players[CurrentPlayer].Pin <> '') then
                InPin(Players[CurrentPlayer].Pin);
            Result := (BankScreen) or (PinScreen);
            if (Result) then Exit;
          end;
        end;
    [THIS LINE]  end;[/THIS LINE]
    end;
    Scroll down the code to see which line is it.

    ~Eerik.

  7. #7
    Join Date
    Feb 2007
    Location
    Estonia.
    Posts
    1,938
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Bump.

    ~Eerik.

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
  •