katayyayuci Posted April 13, 2018 Report Posted April 13, 2018 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 Quote
Dr. McKay Posted April 14, 2018 Report Posted April 14, 2018 Don't use steam, just use steam-user. Quote
katayyayuci Posted April 14, 2018 Author Report Posted April 14, 2018 (edited) 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 April 14, 2018 by katayyayuci Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.