Results 1 to 4 of 4

Thread: How to use "getcontainer"

  1. #1
    zami84's Avatar
    Join Date
    May 2012
    Posts
    316
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    48
    Rep Power
    5

    How to use "getcontainer"

    Hello, anyone know how to use a getcontainer function?

    Quote Originally Posted by blakw View Post
    2.5 Item Class
    No description.

    • getcontainer(string/int container) [pointer]: Return data structure of defined container (index or name).
      • .id [int]: Represent container ID.
      • .index [int]: Represent container index number.
      • .maxslots [int]: Represent the maximum number of slots in the container.
      • .name [string]: Represent the name of the container.
      • .open [string]: Return true if the container is opened, else return false.
      • .usedslots [int]: Represent the number of used slots in the container.
      • .items [userdata]: Return data structure of items inside container, item must be indexed to access data.
        • .count [int]: Represent the item amount.
        • .id [int]: Represent the item ID.

    i would like to use somethng like :
    getcontainer("bag").items.id

    Some action that return all in-backpack items id`s.
    Last edited by zami84; 02-06-2014 at 12:17 PM.

  2. #2
    iBot User
    Join Date
    Aug 2012
    Posts
    805
    Mentioned
    18 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    38 Post(s)
    Reputation
    180
    Rep Power
    7
    PHP Code:
    getcontainer("bag").items[0].id 
    it will return id of first item in bp

  3. #3
    iBot User walukasz's Avatar
    Join Date
    Feb 2012
    Location
    Poland
    Posts
    312
    Mentioned
    39 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    25 Post(s)
    Reputation
    67
    Rep Power
    5
    PHP Code:
    local bp getcontainer(0)

    for 
    1bp.usedslots do
        print(
    bp.items[i].id)
    end 
    to iterate

  4. #4
    zami84's Avatar
    Join Date
    May 2012
    Posts
    316
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    48
    Rep Power
    5
    Reps+ sended.
    Solved

Posting Permissions

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