Results 1 to 10 of 10

Thread: How Many DTM's can i see

  1. #1
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How Many DTM's can i see

    The says it all is there a way of counting how many DTMs you can see
    I need this to see when a ore is in the inv or is there a easyer way of counting that i just need a way of seeing how many items are in the inv and if there is a new one
    I see Now, says the blind man

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    SRL/SRL/Core/Inventory.scar

    function InvCount: Integer;

    function InvFull: Boolean;

    {************************************************* ******************************
    function CountItems(ItemType: string; Identifier: Integer; 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
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    SRL/SRL/Core/Inventory.scar

    function InvCount: Integer;

    function InvFull: Boolean;

    {************************************************* ******************************
    function CountItems(ItemType: string; Identifier: Integer; 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].
    ************************************************** *****************************}
    How Would i use it?

    Would it be like?
    SCAR Code:
    Var a:integer;

    Begin
      CountItems = a
        Repeat
          DoStuff;
        Until not (CountItems => a);
    End;

    Or would that not work at all
    I see Now, says the blind man

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    SCAR Code:
    Begin
        Repeat
          DoStuff;
        Until Invcount=7
    End;

    will until you have 7 items

    SCAR Code:
    Begin
        Repeat
          DoStuff;
        Until Invfull
    End;

    Will until you inventory is full

    SCAR Code:
    Begin
        Repeat
          DoStuff;
        Until CountItems('dtm',MyDTM,[]=6)
    End;

    Will until you have 6 of whatever item DTM in your inventory.

    If your just mining/chopping for example amount doesn't matter.
    Just

    SCAR Code:
    repeat
     stuff
    until (invful)
    DropItems;

  5. #5
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    var
      startCount: Integer;
    begin
      startCount := CountItems(...);
      DoSomething;
      while (CountItems(...) = startCount) do
      begin
        antibanetc;
        moarAntiban;
      end;
    end;
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  6. #6
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Would this work?

    SCAR Code:
    Procedure AreWeStillMining;
    Begin
      InvC := CountItems;
        While (InvC := CountItems) do
        Wait(600+random(600));
    End;
    I see Now, says the blind man

  7. #7
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    That would make X:=y
    and then while x=y do wait.
    So it would just wait forever.

    It "works", but its useless .

    While (InvC := CountItems) do
    needs to be
    While (InvC= CountItems) do

  8. #8
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    That would make X:=y
    and then while x=y do wait.
    So it would just wait forever.

    It "works", but its useless .

    While (InvC := CountItems) do
    needs to be
    While (InvC= CountItems) do
    So it would work the way i want it to if i take out the : in the while line? yea
    I see Now, says the blind man

  9. #9
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Yeah it would work, but it would be useless.
    That would make X:=y
    and then while x=y do wait.
    So it would just wait forever.

  10. #10
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Yeah it would work, but it would be useless.
    That would make X:=y
    and then while x=y do wait.
    So it would just wait forever.
    But if im right altho im not normly when it comes to scar

    The X is Inv count at start
    The Y Is Real time Inv count

    And im calling this right after i clicked a rock so does it not wait until its mined the ore and the Y would be up one so it would end the procedure
    Or am i just making no sence atall
    I see Now, says the blind man

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
  •