Jump to content
McKay Development

Search the Community

Showing results for tags 'steam-totp'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Announcements
    • Releases & Updates
  • Help & Support
    • General
    • Guides
    • node-steam-user
    • node-steamcommunity
    • node-steam-tradeoffer-manager
    • node-steam-session

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Location


Interests

Found 7 results

  1. The is my steam bot code. Idk what is wrong to code bot it don't work very good because after 1-2 days it brakes. That are the errors that i get: Error: Disconnected at SteamClient._disconnected (/var/server/node_modules/steam/lib/steam_client.js:189:24) at Connection.emit (events.js:189:13) at TCP._handle.close (net.js:600:12) TypeError: Cannot read property 'send' of undefined at SteamClient._send (/var/server/node_modules/steam/lib/steam_client.js:117:20) at SteamClient.send (/var/server/node_modules/steam/lib/steam_client.js:126:8) at SteamUser.requestWebAPIAuthenticateUserNonce (/var/server/node_modules/steam/lib/handlers/user/index.js:37:16) at SteamWebLogOn.<anonymous> (/var/server/node_modules/steam-weblogon/index.js:34:23) at ClientRequest.<anonymous> (/var/server/node_modules/steam-web-api/index.js:34:9) at Object.onceWrapper (events.js:277:13) at ClientRequest.emit (events.js:189:13) at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21) at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17) at TLSSocket.socketOnData (_http_client.js:442:20) at TLSSocket.emit (events.js:189:13) at addChunk (_stream_readable.js:284:12) at readableAddChunk (_stream_readable.js:265:11) at TLSSocket.Readable.push (_stream_readable.js:220:10) at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17) And more errors. I want the best code the this bot without disconnects and with auto session cookies set after expires. Thanks. BOT CODE var bots = { steam: { botname: config.bot_steam.botname, username: config.bot_steam.username, password: config.bot_steam.password, identitySecret: config.bot_steam.identitySecret, sharedSecret: config.bot_steam.sharedSecret } } var new_steam_bot = function() { var connected = false; var community = new SteamCommunity(); var client = new Steam.SteamClient(); var user = new Steam.SteamUser(client); var friends = new Steam.SteamFriends(client); var webLogon = new SteamWebLogon(client, user); var manager = new TradeOfferManager({ steam: client, community: community, domain: 'localhost', language: 'en', cancelTime: 150000 }); client.connect(); return { connected, community, client, user, friends, webLogon, manager, } } var Steam = require('steam'); var TradeOfferManager = require('steam-tradeoffer-manager'); var SteamTotp = require('steam-totp'); var SteamWebLogon = require('steam-weblogon'); var SteamCommunity = require('steamcommunity'); var q = require('q'); var protos = require('./protos'); var steam_bots = new_steam_bot(); steam_bots.client.on('connected', function() { logger.warn('[BOT] Client Connected'); steam_bots.user.logOn({ account_name: bots.steam.username, password: bots.steam.password, two_factor_code: SteamTotp.generateAuthCode(bots.steam.sharedSecret) }); }); steam_bots.client.on('logOnResponse', function(response) { if(response.eresult !== Steam.EResult.OK) { logger.warn('[BOT] Client Login Failed'); steam_bots.client.connect(); return; } logger.warn('[BOT] Client Login Success'); setWebLogOn(); }); steam_bots.client.on('loggedOff', function(eresult, msg) { logger.warn('[BOT] Client Logout. Message: ' + msg); steam_bots.client.connect(); }); steam_bots.client.on('error', function(err) { logger.warn('[BOT] Client Error. Error: ' + err.message); logger.error(err); writeError(err); if(err.message == 'Disconnected') { logger.error('[BOT] Client Disconnected. Reconnecting!'); steam_bots.client.connect(); } }); steam_bots.community.on('confKeyNeeded', function(deepDataAndEvents, updateFunc) { logger.warn('[BOT] Need Conf Key'); updateFunc(null, time, SteamTotp.getConfirmationKey(bots.steam.identitySecret, time(), deepDataAndEvents)); }); steam_bots.community.on('sessionExpired', function(err) { logger.warn('[BOT] Session expired, logging in...'); bots.steam.connected = false; steam_bots.community.stopConfirmationChecker(); setWebLogOn(); }); steam_bots.user.on('updateMachineAuth', function( sentry, callback ) { callback({ sha_file: getSHA1(sentry.bytes) }); }); function getSHA1(bytes) { var shasum = crypto.createHash('sha1'); shasum.end(bytes); return shasum.read(); } function setWebLogOn(){ try{ steam_bots.webLogon.webLogOn(function(sessionID, cookies) { logger.warn('[BOT] Session cookies set'); steam_bots.manager.setCookies(cookies, function(err) { if (err) { logger.error(err); writeError(err); process.exit(1); } }); steam_bots.community.setCookies(cookies); steam_bots.community.startConfirmationChecker(5000, bots.steam.identitySecret); setTimeout(function(){ steam_bots.connected = true; loadOffersSent(); loadPricesAll(); }, 1000); }); } catch(err){ logger.warn('[BOT] Error Web Log On. Error: ' + err.message); logger.error(err); if(client.loggedOn){ user.requestWebAPIAuthenticateUserNonce(function(result){ logger.error('Error: Request Web API Authenticate User Nonce. ' + result); }); } else { client.connect(); } } }
  2. Hi, I have a little question: Where can i get shared_secret? After the first run steam.login(), I got "steamguard". Which passed to the function generateAuthCode.What am I doing wrong? Thank you. var SteamCommunity = require('steamcommunity'); var steam = new SteamCommunity(); var logOnOptions = { accountName: 'user1', password: 'passsssssssword',// twoFactorCode: '72N37', twoFactorCode: SteamTotp.generateAuthCode('76561198035130610||snip') }; console.log(logOnOptions) //logs in via browser steam.login(logOnOptions, function(err, sessionID, cookies, steamguard) { console.log(steamguard) // '76561198035130610||snip' if (err) { console.log("There was an error logging in! Error details: " + err.message); process.exit(1); //terminates program } else { console.log("Successfully logged in as " + logOnOptions.accountName); } });
  3. const SteamUser = require('steam-user');const SteamTotp = require('steam-totp');const SteamCommunity = require('steamcommunity');const TradeOfferManager = require('steam-tradeoffer-manager'); const client = new SteamUser();const community = new SteamCommunity();const manager = new TradeOfferManager({ steam: client, community: community, language: 'en'}); const logInOptions = { accountName: "........", password: "...........", twoFactorCode: SteamTotp.generateAuthCode("............")}; client.logOn(logInOptions); client.on('loggedOn', () => { console.log('logged on');client.setPersona(SteamUser.EPersonaState.Online, "bot1");client.gamesPlayed(570);});client.on('webSession', (sid, cookies) => {console.log(cookies); manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, "............"); mytrade();}); manager.on('newOffer', offer => { console.log('offer detected'); if (offer.partner.getSteamID64() === '.............') { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(status); } }) } else { console.log('unknown sender'); offer.decline(err => { if (err) { console.log(err); } else { console.log('trade from stranger declined'); } }); }}); function mytrade() {manager.getOfferToken((err, token) => {if (err) {console.log("gsfgfasy", err)}else {var partner="id........"const offer = manager.createOffer('id.....',token);manager.getUserInventoryContents(partner,570, 2, true, (err, myInv) => {if (err) {console.log(err);} else {console.log("myenv",myInv[0]);// myInv.forEach(function(item) {offer.addTheirItem(myInv[0]);offer.setMessage('You received a floral shirt!');offer.send((err, status) => {if (err) {console.log(err);} else {console.log('trade sent');console.log(status);}}) // })}}) }})}
  4. Hello this is my code client.logOn({ accountName: config.username, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.sharedSecret) }); and im %100 sure that my sharetSecret is right. I can login using this piece of code in my windows computer but in my ubuntu vds i cant login i checkt the time offsets they are diffrent from each other. 1 week ago i would login in my vds but now i cant. Any ideas ?
  5. I need like a help section on node-steam-tradeoffer-manager,steam-community, steam-totp, and steam-user on where the commands are. Like where should I know where are the command help page. I seem to can't find one in general. I'll really appreciate if someone shows me a link on where it is. Thank you
  6. Hi, When I quickly do login/relogin whenever I reload my node app, it sometimes asks for the steam guard code despite having steam totp (both secrets) supplied. Emphasis on sometimes. Why would that be? Thanks.
  7. So, sorry for my noobness, how do you generate shared secret to use with 2FA (steam-totp)?
×
×
  • Create New...