Jump to content
McKay Development

Search the Community

Showing results for tags 'node-steam-user'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Announcements
    • Releases & Updates
  • Help & Support
    • General
    • Guides
    • node-steam-user
    • node-steamcommunity
    • node-steam-tradeoffer-manager
    • node-steam-session

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Location


Interests

  1. code: let client = new Steam.CMClient(); let user = new SteamUser(client); client.setHttpProxy("http://user:[email protected]:8000"); user.logOn({"accountName": username,"password": password, "authCode": code}); user.on('loggedOn', function(details) { console.log("Logged into Steam as " + user.steamID.getSteam3RenderedID()); console.log("change email to " + newEmail) user.changeEmail({ "password": password, "newEmail": newEmail }, function(err) { ... }); }); user.on('error', function(e) { res.end('error'); }); user.on('webSession', function(sessionID, cookies) { console.log("Got web session"); }); log: username: qusoraierylined password: -- guard: twoFactorCode code: WH2NF Logged into Steam as [U:1:319178106] change email to [email protected] Got web session { Error: RateLimitExceeded at Object.exports.eresultError (/root/bot/node_modules/steam-user/components/helpers.js:75:12) at /root/bot/node_modules/steam-user/components/account.js:129:21 at Object.cb (/root/bot/node_modules/steam-user/components/messages.js:174:4) at CMClient._netMsgReceived (/root/bot/node_modules/steam-client/lib/cm_client.js:321:26) at CMClient.handlers.(anonymous function) (/root/bot/node_modules/steam-client/lib/cm_client.js:603:8) at CMClient._netMsgReceived (/root/bot/node_modules/steam-client/lib/cm_client.js:305:24) at emitOne (events.js:116:13) at TCPConnection.emit (events.js:211:7) at TCPConnection._readPacket (/root/bot/node_modules/steam-client/lib/tcp_connection.js:183:7) at emitNone (events.js:106:13) eresult: 84 } user.publicIP returns my proxy's ip addres in loggedOn() event
  2. var SteamUser = require('steam-user'); var SteamTotp = require('steam-totp'); var botFactory = {}; botFactory.buildBot = function (config) { var bot = new SteamUser({ promptSteamGuardCode: false, dataDirectory: "./sentry", singleSentryfile: false }); bot.username = config.username; bot.password = config.password; bot.sharedSecret = config.sharedSecret; bot.games = config.games; bot.messageReceived = {}; bot.on('loggedOn', function(details) { console.log("[" + this.username + "] Logged into Steam as " + bot.steamID.getSteam3RenderedID()); bot.setPersona(SteamUser.EPersonaState.Away); bot.gamesPlayed(this.games); }); bot.on('error', function(e) { console.log("[" + this.username + "] " + e); setTimeout(function() {bot.doLogin();}, 5*60*1000); }); bot.doLogin = function () { this.logOn({ "accountName": this.username, "password": this.password }); } bot.on('steamGuard', function(domain, callback) { if ( !this.sharedSecret ) { var readlineSync = require('readline-sync'); var authCode = readlineSync.question("[" + this.username + "] " + 'Steam Guard' + (!domain ? ' App' : '') + ' Code: '); callback(authCode); } else { var authCode = SteamTotp.generateAuthCode( this.sharedSecret ); console.log("[" + this.username + "] Generated Auth Code: " + authCode); callback(authCode); } }); bot.on("friendMessage", function(steamID, message) { console.log("[" + this.username + "] Message from " + " (" + steamID + ")"+ ": " + message); if ( !this.messageReceived[steamID] ) { bot.chatMessage(steamID, "[Automated Message] I am currently idle."); bot.chatMessage(steamID, "[Mensagem Automática] Estou ausente no momento."); this.messageReceived[steamID] = true; } }); bot.on('vacBans', function(numBans, appids) { if(numBans > 0) { console.log( "[" + this.username + "] " + numBans + " VAC ban" + (numBans == 1 ? '' : 's') + "." + (appids.length == 0 ? '' : " In apps: " + appids.join(', ')) ); } }); bot.on('accountLimitations', function(limited, communityBanned, locked, canInviteFriends) { var limitations = []; if(limited) { limitations.push('LIMITED'); } if(communityBanned) { limitations.push('COMMUNITY BANNED'); } if(locked) { limitations.push('LOCKED'); } if(limitations.length !== 0) { console.log("[" + this.username + "] Limitations: " + limitations.join(', ') + "."); } }); return bot; } module.exports = botFactory; First of all, this is a "bot" to farm hours. I want help with this particular part of the code: bot.on("friendMessage", function(steamID, message) { console.log("[" + this.username + "] Message from " + " (" + steamID + ")"+ ": " + message); if ( !this.messageReceived[steamID] ) { bot.chatMessage(steamID, "[Automated Message] I am currently idle."); bot.chatMessage(steamID, "[Mensagem Automática] Estou ausente no momento."); this.messageReceived[steamID] = true; } });So what i want to do is show in console not only the steamID of the sender, but also its display name on Steam (if there's anyway to also show a nickname I set for the sender that would be nice). I did some research and could get it to work, but then it would break the part where it shows the name of the account that got the message, by doing: bot.on("friendMessage", function(steamID, message) { bot.getPersonas([steamID], function(personas) { var persona = personas[steamID.getSteamID64()]; var name = persona ? persona.player_name : ("[" + steamID.getSteamID64() + "]"); console.log("[" + this.username + "] Message from " + name + " (" + steamID + ")"+ ": " + message); }); if ( !this.messageReceived[steamID] ) { bot.chatMessage(steamID, "[Automated Message] I am currently idle."); bot.chatMessage(steamID, "[Mensagem Automática] Estou ausente no momento."); this.messageReceived[steamID] = true; } }); Any help is appreciated!
  3. code: user.changeEmail({ "password": password, "newEmail": newEmail }, function(err, needsSmsCode) { if(!err) { user.changeEmail({ "password": password, "newEmail": newEmail, "code": emailcode, "twoFactorCode": code }, function(err, needsSmsCode) { if(err) { console.log(err); } else { console.log('ok'); } }); } }); error: { Error: InvalidParam at Object.exports.eresultError (/root/bot/node_modules/steam-user/components/helpers.js:75:12) at /root/bot/node_modules/steam-user/components/account.js:129:21 at Object.cb (/root/bot/node_modules/steam-user/components/messages.js:174:4) at CMClient._netMsgReceived (/root/bot/node_modules/steam-client/lib/cm_client.js:321:26) at CMClient.handlers.(anonymous function) (/root/bot/node_modules/steam-client/lib/cm_client.js:603:8) at CMClient._netMsgReceived (/root/bot/node_modules/steam-client/lib/cm_client.js:305:24) at emitOne (events.js:116:13) at TCPConnection.emit (events.js:211:7) at TCPConnection._readPacket (/root/bot/node_modules/steam-client/lib/tcp_connection.js:183:7) at emitNone (events.js:106:13) eresult: 8 } with steamGuard is fine
  4. It just isn't being sent. I even get a SteamGuard e-mail correctly sent beforehand, so I know that's working. I've tried with multiple accounts. > Successfully logged in> Address: <e-mail>> Successfully sent e-mail I figured that e-mail info not being emitted yet could be the problem, but as you can see I tested that and it comes out fine. The docs say that if there's a mobile authenticator, the function will return true but not do anything. But none of the accounts have a mobile authenticator. I'm using 3.28.1, the latest version as of posting this. I'm convinced there's just a bug. Am I wrong? er
  5. "null" Docs say "Emitted on logon and when email info changes. The emailInfo property will be updated after this event is emitted." Isn't updating, though. Here's what `details` returns: "{ eresult: 1, out_of_game_heartbeat_seconds: 9, in_game_heartbeat_seconds: 9, public_ip: 387010462, rtime32_server_time: 1515897127, account_flags: 2101381, cell_id: 133, email_domain: null, steam2_ticket: null, eresult_extended: null, webapi_authenticate_user_nonce: 'VqFP8k12n6gM+8pbZf8', cell_id_ping_threshold: 11, use_pics: true, vanity_url: 'projectcrate8050', client_supplied_steamid: Long { low: 845356646, high: 17825793, unsigned: true }, ip_country_code: 'CA', parental_settings: null, parental_setting_signature: null, count_loginfailures_to_migrate: 0, count_disconnects_to_migrate: 0, ogs_data_report_time_window: null, client_instance_id: Long { low: -220505765, high: 776833051, unsigned: true }, force_client_update_check: null }"
  6. Is there any open source code for deleting the crates automatically?
  7. Hi, I searched on the forum, but i didn't find any problem or question like this. I want to run a function, when a friend start a specified appid. With other library (seishun's node-steam) I made like this: steamFriends.on('personaState', function(friendObj) { if (typeof(steamFriends.personaStates[friendObj.friendid]) != 'undefined') { // If player started CS:GO if (friendObj.gameid != steamFriends.personaStates[friendObj.friendid].gameid && friendObj.gameid == 730) { function(); } } }); But with node-steam-user lib I tried it with this: client.on('user', function(steamid, friendObj) But I didn't find the way, how I can run it only once, not every game update. Ex. join to lobby in cs:go.
  8. Hi Dr.Mackay, first of all thanks for your library and the hard work you've done . I've been thinking about making a project which would need to auto-download game from the user library, by this i mean, i could sign in through steam, and use your library to get all game info, would be possible to automate the process of downloading the game into imagine, a remote server without having to interact to a UI Steam client directly? Another think would be interesting is to interact with updates in games, by knowing what games require updates before an instance could be launched in the machine that previously has downloaded the game. All of this in case the first one is even possible, don't know if a future feature in your lib could fit or if i'm speaking about other completely thing, hope not . Sorry for my English, i'm not native and again thanks for your time!
  9. global._mckay_statistics_opt_out = true; // opting out any statistical collection program // modules being used const SteamUser = require("steam-user"); const path = require("path"); const fs = require("fs"); const config = require(path.join(__dirname, "config.js")); process.on('unhandledRejection', (reason, p) => { console.error(reason, 'Unhandled Rejection at Promise', p); }).on('uncaughtException', err => { console.error(err, 'Uncaught Exception thrown'); }); const appTokens = fs.existsSync(path.join(__dirname, "apptokens.json")) ? JSON.parse(fs.readFileSync(path.join(__dirname, "apptokens.json"), "utf8").toString() || "{}") : {}; const depotKeys = fs.existsSync(path.join(__dirname, "depotkeys.json")) ? JSON.parse(fs.readFileSync(path.join(__dirname, "depotkeys.json"), "utf8").toString() || "{}") : {}; const running = { apptokens: false, depotkeys: false, }; const user = new SteamUser({ enablePicsCache: true }); user.logOn(config.loginAnonymous ? undefined : require(path.join(__dirname, "login.js"))); // logging in using your username and password, more info about this function: https://github.com/DoctorMcKay/node-steam-user/blob/master/components/logon.js#L9 user.on("loggedOn", () => { console.log("Logged onto Steam as " + user.steamID.getSteamID64()); const chunksize = 10000; // seems best chunk size const idList = []; for (let i = chunksize; i < 1000000; i += chunksize) { const idSubList = []; for (let j = i - chunksize; j < i; j++) { idSubList.push(j); } idList.push(idSubList); } // doing this for all appids or packages just hangs forever running.apptokens = true; getTokens(); function getTokens() { const idSubList = idList.shift(); user.getProductAccessToken(idSubList.filter(id => !appTokens.hasOwnProperty(id)), [], (apps, packageTokens, appDeniedTokens) => { console.log("Tokens denied for " + appDeniedTokens.length + " apps of range " + idSubList[0] + "-" + idSubList[idSubList.length - 1]); for (let appid in apps) { if (apps.hasOwnProperty(appid)) { const token = apps[appid].toString(); appTokens[appid] = token; if (token !== "0") { // otherwise it'd be too spammy console.log("App " + appid + ": " + apps[appid].toString()); } } } if (idList.length > 0) { getTokens(); } else { fs.writeFileSync(path.join(__dirname, "apptokens.json"), JSON.stringify(appTokens, null, 4), "utf8"); console.log("Dumped product access tokens to apptokens.json!"); running.apptokens = false; if (!running.apptokens && !running.depotkeys) { console.log("Logging off of Steam"); user.logOff(); } } }); } }); user.on("appOwnershipCached", getDepotKeys); function getDepotKeys() { console.log("App ownership cached. Requesting appinfos..."); let logger = setInterval(console.log, 6000, "Still requesting appinfos..."); running.depotkeys = true; user.getProductInfo(user.getOwnedApps().map(appid => parseInt(appid, 10)), [], true, (apps, packages, unknownApps) => { clearInterval(logger); console.log("Got appinfos of " + Object.keys(apps).length + " apps"); if (unknownApps.length > 0) { console.log("Found " + unknownApps.length + " unknown apps"); } const depots = {}; for (let appid in apps) { if (!apps.hasOwnProperty(appid) || !apps[appid].hasOwnProperty(`appinfo`) || !apps[appid].appinfo.hasOwnProperty(`depots`)) { // skip if no depot info continue; } Object.keys(apps[appid].appinfo.depots).filter(id => !isNaN(id)).forEach(depotid => depots[depotid] = appid); } console.log("Requesting depot decryption keys of " + Object.keys(depots).length + " depots"); for (let depotid in depots) { if (depotKeys.hasOwnProperty(depotid)) { depots[depotid] = true; continue; } const appid = depots[depotid]; try { user.getDepotDecryptionKey(parseInt(appid, 10), parseInt(depotid, 10), (error, key) => { if (error) { console.log("Depot " + depotid + ": " + error.message); } else { depotKeys[depotid] = key.toString("base64"); console.log("Depot " + depotid + ": " + depotKeys[depotid]); } depots[depotid] = true; if (Object.keys(depots).length === Object.values(depots).filter(v => v === true).length) { fs.writeFileSync(path.join(__dirname, "depotkeys.json"), JSON.stringify(depotKeys, null, 4), "utf8"); console.log("Dumped depot keys to depotkeys.json!"); running.depotkeys = false; if (!running.apptokens && !running.depotkeys) { console.log("Logging off of Steam"); user.logOff(); } } }); } catch (error) { console.log(error); depots[depotid] = true; if (Object.keys(depots).length === Object.values(depots).filter(v => v === true).length) { fs.writeFileSync(path.join(__dirname, "depotkeys.json"), JSON.stringify(depotKeys, null, 4), "utf8"); console.log("Dumped depot keys to depotkeys.json!"); running.depotkeys = false; if (!running.apptokens && !running.depotkeys) { console.log("Logging off of Steam"); user.logOff(); } } } } }); } The app token dumping works just fine, but the depot key dumping thows RangeError's left and right: RangeError: Index out of range at checkOffset (buffer.js:851:11) at Buffer.readUInt32LE (buffer.js:913:5) at node_modules\steam-user\components\cdn.js:80:58 at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:439:3) At buffer.js:851. Any idea why? And how we can fix that?
  10. Hi there, Now that Steam has released steam chat like that of Discord, I want to create a bot to play music over voice chat. Does anyone have any idea how to do this? Thanks. Quang,
  11. is there a way to check if the password of the account is invalid ?
  12. I need add steam-api to my reacr prjct.First I'm running my project with npm start and then I launch steam-user with node steam-api.And when i import steam-user to my react prjct I receive this error https://imgur.com/4xqZZlb My files: Package.json: {"name": "steamx-app","author": "webif","description": "empty","main": "electron/main.js","version": "0.1.0","private": true,"homepage": "./","scripts": {"start": "nf start","steam-api": "node src/steam-api.js","react-start": "react-scripts start","electron-start": "node electron-wait-react","build": "react-scripts build","test": "react-scripts test --env=jsdom","eject": "react-scripts eject","electron": "electron .","ebuild": "yarn build && node_modules/.bin/build"},"build": {"productName": "steamX","appId": "com.steamx.app","extends": null,"electronVersion": "2.0.4","files": ["build/**/*","electron/*"]},"dependencies": {"electron-titlebar": "0.0.3","react": "^16.4.1","react-dom": "^16.4.1","react-router-dom": "^4.3.1","react-scripts": "1.1.4","readline": "^1.3.0","steam-user": "^3.27.1"},"devDependencies": {"electron": "^2.0.4","electron-builder": "^20.19.2","foreman": "^3.0.1"}}steam-api.js: const SteamUser = require('steam-user')var client = new SteamUser()reactjs file: import React, { Component } from 'react'import LoginForm from './LoginForm'import SteamGuardForm from './SteamGuardForm'import '../../steam-api.js' export default class Login extends Component {state = {accountName: "",password: "",steamGuardCode: ""} inputChangeHandler = (event) => {this.setState({[event.target.id]: event.target.value})} loginHandler = () => {// sessionStorage.setItem("promptSteamGuard", true)} render() {return(<div className="welcome-container"><LoginFormaccountName={this.state.accountName}password={this.state.password}inputChange={this.inputChangeHandler}tryLogin={this.loginHandler}/><SteamGuardFormsteamGuardCode={this.state.steamGuardCode}/></div>)}}
  13. I just wanted to ask if there is any way to buy a game with my steam wallet money?
  14. My code: client.on('disconnected', (eresult, msg) => { console.log(`Eresult: ${eresult}\nMsg: ${msg}`); setTimeout(() => client.logOn({ "accountName": client.username, "password": client.password }), 10e3); });
  15. Hi!When I try to use any steam-user methods I'm receiving this error https://imgur.com/4xqZZlb Code: function logout() { const remote = require('electron').remote; const SteamUser = require('steam-user'); const client = new SteamUser(); localStorage.setItem("userID", ""); client.logOff(); var window = remote.getCurrentWindow(); window.close(); } func set onclick event Methods are working but only from the second clickevent on first im getting that error.
  16. This is my first project so I hope this isn't something incredibly nooby. Not familiar with node or Javascript at all. When pulling a users Rich Presence information via: let sID = STEAMIDHERE let rPresence = sClient.users[sID].rich_presence Rich Presence seems to be an object of arrays? It is structured as follows: [ { key: 'status', value: 'Playing CS:GO' }, { key: 'version', value: '13638' }, { key: 'time', value: '18.234842' }, { key: 'steam_display', value: '#display_Menu' } ] I suppose my question is how I could parse this information into a single object so I could access information like: console.log(rPresence.status); 'Playing CS:GO' Thanks in advance! Sorry in advance if I this is very trivial.
  17. How im working now with node-steam-user and i would like to know how can i find out what user need to enter authCode or twoFactorCode when he is trying to log in with my app with logOn();
  18. That's possible? Can i see group history with node-steam-user?
  19. https://github.com/DoctorMcKay/node-steam-user#getownedapps First of all, it might be worth mentioning in the documentation that this is a synchronous function and doens't have a callback like most other functions have. Aside from that, it came to my attention that GetOwnedApps returned more apps than I own myself. Now, I have a suspicion that these extra unowned apps are in fact apps that are family shared to me. Is this true?
  20. Hello. I want to share my library for work with maFiles. https://github.com/Inomezi/node-maFile Now you can use maFiles , instead of shared_secret & identity_secret. Example use with node-steam-user const MaFile = new mafile('./maFiles') let G_maFiles // global variable for maFiles MaFile.readMafiles().then( maFiles => { G_maFiles = maFiles }) client = new SteamUser({ promptSteamGuardCode: false }) client.logOn({ accountName: 'login', password: 'password' }) client.on('steamGuard', (domain, callback, lastCodeWrong) => { const maFile = G_maFiles.find( maFile => account.login.toLowerCase() === maFile.account_name.toLowerCase() ) || '' if( maFile !== '' ) { callback(SteamTotp.getAuthCode(maFile.shared_secret)); } else { // do smth, no maFile for that account } })
  21. The first time you log in to your account for some reason turns on Steam-Guard. Why is this happening and can it be avoided ?I'd like to keep my account unprotected.
×
×
  • Create New...