Jump to content


Photo
Question

Where im doing wrong (weblogin steam-user)

node.js node-steam-user

  • Please log in to reply
2 replies to this topic

#1 katayyayuci

katayyayuci

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 13 April 2018 - 04:07 PM

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



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,686 posts

Posted 13 April 2018 - 07:59 PM

Don't use steam, just use steam-user.



#3 katayyayuci

katayyayuci

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 14 April 2018 - 08:37 AM

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)

Edited by katayyayuci, 14 April 2018 - 09:31 AM.






Also tagged with one or more of these keywords: Question, node.js, node-steam-user

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users