• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] How do I check the amount of items in the bag and in the PC item storage?

107
Posts
3
Years
    • Seen Apr 27, 2023
    How do I check the amount of items in the bag and in the PC item storage?
    This function:
    Code:
     def pbQuantity(item)
        item = getID(PBItems,item)
        if !item || item<1
          raise ArgumentError.new(_INTL("Item number {1} is invalid.",item))
        end
        pocket = pbGetPocket(item)
        maxsize = maxPocketSize(pocket)
        maxsize = @pockets[pocket].length if maxsize<0
        return ItemStorageHelper.pbQuantity(@pockets[pocket],maxsize,item)
      end

    Checks a specific item, how can I go through all pockets?
    essentials v18.1
     
    Back
    Top