Jump to content


Photo
Question

Help me with the trade

node.js node-steam-tradeoffer-manager

  • Please log in to reply
1 reply to this topic

#1 Zorenko

Zorenko

    Member

  • Member
  • PipPip
  • 13 posts

Posted 17 April 2019 - 12:47 AM

I need that when the trade was confirmed on the computer, it was canceled and a new one was created, with the same skins

 

    My code:

manager.on('TradeOfferManager.ETradeOfferState[9]', function(offer, oldState) {
            let offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=149081977&token=Cb2UfEHh");
            offer.addMyItems(inventory);
            offer.send(function(err, status)
            {
                if (err) {
                    console.log(err);
                    return;
                }

                if (status == 'pending') {
                    // We need to confirm it 
                    
                    
                    console.log("Items " + manager.getOffer);
                    console.log(`Offer #${offer.id} sent, but requires confirmation`);
                    community.acceptConfirmationForObject("identitySecret", offer.id, function(err) {
                        if (err) {
                            console.log(err);
                        } else {
                            console.log("Offer confirmed");
                        }
                    });
                } else {
                    console.log(`Offer #${offer.id} sent successfully`);
                }
            });
}); 

When I confirm the exchange on the computer, nothing happens   :(. ETradeOfferState[3] - confirmed trade

And another question, how to get things from the trade, then to create a trade with the same things?

 

If ETradeOfferState[offer.state] = ETradeOfferState[9], trade must cancel, I do not know how to make a check offer.state when I get a newOffer or sentOfferChanged

 

 



#2 helpme

helpme

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 17 April 2019 - 09:55 AM

manager.on('sentOfferChanged', function(offer) {
if (offer.state == 9) {
console.log('9');
}
});







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

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users