Results 1 to 5 of 5

Thread: Counting inv Items with bank open [Help]

  1. #1
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Exclamation Counting inv Items with bank open [Help]

    ok so i need to count my items in my invent easy well so i thought

    im using the following but cant seam to make it work..

    Simba Code:
    program count;
    var
    objDTM : Integer;

    Procedure LoadDMTZ;
    begin
      objDTM := DTMFromString('blabla');
    end;

    procedure CheckInv(Check: String);
      var
      y :Integer;
    begin

    y := CountItems('dtm', objDTM, [0]); // dtm stored in the main var

      case Lowercase(Check) of
        'objcount':
          if (y<20) then
          begin
          Writeln('!FailSafe! - obj Inbalance');
          Writeln('obj found :' + IntToStr(y) );   // alwase returns 0 even when there is 20 in my invent
          DepositAll;
          end;
      else
        Writeln('selection error!');
      end;
    end;

    begin
    setup;
    LoadDMTZ;
    CheckInv('objcount')
    otherstuff;
    end.

    i want it to get the object from the bank count how many it has in invent of the object then if there is not any banking has faild so do it again if there is carry but it just will not count keeps returning 0 but cant see why oh and the banking screen is open but i cant see this effecting it...

    thanks for help in advanced
    Learning To Code - So Excuse the n00b questions!

  2. #2
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    If y = 0 then, your issue resides here:
    Simba Code:
    y := CountItems('dtm', objDTM, [0]); // dtm stored in the main var

    Try a new DTM?

  3. #3
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Well thats what i thought but it finds the dtm befor it counts it n gets items from the bank with it am in saying u can use the same dtm as many times as needed?

    Thanks for reply
    Learning To Code - So Excuse the n00b questions!

  4. #4
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Try CountItemsIn:
    Simba Code:
    y := CountItemsIn('inv', 'dtm', objDTM, [0]);

  5. #5
    Join Date
    Apr 2007
    Location
    Rimmington
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    i have actually got this to work now the problem was nothing but a wait script the script.

    it would get it from the bank then have a look but what it should have done is get it from the bank then waited a few seconds before having a look in the inv

    so this problem is solved for now!

    thanks for your help =]
    Last edited by NoUserName; 05-01-2012 at 07:28 PM.
    Learning To Code - So Excuse the n00b questions!

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
  •