+ Reply to Thread
Results 1 to 6 of 6

Thread: problem with banking

  1. #1
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default problem with banking

    i have found a problem with the banking
    if you have set 2 objects on a script then this happens
    12:44:30 AM: Simbatester: Entering Func: MSI_OpenBank: Successfuly opened Varrock east bank
    12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Bronze pickaxe in inventory
    12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Iron pickaxe in inventory
    12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Steel pickaxe in inventory
    12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Mithril pickaxe in inventory
    12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Adamant pickaxe in inventory
    12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Rune pickaxe in inventory
    12:44:31 AM: Simbatester: Entering Func: MSI_Deposit: Successfully deposited materials
    12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Bronze pickaxe in inventory
    12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Iron pickaxe in inventory
    12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Steel pickaxe in inventory
    12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Mithril pickaxe in inventory
    12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Adamant pickaxe in inventory
    12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Rune pickaxe in inventory
    12:44:42 AM: Simbatester: Player Action: MSI_MainLoop: Failed to bank materials
    its to do with this bit in MSI_BankMaterials in MainLoop.scar
    SCAR Code:
    with MSI_Players[CurrentPlayer] do
      begin
        SetLength(itemsDeposited, Length(Items[CurrentScript]));

        for i := 0 to High(Items[CurrentScript]) do
        begin
          intItems := MSI_VarToIntArray(Items[CurrentScript][i]);
          itemsDeposited[i] := MSI_Deposit(intItems, []);
        end;
      end;

      for i := 0 to High(itemsDeposited) do
        if (not itemsDeposited[i]) then
        begin
          Result := False;
          ProgressReportArray[CurrentPlayer].FalseReason := 'Failed to deposit items';
          Exit;
        end;

    what is happening is in the first bit
    SCAR Code:
    with MSI_Players[CurrentPlayer] do
      begin
        SetLength(itemsDeposited, Length(Items[CurrentScript]));

        for i := 0 to High(Items[CurrentScript]) do
        begin
          intItems := MSI_VarToIntArray(Items[CurrentScript][i]);
          itemsDeposited[i] := MSI_Deposit(intItems, []);
        end;
      end;
    it sets the length of itemsDeposited to however many objects there are, then it goes through
    the first time it banks everything because im holding the pickaxe and sets itemsDeposited[0] to true
    but because everything is banked when it does it again it sets itemsDeposited[1] to false

    then in the second bit of code
    SCAR Code:
    for i := 0 to High(itemsDeposited) do
        if (not itemsDeposited[i]) then
        begin
          Result := False;
          ProgressReportArray[CurrentPlayer].FalseReason := 'Failed to deposit items';
          Exit;
        end;
    it goes through, sees that itemsDeposited[1] is false, and logs the player out saying that it failed to deposit the items

    ~shut
    Last edited by Shuttleu; 07-23-2010 at 12:03 AM.

  2. #2
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    You're wrong...

    the code you showed:
    ProgressReportArray[CurrentPlayer].FalseReason := 'Failed to deposit items';

    the quote:
    12:44:42 AM: Simbatester: Player Action: MSI_MainLoop: Failed to bank materials



    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  3. #3
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Yeah I noticed this yesterday when I was testing the VEM. It should be fixed now.

  4. #4
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    You're wrong...

    the code you showed:
    ProgressReportArray[CurrentPlayer].FalseReason := 'Failed to deposit items';

    the quote:
    12:44:42 AM: Simbatester: Player Action: MSI_MainLoop: Failed to bank materials



    ~RM
    it may be the wrong bit of code for the debug i posted but it is the bit of code that screws up, it sets ProgressReportArray[CurrentPlayer].FalseReason to 'Failed to deposit items' which is used in the progress report, but the fact is that is what is setting the player to false, thus screwing the script/user up

    im guessing the only reason why we have not noticed this before is because it is the first bankable script which can have more than one object

    ~shut

  5. #5
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Shuttleu View Post
    it may be the wrong bit of code for the debug i posted but it is the bit of code that screws up, it sets ProgressReportArray[CurrentPlayer].FalseReason to 'Failed to deposit items' which is used in the progress report, but the fact is that is what is setting the player to false, thus screwing the script/user up

    im guessing the only reason why we have not noticed this before is because it is the first bankable script which can have more than one object

    ~shut
    Yeah you were right, that's where the error is. This worked for me after my fix, is it working for you now?

  6. #6
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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