Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var acc_nick = 'xkrudix';
- var acc_json, acc_secret, acc_nick, acc_pass, acc_webapikey, acc_identity, acc_id, acc_deviceid;
- var globalSessionID;
- var globalCookiesID;
- var bot_id = 12;
- var admin = '76561198111457154';
- var mysqlInfo;
- var client;
- var itemscopy;
- var proceeded;
- var bot_connection;
- var steamcommunityMobileConfirmations;
- var sha_sentry;
- var setup;
- var setup = false;
- var locked=false;
- var detected=false;
- var detected2=false;
- var timeleft = 120;
- var actual_game=0;
- var send_win = false;
- var diff = 0;
- var recheck = true;
- var block = false;
- var offertes = new Array();
- var chlast = new Date();
- var sprawdz_wysylanie = false;
- var fs = require('fs');
- var Steam = require('steam');
- var SteamTradeOffers = require('steam-tradeoffers');
- var getSteamAPIKey = require('steam-web-api-key');
- var SteamUser = require('steam-user');
- var SteamTotp = require('steam-totp');
- var SteamConfirm = require('steamcommunity-mobile-confirmations');
- var request = require('request');
- var mysql = require('mysql');
- var steamuserinfo = require('steam-userinfo');
- var steam = new SteamUser();
- var offers = new SteamTradeOffers();
- if (require('fs').existsSync('./accounts/' + acc_nick + '.json')) {
- var acc = require('fs').readFileSync('./accounts/' + acc_nick + '.json', 'utf8');
- acc_json = JSON.parse(acc);
- acc_secret = acc_json.shared_secret;
- acc_pass = acc_json.pass;
- acc_webapikey = acc_json.webapikey;
- acc_identity = acc_json.identity_secret;
- acc_id = acc_json.id;
- acc_deviceid = acc_json.device_id;
- } else {
- console.log('The user does not exist in the directory accounts!');
- exit();
- }
- var details = {
- "accountName" : acc_nick,
- "password" : acc_pass,
- "twoFactorCode" : SteamTotp.generateAuthCode(acc_secret)
- };
- steamuserinfo.setup(acc_webapikey);
- console.log('Welcome' + acc_nick + '!');
- sha_sentry = require('fs').readFileSync('sentry_' + acc_nick + '.hash');
- steam.setSentry(sha_sentry);
- steam.logOn(details);
- steam.on('loggedOn', function(details) {
- console.log("Logged ON!");
- steam.setPersona(SteamUser.Steam.EPersonaState.LookingToTrade);
- steam.getSteamGuardDetails(function(enabled, enabledTime, machineTime, canTrade) {
- console.log(enabled);
- console.log(enabledTime);
- console.log(machineTime);
- console.log(canTrade);
- });
- });
- steam.on('webSession', function(sessionID, cookies){
- webLog(sessionID, cookies);
- });
- steam.on('sentry', function(data) {
- fs.writeFileSync('sentry_' + acc_nick + '.hash', data);
- });
- function handleConfirmation() {
- steamcommunityMobileConfirmations.FetchConfirmations((function (err, confirmations) {
- if (err) {
- console.log('#1' + err);
- console.log('WebSerwis on! (#3)');
- steam.webLogOn(function(sessionID, newCookie) {
- console.log('WebSerwis on! (#1)');
- webLog(sessionID,newCookie);
- });
- return;
- }
- if (!confirmations.length) {
- return;
- }
- console.log('FetchConfirmations received ' + confirmations.length + ' confirmations');
- steamcommunityMobileConfirmations.AcceptConfirmation(confirmations[0], (function (err, result) {
- if (err) {
- console.log(err);
- return;
- }
- console.log('AcceptConfirmation result: ' + result);
- }).bind(this));
- }).bind(this));
- }
- function webLog(sessionID, cookies) {
- globalCookiesID = cookies;
- globalSessionID = sessionID;
- var options = { sessionID: sessionID, webCookie: cookies };
- options.APIKey = acc_webapikey;
- offers.setup(options, function (err) {
- if (err) {
- console.log('WEB 504 LOGIN');
- webLog(sessionID, cookies);
- }
- console.log('WebSerwis on!');
- //steam.gamesPlayed([730]);
- steamcommunityMobileConfirmations = new SteamConfirm({
- steamid: acc_id,
- identity_secret: acc_identity,
- device_id: acc_deviceid,
- webCookie: globalCookiesID
- });
- if(!setup) {
- handleConfirmation();
- setInterval(handleConfirmation, 5000);
- setup = true;
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement