Results 1 to 4 of 4

Thread: InvCount?

  1. #1
    Join Date
    Jun 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    16 Post(s)

    Default InvCount?

    I'm making a script that buys X items from a store depending on how much free space is in the inventory. So right now I manulay put how much inventory space I have free so
    Simba Code:
    TypeSend(26);
    .

    I just need to know a function that will input the output of
    Simba Code:
    (28 - Totalcount)
    this gives how much it needs to buy based on free space.
    Last edited by jman1208; 10-17-2012 at 07:12 PM.

  2. #2
    Join Date
    Nov 2011
    Location
    MA
    Posts
    545
    Mentioned
    3 Post(s)
    Quoted
    10 Post(s)

    Default

    Simba Code:
    program Count;
    {$DEFINE SMART}
    {$i SRL/srl.simba}

    Function InventoryFree: integer;
    begin
      Result := (28 - InvCount);
      Writeln(Result);
    end;

    begin
      TypeSend(IntToStr(InventoryFree));
    end.
    Last edited by tehq; 10-17-2012 at 07:13 PM.

  3. #3
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    What you have posted would work with a few changes.

    Invcount returns how many inventory slots are filled, so the amount of free spaces would be 28-invcount. That would be an integer, and TypeSend requires a string. So your final piece of code should look like this:

    Simba Code:
    TypeSend(ToStr(28 - Invcount));

  4. #4
    Join Date
    Jun 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by Nebula View Post
    What you have posted would work with a few changes.

    Invcount returns how many inventory slots are filled, so the amount of free spaces would be 28-invcount. That would be an integer, and TypeSend requires a string. So your final piece of code should look like this:

    Simba Code:
    TypeSend(ToStr(28 - Invcount));
    Thank you! I actually figured it out right before you posted.

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
  •