Results 1 to 4 of 4

Thread: Opening Bank Procedure?

  1. #1
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default Opening Bank Procedure?

    Hello, I am trying to get the hang of scripting but I keep getting this error and I don't know what is wrong with the procedure.

    Simba Code:
    procedure OpenBank1;
    begin
     if OpenBank('clt', False, True) then
        Withdraw('flax')
      else
      Writeln('Failed to Open Bank, Trying again!')

    begin
      Wait(1000);
     if OpenBank('clt', True, True) then
        Withdraw('flax')
     else
      Writeln('Failed to Open Bank, Trying again!');

    begin
      Wait(1000);
      if OpenBank('clt', True, True) then
        Withdraw('flax')
     else
      Writeln('Failed to Open Bank, Loggin off!');
      Wait(1000);
      logout;
      end;
     end;
    end;

    Heres the error:

    Code:
    [Error] (58:3): Invalid number of parameters at line 57
    This line

    Simba Code:
    procedure OpenBank1;
    begin
     if OpenBank('clt', False, True) then
        Withdraw('flax')
      else <-------------------------------------
      Writeln('Failed to Open Bank, Trying again!')
    Last edited by ffcfoo; 06-25-2012 at 11:17 AM.

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Exactly what the error is telling u:
    Simba Code:
    function Withdraw(col, row, Amount: Integer): Boolean;
    it doesn't just withdraw the item for u, u have to specify the column,row and amount. Otherwise u will have to make a DTM of flax to withdraw it directly (regardless of which bank slot it is at)

  3. #3
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    Exactly what the error is telling u:
    Simba Code:
    function Withdraw(col, row, Amount: Integer): Boolean;
    it doesn't just withdraw the item for u, u have to specify the column,row and amount. Otherwise u will have to make a DTM of flax to withdraw it directly (regardless of which bank slot it is at)
    Thank you, knew the Withdraw function looked a little funky xD!

  4. #4
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by ffcfoo View Post
    Thank you, knew the Withdraw function looked a little funky xD!
    Spotted a couple more mistakes, and u can just use a loop to repeat the procedure until it is found:
    Simba Code:
    procedure OpenBank1;
    var
      fail: Integer;
    begin
      repeat
        if OpenBank('clt', False, True) then
        begin
          Withdraw(col,row,amount);
          Break;
        end;

        Inc(fail);
        if (fail>2) then
        begin
          Writeln('Failed to Open Bank, Loggin off!');
          Logout;
          TerminateScript;
        end;

        Wait(1000+Random(500));  //never use static waits
        Writeln('Failed to Open Bank, Trying again!');
      until(false);
    end;

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
  •