mrkafr Posted December 26, 2018 Report Posted December 26, 2018 Hi,im sorry to bother you but i need a litte bit of help. I need to find, how to get my sended offers and to be honest, I dont even know where to start, what function use and even if its possible or if i will need o save every trade i send. Thank you Quote
Dr. McKay Posted December 27, 2018 Report Posted December 27, 2018 https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOfferManager#getoffersfilterhistoricalcutoff-callback Quote
mrkafr Posted December 27, 2018 Author Report Posted December 27, 2018 Thank you very much... I have one more question.. Sometimes I get error "Not Logged In", I know I should call logOn when that happen, but is it possible even when i dont have my secrets implemented yet? Error: Not Logged In at SteamCommunity.manager._community.httpRequestPost (C:\Works\SteamBot\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:483:25) at Request._callback (C:\Works\SteamBot\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (C:\Works\SteamBot\node_modules\request\request.js:185:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request.<anonymous> (C:\Works\SteamBot\node_modules\request\request.js:1161:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at IncomingMessage.<anonymous> (C:\Works\SteamBot\ScrapBot\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:313:30) I need to input my 2 factor everytime I logOn, so I dont know if calling logOn could work if I dont type my 2 factory to console...I found function autoRelogin in Documentation which should be true on defaut, so why I do i even get logout? Quote
Dr. McKay Posted December 28, 2018 Report Posted December 28, 2018 You're not losing your connection to the Steam servers. Your web session has expired. They're two separate things. When you connect to the Steam CM (the server the Steam client connects to), the CM issues you a "nonce" which is then exchanged for web session cookies via the API. Those session cookies can expire, and so you'll need to get new ones from your still-connected connection to the CM. That's what webLogOn is for. This is exactly what's happening when you see this in your Steam client: Your client is still connected, but the web session is expired. So it needs to get new cookies. Quote
mrkafr Posted December 29, 2018 Author Report Posted December 29, 2018 (edited) community.on('sessionExpired', (err) => { console.log("Relogging."); client.webLogOn((err) => { if (err) { throw err; } }); });So something like this should work, right?But this dont cover up if steam goes down, right? Then it should emit something like error >400 but how to cover it up in the code? Sorry, im new inNode. EDIT: Okay, i still getting Not Logged In, i think im doing my callback wrong. const logOnOptions = { accountName: XXX, password: XXX, }; client.logOn(logOnOptions); client.on('loggedOn', () => { console.log('Logged into Steam'); }); client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies, (err) => { if (err) { throw err; } }); community.setCookies(cookies, (err) => { if (err) { throw err; } }); }); community.on('sessionExpired', (err) => { console.log("Relogging."); client.webLogOn((err) => { if (err) { throw err; } }); }); manager.on('newOffer', offer => { console.log("You get a trade offer") if (offer.itemsToGive.length === 0) { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(`Donation accepted`); } }); } else if (isVerified(offer.partner.getSteamID64())) { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(`Accepted offer.`); } }); } if (pendingCaseOffer == false) { SellCheap() } }) Edited December 30, 2018 by mrkafr Quote
Recommended Posts
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.