pipskas Posted December 24, 2016 Report Posted December 24, 2016 my bot can connect to server after connect bot say "Steam Guard App Code:" i put code but bot can accept confirmation.i buy new ip to my server and change it, but bot donest work(http://prnt.sc/dnkmj3code" var config = { //i delete } var fs = require('fs'); var auth = require('http-auth'), scribe = require('scribe-js')(), app = require('express')(); var console = process.console; var SteamUser = require('steam-user'); var TradeOfferManager = require('steam-tradeoffer-manager'); var SteamTradeOffers = require('steam-tradeoffers'); var SteamTotp = require('steam-totp'); var SteamcommunityMobileConfirmations = require('steamcommunity-mobile-confirmations'); var CMClient = require('steam-client').CMClient; var clientIP = new CMClient(); clientIP.bind('myips'); var offers = new SteamTradeOffers(); var client = new SteamUser(clientIP); var trades = new TradeOfferManager({ steam: client, domain: 'domain', language: "en", pollInterval: 1000 }); function steamBotLogger(log) { console.tag('SteamBot').log(log); } client.logOn({ accountName: config.username, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.secret) }); console.log('1'); client.on('loggedOn', function (details) { console.log('taders',details); steamBotLogger("Logged into Steam as " + client.steamID.getSteamID64() + " | NEW BOT "); //client.setPersona(SteamUser.Steam.EPersonaState.LookingToTrade, 'free'); BotSteamID = client.steamID.getSteamID64(); }); console.log('2'); client.on('disconnected', function () { botLogged = false; WebSession = false; steamBotLogger("Bot Disconnected !"); setTimeout(function () { client.logOn({ accountName: config.username, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.secret) }); }, 10000); }); client.on('webSession', function (sessionID, cookies) { steamBotLogger("Got web session"); trades.setCookies(cookies, function (err) { if (err) { steamBotLogger('Unable to set trade offer cookies: ' + err); process.exit(1); } steamBotLogger("Trade offer cookies set. Got API Key: " + trades.apiKey); offers.setup({ sessionID: sessionID, webCookie: cookies, APIKey: trades.apiKey }); WebCookies = cookies; WebSession = true; AcceptMobileOffer(); confirmTimer = setInterval(function(){AcceptMobileOffer();},5000); }); }); var hash = require('crypto').createHash('sha1'); hash.update(Math.random().toString()); hash = hash.digest('hex'); var device_id = 'android:' + hash; function AcceptMobileOffer() { console.log('dasdad'); var steamcommunityMobileConfirmations = new SteamcommunityMobileConfirmations( { steamid: BotSteamID, identity_secret: config.identity_secret, device_id: device_id, webCookie: WebCookies, }); steamcommunityMobileConfirmations.FetchConfirmations((function (err, confirmations) { // console.tag('SteamBot', 'MobileTrades').log('AcceptMobileOffer received ' + confirmations.length + ' confirmations'); if (err) { console.log(err); return; } if (!confirmations.length) { return; } confirmations.forEach(function(conf) { steamcommunityMobileConfirmations.AcceptConfirmation(conf, (function (err, result) { if (err) { console.log(err); return; } if (result) { console.tag('SteamBot', 'MobileTrades').log('Mobile offer Accepted !'); process.exit(); return; } }).bind(this)); }); }).bind(this)); }" 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.