Results 1 to 5 of 5

Thread: Request: how to check if backpack is full / empty

  1. #1
    Normal User Boget's Avatar
    Join Date
    Nov 2012
    Posts
    152
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    22
    Rep Power
    5

    Question How to check if backpack is full / empty?

    Is it possible to check if all slots in an open container are occupied, for example if a backpack is full (and there is no more room for other non-stackable items)?

    In situations where you know how many slots there are in the backpack (e.g. 20) and if you’re sure the backpack only contains 1 type of item you could use itemcount(), but what if you don’t know these things? Is it possible?

  2. #2
    Normal User
    Join Date
    Mar 2012
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    There's something like "usedslots()". I've seen it some couple of times.
    So I assume you could mix the following script code to get your action done:
    usedslots == 20 + itemcount(6969, BpName) > 69

  3. #3
    Normal User Boget's Avatar
    Join Date
    Nov 2012
    Posts
    152
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    22
    Rep Power
    5
    Quote Originally Posted by Sayow View Post
    There's something like "usedslots()". I've seen it some couple of times.
    You’re right, getcontainer(backpack).usedslots is what I was looking for Thanks!

  4. #4

    Join Date
    Jul 2012
    Posts
    362
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    45
    Rep Power
    5
    So what? if getcontainer("red backpack").usedslots == 20 then closewindow("red backpack") end
    works like that?

  5. #5
    iBot User Raph_'s Avatar
    Join Date
    Feb 2013
    Posts
    391
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    59
    Rep Power
    4
    Ye tubcio.

Posting Permissions

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