Example #1
0
function webLogin(callback) {
    logger.verbose("Connecting to Steam Web...");
    clearTimeout(getcounttimer);
    clearTimeout(heartbeattimer);
    client.webLogOn(function (data) {
        offers.setup({
            "sessionID": sessionID,
            "webCookie": data
        }, function() {
            offers.getAPIKey(function (err) {
                if (err && err.message === 'Access Denied: Family View Enabled') {
                    if(accountinfo.pin) {
                        offers.getFamilyCookie({"pin": accountinfo.pin}, callback);
                    } else {
                        getFamilyPIN(callback);
                    }
                } else {
                    if(accountinfo.pin) {
                        offers.getFamilyCookie({"pin": accountinfo.pin}, function() {
                            offerReady(callback);
                        });
                    } else {
                        offerReady(callback);
                    }
                }
            });
        });
    });
}
Example #2
0
 bot.on('webSessionID', function (sessionID) {
     log('Obtained community session ID: ' + sessionID);
     botTrade.sessionID = sessionID;
     bot.webLogOn(function (cookies) {
         log('Received a new cookie: ' + cookies);
         cookies[0].split(';').forEach(function (cookie) {
             botTrade.setCookie(cookie);
         });
     });
 });
Example #3
0
steam.on('webSessionID', function(sessionID) {
  debug('Got a new session ID: ' + sessionID);
  steamTrade.sessionID = sessionID;
  steam.webLogOn(function(cookies) {
    debug('Got a new cookie: ' + JSON.stringify(cookies));
    cookies.forEach(function(cookie) {
        steamTrade.setCookie(cookie);
    });
  });
});
Example #4
0
 onWebSessionID = function onWebSessionID(webSessionID) {
     util.log("Received web session id.");
     // steamTrade.sessionID = webSessionID;
     bot.webLogOn(function onWebLogonSetTradeCookies(cookies) {
         util.log("Received cookies.");
         for (var i = 0; i < cookies.length; i++) {
             // steamTrade.setCookie(cookies[i]);
         }
     });
 };
Example #5
0
client.on('webSessionID', function(sessionid) {
    trade.sessionID = sessionid; // Share the session between libraries
    client.webLogOn(function(cookie) {
        cookie.forEach(function(part) { // Share the cookie between libraries
            trade.setCookie(part.trim()); // Now we can trade!
        });
        logger.info('Logged into web');
        // No longer appear offline
        client.setPersonaState(steam.EPersonaState.LookingToTrade); 
    });
});
Example #6
0
bot.on('webSessionID', function(sessionID) {
  console.log('Réception d\'un nouvel session ID:', sessionID);
  steamTrade.sessionID = sessionID;
  bot.webLogOn(function(cookies) {
    console.log('Réception d\'un nouveau cookie:', cookies);
    cookies.split(';').forEach(function(cookie) {
        steamTrade.setCookie(cookie);
    });
	  bot.setPersonaState(Steam.EPersonaState.Online);
  console.log('Bot actuellement en ligne !');
  });
});
Example #7
0
bot.on('webSessionID', function (sessionID) {
    session = sessionID;
    bot.webLogOn(function (cookies) {
        offers.setup(sessionID, cookies);
        offers.loadMyInventory(440, 2, function (success, inv) {
            inventory = inv;
            console.log('Loaded inventory');
            bot.setPersonaState(Steam.EPersonaState.LookingToTrade);
            bot.setPersonaName(inventory.filter(function (item) { return item.app_data.def_index == 5021; }).length.toString() + " keys in stock");
        });
    });
    console.log('Bot: Logged into SteamCommunity');
});
steam.on('webSessionID', function(sessionID) {
  steam.webLogOn(function(newCookie){
    offers.setup({
      sessionID: sessionID,
      webCookie: newCookie
    }, function(err) {
      offers.getAPIKey(function(err) {
        if(err) {
          throw err;
        }
      });
    });
  });
});
steam.on('webSessionID', function(sessionID) {
  steam.webLogOn(function(newCookie){
    offers.setup({
      sessionID: sessionID,
      webCookie: newCookie
    }, function() {
      offers.getAPIKey(function(err) {
        if (err) {
          throw err;
        }
        offers.loadMyInventory({
          appId: 440,
          contextId: 2
        }, function(err, items) {
          var item;
          // picking first tradable item
          for (var i = 0; i < items.length; i++) {
            if (items[i].tradable) {
              item = items[i];
              break;
            }
          }
          // if there is such an item, making an offer with it
          if (item) {
            offers.makeOffer ({
              partnerSteamId: admin,
              itemsFromMe: [
                {
                  appid: 440,
                  contextid: 2,
                  amount: 1,
                  assetid: item.id
                }
              ],
              itemsFromThem: [],
              message: 'This is test'
            }, function(err, response){
              if (err) {
                throw err;
              }
              console.log(response);
            });
          }
        });
      });
    });
  });
});
Example #10
0
        var getCookie = function (callback) {
            bot.webLogOn(function (cookie) {
                util.log("Grabbing new cookie.");
                //util.log(cookie);

                var cookie_string_split = cookie.toString().split(',');

                cookie_string_split.every(function (value) {
                    //util.log(value);
                    j.setCookie(request.cookie(value), url);
                    return 1;
                });

                callback();
            });
        };
Example #11
0
    offers.makeOffer(source, 'Getting an error? Restart Steam.', botItemOffer, theirItemOffer, function (error, object) {
        if (error === null) {
            bot.sendMessage(source, "A trade offer (" + object.tradeofferid + ") has been sent containing the item(s): https://steamcommunity.com/my/tradeoffers");
            bot.sendMessage(source, "Type 'list' or 'ls' to see other trades.");
            bot.sendMessage(config.admin[0], object.tradeofferid + " Trade offer send to: " + bot.users[source].playerName);
        } else {
            console.log(error);
            bot.sendMessage(source, "Error creating trade offer. " + error);
            bot.sendMessage(config.admin[0], "Error in making trade offer: " + bot.users[source].playerName + error);

            //create new session
            bot.webLogOn(function (cookies) {
                offers.setup(session, cookies);
            });
        }
    }); //end trade offer
Example #12
0
bot.on('webSessionID', function(sessionId) {
	winston.info("Got webSessionID " + sessionId);
	webSessionId = sessionId;

	bot.webLogOn(function(newCookies) {
		winston.info("webLogOn returned " + newCookies);
		cookies = newCookies;

		if (!paused) {
			bot.setPersonaState(steam.EPersonaState.LookingToTrade);
		}

		canTrade = true;
		winston.info("cookies/session set up");
	});
});
Example #13
0
steam.on('webSessionID', function(sessionID) {
  steam.webLogOn(function(newCookie){
    offers.setup(sessionID, newCookie);
  });
});