Jump to content
McKay Development

Recommended Posts

Posted

Say I want to create an offer but need to add just Trading Cards to it, how do I select them?

 

I already know about appid, contextid and "item_class_2" but I need a working example after I loaded my Inventory, which has 4 [Object] inside "tags":

 

  CEconItem {
    appid: 753,
    contextid: '6',
    assetid: '10305554518',
    classid: '1496965455',
    instanceid: '0',
    amount: 1,
    pos: 30,
    id: '10305554518',
    background_color: '',
    icon_url:
     'IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEaiHLrVJRsl8vGuCUY7Cjc9ehDNVzDMCeHqtjCQrcex4NM6b8wT1tePGP3j2fSSCJizYG1s1RLtXYTzc9zSjsL-QQj6dE-wkEggGfvQA8GFPPZzbNhM_1YcK_GPhwwp3DhFucMpUdAqp9X0eMLoglXVEd59RmXWjJpDc1F5hYUA8W-2yBLzHbdLzlSYhCxtiGvEYMYOXsXDyuMmmfLGLLIM8gGfI',
    icon_url_large:
     'IzMF03bk9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdA3g5gMEPvUZZEaiHLrVJRsl8vGuCUY7Cjc9ehDNVzDMCeHqtjCQrcex4NM6b8wT1tePGP3j2fSSCJizYG1s1RLtXYTzc9zSjsL-QQj6dE-wkEggGfvQA8GFPPZzbNhM_1YcK_GPhwwp3DhFucMpUdAqp9X0eMLoglXVEd59RmXWjJpDc1F5hYUA8W-2yBLzHbdLzlSYhCxtiGvEYMYOXsXDyuMmmfLGLLIM8gGfI',
    descriptions: [ [Object] ],
    tradable: true,
    owner_actions: [ [Object], [Object] ],
    name: 'Santa Claus',
    type: 'Solitaire Christmas. Match 2 Cards Trading Card',
    market_name: 'Santa Claus',
    market_hash_name: '428510-Santa Claus',
    market_fee_app: 428510,
    commodity: true,
    market_tradable_restriction: 7,
    market_marketable_restriction: 7,
    marketable: true,
    tags: [ [Object], [Object], [Object], [Object] ],
    is_currency: false,
    fraudwarnings: [] },
  CEconItem {
 
Posted

So, I get this for tags array (trading card):

 

[17:07:04] [LOG]    [ { internal_name: 'droprate_0',

    name: 'Common',

    category: 'droprate',

    category_name: 'Rarity',

    localized_tag_name: 'Common',

    color: '',

    localized_category_name: 'Rarity' },

  { internal_name: 'app_388390',

    name: '"Glow Ball" - The billiard puzzle game',

    category: 'Game',

    category_name: 'Game',

    localized_tag_name: '"Glow Ball" - The billiard puzzle game',

    color: '',

    localized_category_name: 'Game' },

  { internal_name: 'cardborder_0',

    name: 'Normal',

    category: 'cardborder',

    category_name: 'Card Border',

    localized_tag_name: 'Normal',

    color: '',

    localized_category_name: 'Card Border' },

  { internal_name: 'item_class_2',

    name: 'Trading Card',

    category: 'item_class',

    category_name: 'Item Type',

    localized_tag_name: 'Trading Card',

    color: '',

    localized_category_name: 'Item Type' } ]

 

 

 

And the getTag method is:

getTag(category)
  • category - A string containing the tag's category (the category property of the tag object)

 

So, which category should I look for? I don't see any meaningful one on the array.

Posted

Sorry but every Item has that "item_class" category, so how do I separate Cards from everything else?

 

[16:24:10] [LOG]    [ { internal_name: 'droprate_1',

    name: 'Uncommon',

    category: 'droprate',

    category_name: 'Rarity',

    localized_tag_name: 'Uncommon',

    color: '',

    localized_category_name: 'Rarity' },

  { internal_name: 'app_285840',

    name: 'Enemy Mind',

    category: 'Game',

    category_name: 'Game',

    localized_tag_name: 'Enemy Mind',

    color: '',

    localized_category_name: 'Game' },

  { internal_name: 'item_class_3',

    name: 'Profile Background',

    category: 'item_class',

    category_name: 'Item Type',

    localized_tag_name: 'Profile Background',

    color: '',

    localized_category_name: 'Item Type' } ]

Posted

I already used that 

tag.internal_name == 'item_class_2'

in another place but now it's different because I'm not getting a tags array when loading my inventory, but 3 or 4 nested objects (like I first posted) and I don't know how to access them.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...