Jump to content
McKay Development

EconItems: distinguish between Trading Card, Booster, Gems, Emote and Background


Recommended Posts

Posted

Hi again :)

 

What is the best approach to determine if an Item belonging to Steam Inventory 753 - contextid 6 (steam community) - is a Card, Booster, etc...

I was looking at the "offer" object for an incoming offer and found out that Booster Packs and Gems are actually called like that under "type" but for cards, bgs and emotes it's a little different - some examples:

 

1)    type: '"Glow Ball" - The billiard puzzle game Trading Card',

2)    type: 'DISTRAINT: Deluxe Edition Uncommon Emoticon',

3)    type: 'Unexpected Day Profile Background',

 

So, should I use the type value and match for e.g. "Emoticon" or is there a better way to identify those items' type?

 

Thanks

Posted (edited)

OK, so I got this from tags array for Emoticon:

 

    [ { internal_name: 'droprate_1',
    name: 'Uncommon',
    category: 'droprate',
    category_name: 'Rarity',
    localized_tag_name: 'Uncommon',
    color: '',
    localized_category_name: 'Rarity' },
  { internal_name: 'app_319180',
    name: 'Platypus II',
    category: 'Game',
    category_name: 'Game',
    localized_tag_name: 'Platypus II',
    color: '',
    localized_category_name: 'Game' },
  { internal_name: 'item_class_4',
    name: 'Emoticon',
    category: 'item_class',
    category_name: 'Item Type',
    localized_tag_name: 'Emoticon',
    color: '',
    localized_category_name: 'Item Type' } ]
 
 
Can you make an example on what should I extract from it?
 
 
EDIT: Can this be acceptable?
 
offer.itemsToReceive[0].tags.forEach(element => {
	//console.log(element);
	if (element.internal_name.includes('item_class_2')) {
		console.log('It\'s a Card!');
Edited by roughnecks

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...