Jump to content
McKay Development

Search the Community

Showing results for tags 'question'.

  • 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. client.on('appOwnershipCached', function() { const appIDs = client.getOwnedApps(); const appDetails = client.getProductInfo(appIDs, () => { fs.writeFileSync('./logs/info.json', JSON.stringify(appDetails, null, 4)); }); }); This is my code I was trying to get the product info of all the app I have but I got this error Logged into Steam! /mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:134 packages = packages.map(function(pkg) { ^ TypeError: packages.map is not a function at SteamUser.getProductInfo (/mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:134:22) at SteamUser.<anonymous> (/mnt/e/Projects/web/steam-bot/bot.js:51:29) at emitNone (events.js:106:13) at SteamUser.emit (events.js:208:7) at /mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:481:9 at /mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:295:5 at Object.cb (/mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/messages.js:174:4) at CMClient._netMsgReceived (/mnt/e/Projects/web/steam-bot/node_modules/steam-client/lib/cm_client.js:321:26) at CMClient.handlers.(anonymous function) (/mnt/e/Projects/web/steam-bot/node_modules/steam-client/lib/cm_client.js:603:8) at CMClient._netMsgReceived (/mnt/e/Projects/web/steam-bot/node_modules/steam-client/lib/cm_client.js:305:24) Can anyone Plese help?
  2. Hello, I used some open source bots, and configured it as I like it. Currently I want to add !buygems [n] option. I looked at many discussions, mostly on this site. My problem is I filter the gems, and type theirGems.amount = n * CONFIG.BUYINGGEMS(never mind what I put here). I tried to console.log theirGems and theirGems.amount and it says the same number as it should be n * CONFING.BUYINGGEMS but in the trade offer it adds whole sack of gems. https://pastebin.com/p70bwckf http://prntscr.com/kod0gg
  3. Hello, i'm newbie in creating bots and i don't know how to make trade sending system properly(It doesn't add items). I provide code below: var incomeMessage = message; var splittedMsg = incomeMessage.split(" "); if(splittedMsg[0] == "!buy") { splittedMsg = incomeMessage.slice(5); client.chatMessage(steamID, "Sellin' item named " + splittedMsg); manager.getUserInventoryContents(steamID, 440, 2, true, (err, inv) => { if (err) { throw err; } else { const offer = manager.createOffer(steamID); let item = inv.filter(item => item.market_name == splittedMsg); let itemsToTrade = item[0]; offer.addMyItem(itemsToTrade); offer.setMessage('You recieved a Refined Metal!'); offer.send((err, status) => { if (err) { console.log(err); } else { console.log('trade sent'); console.log(status); } }); } }); } I send message to bot like !buy Refined Metal and it has to put 1 Refined Metal to trade and then send it to me. But i has error 26. I know it means that i don't have such items in my inventory. So can you help me with that?
  4. TypeError: Cannot read property 'getSteamID64' of undefined at SteamCommunity.getUserInventory (/root/bot/node_modules/steamcommunity/components/users.js:287:39) at TradeOfferManager.loadUserInventory (/root/bot/node_modules/steam-tradeoffer-manager/lib/index.js:331:18) at Object.GetInventory (/root/bot/Code/BotsManager.js:143:17) at Server.<anonymous> (/root/bot/Code/RemoteAccess.js:48:11) at next (/root/bot/node_modules/restify/lib/server.js:1125:29) at f (/root/bot/node_modules/once/once.js:36:25) at Server.<anonymous> (/root/bot/node_modules/express-ipfilter/lib/ipfilter.js:205:14) at next (/root/bot/node_modules/restify/lib/server.js:1125:29) at f (/root/bot/node_modules/once/once.js:36:25) at Server.parseBody (/root/bot/node_modules/restify/lib/plugins/bodyParser.js:152:17) Please help. What could be causing these errors?
  5. Can you give an example , how to use proxy. And what type need to use socks5 or http/https?
  6. 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!
  7. So after wrapping my mind around a problem I've had for a lot of time, I've come to ask here to maybe get some clearance. I am currently working on a bot that requires me calling methods outside of steam, and it initially seemed to be working. However, after some time, it has started to quite randomly return error 2 (GenericFailure), and sometimes it does not. The only thing I can think off was Steam logging the account out and requiring a relogin (it buys from steam store, which I know to sometimes require a relogin). However, making the account relogin did not seem to solve the problem, and I still occasionally get GenericFailure returned. So my question is: What can be this error be caused by? I have found that the wrong request method might be causing it, but I do have the correct method, so that will not be the case. What else? I know this might be a gray area, but if anyone has any idea, that would be great. Although this question is very general, I will supply the code which it fails on in case that could give you a clue about what is wrong: request.post("https://store.steampowered.com/checkout/inittransaction/", { form: { gidShoppingCart: shoppingCart, gidReplayOfTransID: -1, PaymentMethod: "steamaccount", abortPendingTransactions: 0, bHasCardInfo: 0, CardNumber: "", CardExpirationYear: "", CardExpirationMonth: "", FirstName: "", LastName: "", Address: "", AddressTwo: "", Country: "", City: "", State: "", PostalCode: "", Phone: "", ShippingFirstName: "", ShippingLastName: "", ShippingAddress: "", ShippingAddressTwo: "", ShippingCountry: "", ShippingCity: "", ShippingState: "", ShippingPostalCode: "", ShippingPhone: "", bIsGift: 1, GifteeAccountID: accountid, GifteeEmail: "", GifteeName: "Client", GiftMessage: files.getConfig().message, Sentiment: "Best%20Wishes", Signature: files.getConfig().signee, ScheduledSendOnDate: 0, BankAccount: "", BankCode: "", BankIBAN: "", BankBIC: "", TPBankID: "", bSaveBillingAddress: 0, gidPaymentID: "", bUseRemainingSteamAccount: 1, bPreAuthOnly: 0, sessionid: bots[bot].sessionid, snr: snr }, json: true } The body which is returned looks like so: { success: 2, purchaseresultdetail: 0, paymentmethod: 0, palpaltoken: null, transid: null }
  8. I would like to know where is the variable to determine these normal 7 day tradeholds in csgo.
  9. Hello guys, I want to create steam market bot and now I have a problem with selling items function. community.httpRequestPost('https://steamcommunity.com/market/sellitem/',options, (err, response, json) => { if(err) { console.log(err.toString()); return; } console.log(json); }, "steamcommunity"); This is how i run it. var options = { url: 'https://steamcommunity.com/market/sellitem/', headers: { 'Origin': 'https://steamcommunity.com', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Referer': 'https://steamcommunity.com/my/inventory/', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'ru,en-US;q=0.8,en;q=0.6,en-AU;q=0.4' }, form: { sessionid: community.getSessionID(), appid: 218620, contextid: 2, assetid: 1893071216426009763, amount: 1, price: 2000, } }; And the options (Payday2 crate). The error I get: {"success":false,"message":"There was a problem listing your item. Refresh the page and try again."} I can not understand where the problem is, wanna know your opinion about it. Thank you, Anton
  10. For example, I'm trying something to do when someone does the "!members" command that shows how many members I have in my group Code: client.on("friendMessage", function(steamID, message) {if (message == "!membros"){client.chatMessage(steamID, "O nosso grupo tem neste momento:"); steamgroup.getstats("Chead-CSGO-Community", function(err, totalmembers){ })}}); Is it right? is that when I give the command "!members" only the message appears and not the members
  11. community.postUserComment(steam, ':metallove: sɪɢɴᴇᴅ ʙʏ ʀᴇᴅᴅʏ sɪɢɴᴇᴅ ʙʏ ʀᴇᴅᴅʏ , ғᴜɴᴅᴀᴅᴏʀ ᴅᴀ ᴄᴏᴍᴜɴɪᴅᴀᴅᴇ ᴄʜᴇᴀᴅᴄᴏᴍᴍᴜɴɪᴛʏ :metallove:') ^ ReferenceError: community is not defined at SteamUser.<anonymous> (/root/bot/bot.js:275:9) at SteamUser.emit (events.js:187:15) at SteamUser._emitIdEvent (/root/bot/node_modules/steam-user/components/utility.js:29:12) at SteamUser._handlers.(anonymous function) (/root/bot/node_modules/steam-user/components/chat.js:281:9) at SteamUser._handleMessage (/root/bot/node_modules/steam-user/components/messages.js:249:30) at CMClient.emit (events.js:182:13) at CMClient._netMsgReceived (/root/bot/node_modules/steam-client/lib/cm_client.js:323:8) 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 TCPConnection.emit (events.js:182:13) config bot: client.on("friendMessage", function(steam, message) { if (message == "!assinar") { client.chatMessage(steam, "O Teu perfil agora está assinado por mim. Aproveita") community.postUserComment(steam, ':metallove: sɪɢɴᴇᴅ ʙʏ ʀᴇᴅᴅʏ , ғᴜɴᴅᴀᴅᴏʀ ᴅᴀ ᴄᴏᴍᴜɴɪᴅᴀᴅᴇ ᴄʜᴇᴀᴅᴄᴏᴍᴍᴜɴɪᴛʏ :metallove:')}})
  12. 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.
  13. 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!
  14. 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?
  15. does not connect the bot to the servers ScreenShot: https://ibb.co/nwbF1y how to fix where to get a new IP-server?
  16. Hello I can't find, is possible to buy game as gift for friend?
  17. Hello, Can I return how many hours I played in CS:GO? I want to know how many hours I have in game via script.
  18. 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>)}}
  19. I just wanted to ask if there is any way to buy a game with my steam wallet money?
  20. 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.
  21. 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.
  22. 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();
  23. 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?
×
×
  • Create New...