Results 1 to 11 of 11

Thread: Amount.scar - some "duplicate" functions...

  1. #1
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default Amount.scar - some "duplicate" functions...

    Well CountItemsDTM and CountItemsBMP are just bumping up the compiling time since there is the CountItems in Inventory.scar...

  2. #2
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    am i wrong or does countitems in inventory.scar count all the items in the inventory? and CountitemsDTM and BMP count a certain item, for use in a proggy or any other reason you would use them.
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  3. #3
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Same as n3ss, if it doesnt give me some errors, it gives me a 'Mined : 0 Rocks' at my progress report....(Using CountItemsBmp and CountItemsDtm)...


  4. #4
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea i heard it was outdated, but not "duplicate". maybe be taken out, but not for being duplicated

    and n3ss said it was just a rumour
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  5. #5
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Atleast the whole amount.scar isn't outdated.


    am i wrong or does countitems in inventory.scar count all the items in the inventory? and CountitemsDTM and BMP count a certain item, for use in a proggy or any other reason you would use them.
    Bah. If you would bother to view the functions CountItemsDTM, CountItemsBMP etc use, you would see they do the same as the CountItems in inventory.scar, which counts how many instances of an item is there in the inventory, not stacks.

    Amount<identifier> is for stacks, and the Count ones count the instances.

  6. #6
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    Atleast the whole amount.scar isn't outdated.




    Bah. If you would bother to view the functions CountItemsDTM, CountItemsBMP etc use, you would see they do the same as the CountItems in inventory.scar, which counts how many instances of an item is there in the inventory, not stacks.

    Amount<identifier> is for stacks, and the Count ones count the instances.
    Problem solved i think, rev #15 is out.


  7. #7
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Well it wasn't any actual "problem", but it was just plain stupid to have two of the function with same purpose, and no, it isn't fixed.

  8. #8
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    Well it wasn't any actual "problem", but it was just plain stupid to have two of the function with same purpose, and no, it isn't fixed.
    That is because I only saw this thread just now...



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  9. #9
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    But you haven't been on MSN today except for like 5 minutes, which was when I forgot about this thread Come to msn...

    If you come I will give you a cookie and a TPA ChooseOption

  10. #10
    Join Date
    Feb 2007
    Posts
    419
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I use CountItemsDTM and it's nice.
    but it is true that having the duplicate is pointless, however DTM's are harder than bitmaps so some noobs might want to use them, and DTM's are better so all the smart people use DTM's

  11. #11
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    But look -

    SCAR Code:
    {*******************************************************************************
    function CountItems(identifier: Integer; identifiertype: string; tol: TIntegerArray): Integer;
    By: WT-Fakawi / Sumilion
    Description: Performs a count of inventory items by "identifier" with tol[0]
    as color tolerance, tol[1] as contour tolerance in case of bmp masks. Valid identifiertypes are :
    bmp, mask, color, dtm.
    *******************************************************************************}


    function CountItems(identifier: Integer; identifiertype: string; tol: TIntegerArray): Integer;
    var
      i, x, y, coltol, contol: Integer;
      TB: Tbox;
    begin
      result := 0;
      case LowerCase(identifiertype) of
        'bmpmask', 'bitmapmask', 'bmp mask', 'bitmap mask', 'mask':
          try
            begin coltol := tol[0]; contol := tol[1] end;
          except
            srl_Warn('CountItems', 'Tol was incorrect', warn_AllVersions);
            Exit;
          end;
        'dtm': begin end;
        'bmp', 'bitmap', 'color':
          try
            coltol := tol[0];
          except
            srl_Warn('CountItems', 'Tol was incorrect', warn_AllVersions);
            Exit;
          end;
        else begin
          srl_Warn('CountItems', 'Invalid identifier type: ' + identifiertype, warn_AllVersions);
          Exit;
        end;
      end;

      GameTab(4);
      for i := 1 to 28 do
      begin
        TB := InvBox(i);
        if ExistsItem(i) then
        try
          case LowerCase(identifiertype) of
            'bmp', 'bitmap':
              if FindBitmapSpiralTolerance(identifier, x, y, TB.x1, TB.y1, TB.x2, TB.y2, coltol) then
                Inc(Result);
            'bmpmask', 'bitmapmask', 'bmp mask', 'bitmap mask', 'mask':
              if FindBitmapMaskTolerance(identifier, x, y, TB.x1, TB.y1, TB.x2, TB.y2, coltol, contol) then
                Inc(Result);
            'color':
              if FindColorTolerance(x, y, identifier, TB.x1, TB.y1, TB.x2, TB.y2, coltol) then
                Inc(Result);
            'dtm':
              if FindDtm(identifier, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
                Inc(Result);
          end;
        except end;
      end;
    end;

    You can use a bitmap, mask or a dtm with it! So, CountItemsDTM and CountItemsBMP are useless.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. action="www.site.com" method="post"
    By Jason2gs in forum General
    Replies: 4
    Last Post: 05-17-2007, 11:50 PM
  2. Replies: 3
    Last Post: 04-19-2007, 03:44 AM
  3. Replies: 5
    Last Post: 10-26-2006, 11:30 PM

Posting Permissions

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