Scraebs Posted September 11, 2016 Report Posted September 11, 2016 Hello, I just started to use node-steam-tradeoffer manager. I installed node modules and wanted to run example (storehouse-steam) but it trow err.In the storehouse-steam.js I filled accountName and password (they are correct). It didnt send me code to the email. How should I fill "twoFactorCode": SteamTotp.getAuthCode("sharedSecret") if it needed and what else should I fill in this file? Thanks. var SteamUser = require('steam-user'); var SteamCommunity = require('steamcommunity'); var SteamTotp = require('steam-totp'); var TradeOfferManager = require('../lib/index.js'); // use require('steam-tradeoffer-manager') in production var fs = require('fs'); var client = new SteamUser(); var manager = new TradeOfferManager({ "steam": client, // Polling every 30 seconds is fine since we get notifications from Steam "domain": "example.com", // Our domain is example.com "language": "en" // We want English item descriptions }); var community = new SteamCommunity(); // Steam logon options var logOnOptions = { "accountName": "acname", "password": "mypassword", "twoFactorCode": SteamTotp.getAuthCode("sharedSecret") }; if (fs.existsSync('polldata.json')) { manager.pollData = JSON.parse(fs.readFileSync('polldata.json')); } client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam"); }); client.on('webSession', function(sessionID, cookies) { manager.setCookies(cookies, function(err) { if (err) { console.log(err); process.exit(1); // Fatal error since we couldn't get our API key return; } console.log("Got API key: " + manager.apiKey); }); community.setCookies(cookies); community.startConfirmationChecker(30000, "identitySecret"); // Checks and accepts confirmations every 30 seconds }); manager.on('newOffer', function(offer) { console.log("New offer #" + offer.id + " from " + offer.partner.getSteam3RenderedID()); offer.accept(function(err) { if (err) { console.log("Unable to accept offer: " + err.message); } else { community.checkConfirmations(); // Check for confirmations right after accepting the offer console.log("Offer accepted"); } }); }); manager.on('receivedOfferChanged', function(offer, oldState) { console.log(`Offer #${offer.id} changed: ${TradeOfferManager.ETradeOfferState[oldState]} -> ${TradeOfferManager.ETradeOfferState[offer.state]}`); if (offer.state == TradeOfferManager.ETradeOfferState.Accepted) { offer.getReceivedItems(function(err, items) { if (err) { console.log("Couldn't get received items: " + err); } else { var names = items.map(function(item) { return item.name; }); console.log("Received: " + names.join(', ')); } }); } }); manager.on('pollData', function(pollData) { fs.writeFile('polldata.json', JSON.stringify(pollData)); }); Quote
Dr. McKay Posted September 11, 2016 Report Posted September 11, 2016 That should be all you need. If steam-user isn't up to date, then InvalidPassword might indicate that Steam is rate-limiting your logins. Quote
Scraebs Posted September 12, 2016 Author Report Posted September 12, 2016 How can I fix it? Replenish the balance of the Steam? Quote
Scraebs Posted September 12, 2016 Author Report Posted September 12, 2016 Sorry for such a stupid question, I just did sth wrong with twofactorcode, now it's up 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.