Jump to content
McKay Development

Snow

Member
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Snow

  1. I am still using express js and can get accounts array without a problem. What would you suggest instead of adding them to array ?
  2. I am using express.js and try to log all my bots in according to requests made from my python server. I can successfully make my bots logged into steam but can't get returned message (it just returns undefined) to send back to server. My code looks like this: const accounts = [] function addAccount(username, password, twoFactorCode){ const client = new SteamUser(); const community = new SteamCommunity(); const manager = new TradeOfferManager({ steam: client, community: community, language: 'en', cancelTime: 300000, pendingCancelTime: 30000 }); const logOnOptions = { accountName: username, password: password, twoFactorCode: SteamTotp.generateAuthCode(twoFactorCode), }; client.logOn(logOnOptions); client.on('loggedOn', ()=> { //console.log("success") }) client.on('webSession', (sessionid, cookies) => { console.log(sessionid, cookies); manager.setCookies(cookies, function(err){ if (err) { console.log(err); return err }else{ console.log("Got API key: " + manager.apiKey); return "success"; } }); community.setCookies(cookies); }); community.on('sessionExpired', () => { client.webLogOn(); }); accounts.push({"client":client, "community":community, "manager": manager}) } app.post('/log', (req, res) => { if (accounts.length === 0){ var json_data = req.body json_data.forEach(element => { var answer = addAccount(element["user_name"], element["password"], element["secret"]) }) }else{ } res.json({ "answer": answer }) })
×
×
  • Create New...