Results 1 to 7 of 7

Thread: CountItemsDTM Nonexistent?

  1. #1
    Join Date
    Mar 2007
    Location
    Eugene, Oregon
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default CountItemsDTM Nonexistent?

    Is the CoundItemsDTM function nonexistent now? If so, is there an alternative?


    Code:
    Procedure CountTheLogs;
    begin
     If(Invfull) then
     begin
     LogsInInv := DTMFromString('78DA639CCCCCC0709F910119E4861831FC07D' +
           '220D1FF40C0D80254F300550D44164602E9694035CF09A8594484' +
           '3973816AAE125033990835DD84D50000CE0D102E');
     CountItemsDTM('Inv', LogsInInv);
     NumLogsCut:= NumLogsCut+CountItemsDTM('Inv', LogsInInv);
     FreeDTM(LogsInInv);
     end;
    end;

    For counting logs in the inventory, I used this to get an accurate number of how many logs have been cut, but I get an unknown identifier "CountItemsDTM" in script error.

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    There is CountItems:
    SCAR Code:
    {*******************************************************************************
    function CountItems(Identifier: Integer; ItemType: string; tol: TIntegerArray): Integer;
    By: WT-Fakawi / Sumilion
    Description: Counts Items in the inventory.
      ItemType - 'dtm', 'bitmap', 'bitmap mask', 'color'
      Item - name/value of your dtm/bmp/color/bmpmask.
      Tol - 'dtm' - [] (dtm's can't have tolerance).
            'bmp' - [BMPTol].
            'color' - [COLOUR Tol, Colour Count].
            'bmpmask' - [BMPTol, ContourTol].
    *******************************************************************************}

  3. #3
    Join Date
    Mar 2007
    Location
    Eugene, Oregon
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Does this work in the same sense, if I call my DTM and then use CountItems can I use its name and it will work the same?

    Edit: Nevermind I got it by using CountItems. Thank you
    Last edited by FuruChan; 05-04-2009 at 09:31 AM.

  4. #4
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    i was tring that too and ic ouldnt get it to work so i jstu ended up haveing it count the items in my inventory


    Code:
    countinv
    thats what it is i believe

  5. #5
    Join Date
    Mar 2007
    Location
    Eugene, Oregon
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by J_Pizzle View Post
    i was tring that too and ic ouldnt get it to work so i jstu ended up haveing it count the items in my inventory


    Code:
    countinv
    thats what it is i believe
    Well I only wanted to count certain items so I used this...

    SCAR Code:
    Procedure CountTheLogs;
    begin
     If(Invfull) then
     begin
     LogsInInv := DTMFromString('78DA639CCCCCC0709F910119E4861831FC07D' +
           '220D1FF40C0D80254F300550D44164602E9694035CF09A8594484' +
           '3973816AAE125033990835DD84D50000CE0D102E');
     CountItems(LogsInInv, 'ogs', []);
     NumLogsCut:= NumLogsCut+CountItems(LogsInInv, 'ogs', []);
     FreeDTM(LogsInInv);
     end;
    end;

    That worked for me. That way it only counts logs not every item in inv.

  6. #6
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Actually, you should use this:
    SCAR Code:
    Procedure CountTheLogs;
    begin
     If(Invfull) then
     begin
     LogsInInv := DTMFromString('78DA639CCCCCC0709F910119E4861831FC07D' +
           '220D1FF40C0D80254F300550D44164602E9694035CF09A8594484' +
           '3973816AAE125033990835DD84D50000CE0D102E');
     NumLogsCut:= NumLogsCut+CountItems(LogsInInv, 'dtm', []);
     FreeDTM(LogsInInv);
     end;
    end;

  7. #7
    Join Date
    Mar 2007
    Location
    Eugene, Oregon
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh ok thanks

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
  •