Jump to content
McKay Development

Recommended Posts

  • 2 weeks later...
Posted

Inventory is an array of items, you can use .filter() over the collection to keep just the item(s) you need.

 

An excerpt from my bot code:

static isGems(item) {
	return '753-Gems' === item.market_hash_name;
}

static isSackOfGems(item) {
	return '753-Sack of Gems' === item.market_hash_name;
}

Then, just use the .amount property to decide how many items you want to add to the trade for those which are stackeable like gems or sack of gems.

 

Posted
3 hours ago, Jack Nolddor said:

Inventory is an array of items, you can use .filter() over the collection to keep just the item(s) you need.

 

An excerpt from my bot code:

static isGems(item) {
	return '753-Gems' === item.market_hash_name;
}

static isSackOfGems(item) {
	return '753-Sack of Gems' === item.market_hash_name;
}

Then, just use the .amount property to decide how many items you want to add to the trade for those which are stackeable like gems or sack of gems.

 

I already found how to do it with context-id-amount. Thanks tho :)

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