Jump to content
McKay Development

katayyayuci

Member
  • Posts

    3
  • Joined

  • Last visited

Posts posted by katayyayuci

  1. Hi, I want to link a client to the other 5 .I want to tell a bot to login to the other 5 bot

     

    But i have a issue right here.I was execute other 5 bot's with chatmessage and they need a steamguard codes.How can i import steamguard codes from an txt,json or any text. These codes will be disposable guard codes.

     

    Here my old code (its should be still working)

     

    mainbot.js

    function splitString(steamID, message) 
    {
        var arrayOfStrings = steamID.split(message); // HERE IM SPLITTING CODE FROM MSG EXAMPLE: !login xxxxx
        return arrayOfStrings[1];
    }
    var yourString = message; // OR ANY OTHER
    var colon = " ";
    var guardcode = splitString(yourString, colon); // SPLIT COLON
    guardcode.toUpperCase();
    module.exports = 
    {
        acc1auth: guardcode
    }
    var acc1 = require('./acc1/bot.js')
    

    acc1/bot.js

    var logoncfg = {
    	accountName: config.username,
    	password: config.password,
    	twoFactorCode: SteamTotp.generateAuthCode(cfg.shearedSecret)
    }
    
    client.logOn(logoncfg);
    
    
    var mainaccimport= require('../mainbot.js');
    
    client.on('steamGuard', function(domain, callback,) {
    	if ( !cfg.sharedSecret ) {
    		var readlineSync = require('readline-sync');
    		var authCode = mainaccimport.acc1auth
    		callback(authCode);	
    	}
    	else {
    		var authCode = SteamTotp.generateAuthCode( cfg.sharedSecret );
    		console.log("[" + cfg.username + "] Generated Auth Code: " + authCode);
    		callback(authCode);	
    	}
    });
    
  2. Don't use steam, just use steam-user.

    actually im not good at the configure module constructors can any source help me about that ?

     

    EDIT : same problem here 

    var fs = require('fs');
    var Steam = require('steam');
    
    var steamClient = new Steam.SteamClient();
    var steamUser = new Steam.SteamUser(steamClient);
    var steamFriends = new Steam.SteamFriends(steamClient);
    
    steamClient.connect();
    steamClient.on('connected', function() {
      steamUser.logOn({
        account_name: 'acc',
        password: 'pass'
      });
    });
    steamFriends.on('message', function(source, message, type, chatter) {
      // respond to both chat room and private messages
      console.log('Received message: ' + message);
      if (message == 'ping') {
        steamFriends.sendMessage(source, 'pong', Steam.EChatEntryType.ChatMsg); // ChatMsg by default
      }
    });
    
    

    Error Log 

    events.js:183
          throw er; // Unhandled 'error' event
          ^
    
    Error: Disconnected
        at SteamClient._disconnected (D:\BOTLAR\keybot\node_modules\steam\lib\steam_client.js:186:24)
        at emitOne (events.js:116:13)
        at Connection.emit (events.js:211:7)
        at TCP._handle.close [as _onclose] (net.js:567:12)
    
  3. var Steam = require('steam');
    var SteamUser = require('steam-user');
    var TradeOfferManager = require('steam-tradeoffer-manager');
    var SteamTotp = require('steam-totp');
    var Steamcommunity = require('steamcommunity');
    var SteamWebLogOn = require('steam-weblogon');
    var fs = require('fs')
    
    var util = require('util');
    var UInt64 = require('cuint').UINT64;
    
    var client = new SteamUser();
    
    var steamClient = new Steam.SteamClient();
    var steamUser = new Steam.SteamUser(steamClient);
    var steamFriends = new Steam.SteamFriends(steamClient);
    var steamWebLogOn = new SteamWebLogOn(steamClient, steamUser);
    
    var community = new Steamcommunity();
    var manager = new TradeOfferManager({
    	"steam": client,
    	"domain": "steamcommunity/id/KatayDesign",
    	"language": "en"
    });
    
    var config = require('./config');
    
    var code = SteamTotp.generateAuthCode(config.bot.shared_secret);
    
    var logOnOptions = {
    	account_name: config.bot.username,
    	password: config.bot.password,
    	two_factor_code: code
    }
    
    function log(message) 
    {
    	console.log(new Date().toString() + ' - ' + message);
    }
    
    function steamIdObjectToSteamId64(steamIdObject) {
    	return new UInt64(steamIdObject.accountid, (steamIdObject.universe << 24) | (steamIdObject.type << 20) | (steamIdObject.instance)).toString();
    }
    
    function Login(logOnOptions) 
    {
    	steamClient.connect();
    
    	steamClient.on('connected', function() {
    		console.log('Connected...');
    		steamUser.logOn(logOnOptions);
    	});
    
    

    i got an error after ""  console.log('Connected...'); "" its working with shared_secret but giving error without shared_secret

×
×
  • Create New...