+ Reply to Thread
Results 1 to 9 of 9

Thread: Woodcutter inventory problem

  1. #1
    Join Date
    Jul 2007
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Woodcutter inventory problem

    I set up the script and got it to run fine and dany on VE oaks and i loved it. My only problem is that once it reaches the bank and checks in the inventory or after getting a full inventory and checks it before dropping while im power chopping, the script has an error.
    Error: Out Of Range at line 294

    It stops the script and highlights line 294 in the MainLoop.
    Here's the code from 293 to 310 so you dont have to bother looking yourself.
    Code:
    begin
            SetLength(intItems[k][i], Length(Items[k][i]));
            SetLength(exps[k][i], Length(intItems[k]));
    
            intItems[k][i] := MSI_VarToIntArray(Items[k][i]);
            exps[k][i]     := Experiences[k][i];
    
            for j := 0 to High(intItems[k][i]) do
            begin
              itemCount := CountItems('dtm', MSI_Items[intItems[k][i][j]].DTM, []);
              expCount  := Round(exps[k][i][j] * itemCount);
    
              MSI_AddToProggy(PROG_ADD_EXP, -1, -1, expCount);  //adds exp to script
              MSI_AddToProggy(PROG_ADD_ITEMS, i, j, itemCount); //adds amount of item
    
              MSI_Debug('MSI_CountItems', 'Found ' + IntToStr(itemCount) + ' of item '
                        + MSI_Items[intItems[k][i][j]].Name, DEBUG_FUNCTIONS);
            end;
    I'd appriciate any help.

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

  3. #3
    Join Date
    Jul 2007
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I assumed since we were in the MSI section everyone would have it?

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

  5. #5
    Join Date
    Jul 2007
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah updated everything with the simba updater and then cause the walking was failing i used svn to get the latest version of reflection.

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

    Default

    Can you post how you setup your DeclarePlayers please?

  7. #7
    Join Date
    Jul 2007
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Can you post how you setup your DeclarePlayers please?
    Sure.
    Code:
    procedure DeclarePlayers;
    var
      i: Integer;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      SetLength(MSI_Players, HowManyPlayers);
      SetLength(ProgressReportArray, HowManyPlayers);
    
      CurrentPlayer := 0;
      CurrentScript := 0;
    
      with MSI_Players[0] do
       begin
        Name     := 'pliser';       // Username
        Pass     := 'a password :D';       // Password
        Nick     := 'plis';       // Nickname (3-4 lowercase letters from username)
        Pin      := '';       // Bank pin; leave as '' if player doesn't have one
        Active   := True;     // Use this player?
        Member   := False;    // Is this player a member?
        Location := LOC_VE_OAKS;        // See instructions at the top
        Scripts  := [SCRIPT_POWER_CHOP];       // See instructions at the top
        Objects  := [[TREE_OAK],[TREE_NORMAL]];     // See instructions at the top
        Loads[0] := 10;        // Amount of loads before breaking/switching players
        Loads[1] := 100;        // Total loads for the player to do
      end;

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

    Default

    You haven't setup the Objects part properly.

    Each set of brackets (inside the brackets) represents the objects for each script. What you want is this:
    Code:
    Objects := [[TREE_OAK, TREE_NORMAL]];
    That should get rid of you problem.

  9. #9
    Join Date
    Jul 2007
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah thanks a lot. Works great now

+ 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
  •