Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var config = require('./config.js');
- var SteamUser = require('steam-user');
- var client = new SteamUser();
- var SteamCommunity = require("SteamCommunity");
- var community = new SteamCommunity();
- var SteamTotp = require('steam-totp');
- var mobilecode = SteamTotp.getAuthCode(config.sharedsecret);
- var TradeOfferManager = require('steam-tradeoffer-manager');
- var manager = new TradeOfferManager({
- "steam": client,
- "domain": "http://localhost",
- "language": "en",
- "pollInterval": "5000"
- });
- var login = {
- accountName: config.username,
- password: config.password,
- twoFactorCode: mobilecode
- };
- client.logOn(login);
- client.on('loggedOn', function(details) {
- client.getPersonas([client.steamID], function(personas) {
- console.log('Logged in as ' + client.steamID + ' (' + personas[client.steamID]["player_name"] + ')');
- console.log();
- });
- console.log();
- client.setPersona(1); // Shows the status as online. 0 = offline (It will still work though!) 1 = online
- setInterval(function() { client.webLogOn(); }, 1000 * 60); // Refreshes session every 10 minutes
- });
- client.on('webSession', function(sessionID, cookies) {
- manager.setCookies(cookies, function(err) {
- if (err) { console.log("Couldn\'t set cookies! Error: " + err); }
- });
- community.setCookies(cookies);
- community.startConfirmationChecker(10000, config.identitysecret);
- });
- // client.on('error', function(e) {
- // console.log(e);
- // process.exit(1);
- // });
- client.gamesPlayed([730]);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement