Jump to content


Photo
Question

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



Best Answer Dr. McKay , 21 January 2019 - 02:45 PM

That looks correct enough, though you should probably also check the tag's category.

Go to the full post


  • Please log in to reply
4 replies to this topic

#1 roughnecks

roughnecks

    Advanced Member

  • Member
  • PipPipPip
  • 58 posts

Posted 20 January 2019 - 12:24 PM

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



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,166 posts

Posted 21 January 2019 - 01:10 AM

You should check the item's tags.



#3 roughnecks

roughnecks

    Advanced Member

  • Member
  • PipPipPip
  • 58 posts

Posted 21 January 2019 - 09:33 AM

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, 21 January 2019 - 11:12 AM.


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,166 posts

Posted 21 January 2019 - 02:45 PM   Best Answer

That looks correct enough, though you should probably also check the tag's category.


  • roughnecks likes this

#5 roughnecks

roughnecks

    Advanced Member

  • Member
  • PipPipPip
  • 58 posts

Posted 21 January 2019 - 03:39 PM

Thanks, will do  :P







Also tagged with one or more of these keywords: Question

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users