Jump to content


Photo

Get gems only

node.js node-steam-tradeoffer-manager

  • Please log in to reply
1 reply to this topic

#1 Jace

Jace

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 08 August 2018 - 12:02 AM

I have this line for the intention of selling my card sets for his gems.
 

                           manager.getUserInventoryContents(steamID.getSteamID64(), CONFIG.GEMSFROMINVENTORY, 6, true, (ERR, INV, CURR) => {
                                if (ERR) {
                                    console.log(ERR);
                                    client.chatMessage(steamID, "Please try later");
                                } else {
                                    if (!ERR) {
                                        for (let i = 0; i < INV.length; i++) {
                                            if (theirGems < CONFIG.ACCEPTEDGEMS.indexOf(INV[i].market_hash_name) >= 0) {
                                               theirGems.push(INV[i]);
                                            }
                                        }
 
and at the end part I have this 

 

 
                                                                    theirGems.amount = [n];
                                                                    t.addTheirItems(theirGems);
 
 
instead it gets the other users whole inventory.


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,810 posts

Posted 10 August 2018 - 06:06 PM

You need to filter the inventory to get just the items you want. Array.prototype.filter will probably interest you.







Also tagged with one or more of these keywords: node.js, node-steam-tradeoffer-manager

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users