Search the Community
Showing results for tags 'node-steam-user'.
-
Is there any open source code for deleting the crates automatically?
-
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.
-
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?
-
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,
-
Hello, I was messing around with the UIMode status and saw that VR was missing, This file hasn't been touched since 1 Jun 2016 so I also assume you haven't revised it or looked into it at a later given time? I was wondering if you could revisit it and perhaps add it if possible? Thank you regardless, https://github.com/DoctorMcKay/node-steam-user#setuimodemode
-
is there a way to check if the password of the account is invalid ?
-
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>)}}
-
I just wanted to ask if there is any way to buy a game with my steam wallet money?
-
My code: client.on('disconnected', (eresult, msg) => { console.log(`Eresult: ${eresult}\nMsg: ${msg}`); setTimeout(() => client.logOn({ "accountName": client.username, "password": client.password }), 10e3); });
-
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.
-
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.
-
That's possible? Can i see group history with node-steam-user?
-
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();
-
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 } })
-
- node.js
- node-steam-user
-
(and 1 more)
Tagged with:
-
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.
-
when i use GamesPlayed for idling games, once it starts idling other code stops executing, i want to automatically call exit when reaches x time but i wasn't able to do that, i tried editing library but no luck
- 8 replies
-
- node.js
- node-steam-user
-
(and 1 more)
Tagged with:
-
How can i make my bot join a tf2 community server?
-
Is it possible to family share in this library?
-
Hi. How i can use +60 account in same script ? I want to farm with this accounts, but i need my own script
-
I've been trying to play a Steam game while farming trading cards. When I start a game the bot just says Logged in elsewhere. Is there any way to get around this?
-
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!
-
I'm idling hours since 2 years, never had any problem with old chat, but after 'new chat' update I getting error: 'Error: LogonSessionReplaced' when I open web chat, is there any way to avoid this problem? edit: this error shows in nodejs console (idler)
-
Hi, I'm trying to get a user's nickname. I know I'm supposed to use getUserDetails and then getPersonas, but what's the nickname property called?