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. How can i loop the sender message, so that i can wait for the response of the option to be selected which was printed by the for loop Kindly View the Attached Images for an clear example: Image of the example client.on("friendMessage", (SENDER, MSG) => { ... ... else{ var countList = 1; for(var i = 0; i < listOfProducts.length; ++i){ if(listOfProducts[i].is_free_license == false){ client.chatMessage(SENDER, countList +". "+listOfProducts[i].option_text) ountList++; } else{ client.chatMessage(SENDER, result[0].name + ", Unfortunately you can not buy this game as a gift.") } } console.log(countList); client.on("friendMessage", (SENDER, MSG) => { countList = countList - 1; if (MSG === 1) { client.chatMessage(" has been added to the Cart.") } }); } ... ... }); Kindly drop your suggestions... and thank you for your precious time.
  2. Hi, im new to this and i don't know how to check if the key is valid or invalid.. This is the code client.on("friendMessage", function (steamID, message) { if (steamID == AdminID && message.indexOf('!key') == 0) { var GetKey = message.replace('!key ', ''); client.redeemKey(GetKey); client.chatMessage(steamID, "Key activated: " + GetKey); } }); Thanks
  3. So I'm using getUserInventoryContents for someone who uses my bot to check his inventory and see if I have items that my bot accepts. https://pastebin.com/sXYvkTMD All works out but it does not give all the items results than it should. For example, I have 6 SF arcanas but it only tells me 4. Also what may be the reason why I get "TypeError: Cannot read property 'EPersonaState' of undefined" in my linux and in my windows it works perfectly fine.
  4. Hello, I just started building my steam level up bot and couldn't code it when someone adding him to tell 'Hello, "Persona Name" Thank you for adding me'. this is the code i put it from another question but its sending 'Hello, [steamID] Thank you for adding me'. client.getPersonas([steamID], function(personas) { var persona = personas[steamID.getSteamID64()]; var name = persona ? persona.player_name : ("[" + steamID.getSteamID64() + "]"); }); client.chatMessage(steamID, 'Hi ' + name + ' Thank you for adding me!'); } });
  5. So just trying to figure out if I'm dumb or if something is up. I'm updating my bot manager and since update doesn't use steam-client anymore I can't use .bind() which was working. See my attached image. Basically client is still returning my own localhost IP. Not the proxy one I'm setting.
  6. How do you get rich presence data? Through Steam Web Api? Im using GetPlayerSummaries but this endpoint didnt return rich presence data
  7. Guest

    Get chat history

    Hi, how can i get full chat history like in as steam chat ? When I using client.getChatHistory() I getting less messages than in steam chat in web browser, and after several times using this method - history would clear. Can you add the method like in steam web chat for getting full history ? through websocket method or smth
  8. I wrote an application that idles all of my games to x amount of minutes. My problem is that after logging in and passing some appIds to gamesPlayed, I am being prompted to enter my Steam Guard code after a while. I have had it run fine for over 30 minutes sometimes before being asked, but it's usually within 5-10 minutes. I'm listening to both sessionExpired and error, but it doesn't seem to be either of them. The goal is to log on just once and have it idle games until the application is closed. I call webLogOn every 15 minutes, but that doesn't seem to be the problem, as I'm usually prompted before that. I've also tried assigning the loginKey to my log in options after first logging in, which supposedly omits the need for a guard code, but that doesn't work either. Why is this happening? Any help would be greatly appreciated. Code: global._mckay_statistics_opt_out = true; const SteamClient = require('steam-user'); const SteamCommunity = require('steamcommunity'); const community = new SteamCommunity(); const client = new SteamClient(); let apiKey = (''); const minutesToIdle = 180; let gamesToIdle = []; let gamesTimePlayed = []; let appNames; let steamID; const logInOptions = { accountName: '', password: '', logonID: Date.now(), rememberPassword: true }; // Initialize (function () { console.log('Loading game names...') community.request('some api', (error, response, data) => { if (!error && response.statusCode == 200) { appNames = JSON.parse(data).data; client.logOn(logInOptions); } else { console.log('Failed to get game names, listing AppIDs instead.') setTimeout(function() { client.logOn(logInOptions); }, 4000); } }) })() client.on("webSession", (sessionID, cookies) => { console.clear(); console.log("Got web session"); community.setCookies(cookies); getGamesInfo(); }); // Get owned games and time information. function getGamesInfo () { gamesToIdle.length = 0; gamesTimePlayed.length = 0; console.log('\x1b[36m%s\x1b[0m', 'Idle all Steam games'); community.request('https://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=' + apiKey + '&steamid=' + steamID, (error, response, data) => { if (!error && response.statusCode == 200) { const gamesData = JSON.parse(data); const gamesTotal = gamesData.response.game_count; console.log('\x1b[32m%s\x1b[0m', '\nAmount of games: ' + gamesTotal); // Check playtime for past 2 weeks and forever. for (var i = 0; i < gamesTotal; i++) { if (gamesData.response.games[i].playtime_forever < minutesToIdle) { if (gamesData.response.games[i].playtime_2weeks == null || gamesData.response.games[i].playtime_2weeks < minutesToIdle) { gamesToIdle.push(gamesData.response.games[i].appid); gamesTimePlayed.push(getMostTime(gamesData.response.games[i].playtime_forever, gamesData.response.games[i].playtime_2weeks)); } } } if (gamesToIdle.length > 1 ) { console.log('\x1b[32m%s\x1b[0m', 'Games left to idle: ' + gamesToIdle.length); assignAppNames(); } else { console.log('Done idling.') } } else { console.log('Error loading games, retrying in 1 minute...'); setTimeout(function() { client.webLogOn(); }, 600000); } }) } // Returns most time played between last 2 weeks and forever. function getMostTime (a, { if (a > { return a; } else { return b; } } // Assigns app names to display, or appIDs if none found. function assignAppNames () { let gameNames = []; for (var i = 0; i < 29 && i < gamesToIdle.length; i++) { if (appNames != null && appNames.hasOwnProperty(gamesToIdle[i])) { gameNames.push(appNames[gamesToIdle[i]]); } else { gameNames.push(gamesToIdle[i]); } } idleGames(gameNames); } // Idle the games. function idleGames (gameNames) { let idleNow = []; for (var i = 0; i < 29 && idleNow.length < gamesToIdle.length; i++) { idleNow.push(gamesToIdle[i]); } client.gamesPlayed(idleNow); console.log('\x1b[32m%s\x1b[0m', 'Now idling: ' + idleNow.length + '\n') gameNames.forEach(function(element) { console.log(element + '\x1b[33m%s\x1b[0m', ' [' + (gamesTimePlayed[gameNames.indexOf(element)] / 60).toFixed(2) + ']'); }) console.log('\n' + 'Last update: ' + '\x1b[33m%s\x1b[0m', getDateTime()); setTimeout(function() { client.webLogOn(); }, 900000); } community.on("sessionExpired", error => { console.log("Steam web session expired: " + error.message); if (client.steamID) { client.webLogOn(); } else { client.logInOptions.logonID = Date.now(); client.logOn(logInOptions); } }); client.on("error", error => { console.log("An error has occurred: " + error.message); } ); client.on('loggedOn', (details) => { console.log('Logged on Steam.'); client.setPersona(SteamClient.EPersonaState.Invisible); steamID = details.client_supplied_steamid; }); function getDateTime() { var date = new Date(); var hour = date.getHours(); hour = (hour < 10 ? "0" : "") + hour; var min = date.getMinutes(); min = (min < 10 ? "0" : "") + min; var sec = date.getSeconds(); sec = (sec < 10 ? "0" : "") + sec; var year = date.getFullYear(); var month = date.getMonth() + 1; month = (month < 10 ? "0" : "") + month; var day = date.getDate(); day = (day < 10 ? "0" : "") + day; return hour + ":" + min + ":" + sec; }
  9. Hi. I'm migrating from v3 to v4, and trying to redeem Steam key. I added err argument as described in release notes, and now have the following code: client.redeemKey(key, (err, detail, packages) => { if (err) { console.log('Can not redeem: ' + SteamUser.EPurchaseResultDetail[detail]); return; } console.log('Redeemed!'); }); If key can not be redeemed, in v3 I get detailed reason, for example DoesNotOwnRequiredApp. But in v4 detail argument seems to be undefined. How can I access this info now, after migration to v4? Thanks
  10. Hi, Currently I'm using v3 version: const Steam = require('steam-client'); const SteamUser = require('steam-user'); const SteamCommunity = require('steamcommunity'); const TradeOfferManager = require('steam-tradeoffer-manager'); let client = new Steam.CMClient(); client.setHttpProxy(proxyUrl); let user = new SteamUser(client, { debug: true, singleSentryfile: false, autoRelogin: true, dataDirectory: '/files/clients' }); let community = new SteamCommunity(); let manager = new TradeOfferManager({ steam: user, community: community }); And in v4 I should change to: const SteamUser = require('steam-user'); const SteamCommunity = require('steamcommunity'); const TradeOfferManager = require('steam-tradeoffer-manager'); let user = new SteamUser({ debug: true, singleSentryfile: false, autoRelogin: true, dataDirectory: '/files/clients' }); user.setHttpProxy(proxyUrl); let community = new SteamCommunity(); let manager = new TradeOfferManager({ steam: user, community: community }); Can you advice please? NOTE: so v4 node-user replaces steam-client?
  11. You know, I've been trying to find out whether or not this is allowed and every time I ask Valve they refuse to answer. They deliberately say they can not answer. There was someone who tried to explain how to use this script to change your name yellow, but I didn't quite understand really. I'm not a coder really and all I was looking for is a way to change my name yellow in a simple safe way. I don't even know what this tool of yours does or how to run it even. But I am hoping you might be able to shed some light on whether or not Steam till ban people for using it to make their names yellow/gold. If it is allowed, is there a simple thing I can just run once to set my state? I have no idea what this thing is or does. Just an average user looking to set their name to gold using the "PersonaStateFlags" #4.
  12. sorry to whine, but I am suffering from a memory leak issue with the version 4 branch. After disabling all my code, except for one account logging in, (and doing nothing) it still leaks. I left the one idle account running doing nothing and after about a day or so it exceeded the ~1.5 GB of heap the node process (by default) can use. I then downgraded to 3.9.2 and it's fine now. I restored all the code and all the accounts are running and its been 12 hours now and memory usage is proper and garbage collecting is happening. It kinda seems like garbage collecting wasnt happening with v4, but I'm not sure exactly, as I didn't play around much with --expose-gc, yet. I quick glance suggested I couldnt just hack around this with manual global.gc() calls, but that would have probably been fine with me. This happens on Linux and Windows, and im using node lts 10, linux from now on. What version does the the doctor use, btw? I wish could be of more help, I tried generating heapdumps, but It locked up my machine, and I cant seem to get 'node-memwatch' installed/compiled, which had some event I maybe later could listen to that detects leaks. All the accounts are 'assigned/joined/ to a steam group chat however, a idle ghost town chat with nobody chatting in there, so maybe its likething related to (other) group chat events. Ill try to test this out next with an account who is not joined to a group chat. thanks for looking.
  13. how exactly does one send chat messages to a broadcast? do they function like group chats?
  14. We can send a random number using /random client.chatMessage(SID, "/random 100"); But is there a way to find out the result?
  15. How do I get the names of all available games on steam displaying on the website? Here's my code. It just displays a blank page for like 5 seconds and displays an "Already logged on, cannot log on again" error. How do I properly display it? client.on("appOwnershipCached", () => { let gameArr = client.getOwnedApps(); client.getProductInfo( gameArr, [], (err, apps, packages, unknownApps, unknownPackages) => { for (var appid in apps) { res.send(apps[appid].appinfo.common.name); } } ); });
  16. So I planned to write a script for the bot to have a background check. Is there a way using steam-user to find out specific user game time? (say like TF2). If so, what is the method? Thanks
  17. Apps in getproductinfo is returning null but not when I try to access from package. Is something wrong? Is it because I download the dependencies using npm?
  18. So I planned to write a script for the bot to have a background check. const SteamUser = require('steam-user'); var client = new SteamUser(); var steamid = '76561198302774496'; client.getSteamLevels([steamid], function(results){ console.log(results); }) However, it didn't show the results to the console.
  19. I got a output from: client.getPublishedFileDetails(1607555098, (err, results) =>{ console.log(results);});So my Question is, can you like artworks with this module or do i have to write a request function?Thanks for your help
  20. v4 is now out! There are a lot of breaking changes in v4. See the release notes on GitHub for all of the changes. Major changes include: Support for new Steam chatPromise support for all methods that take callbacks (callbacks are still also supported)Removal of deprecated methodsAddition of err parameter to all callbacks that previously lacked itNode.js v8 or higher is now required
  21. Hello there. I was surfing internet about Steam cookies because I saw a video on YT, where they have shown how to use GIFS as an avatar. However, it looks like my luck wasn't good to get script/program working. I just need SteamLogin in order to get things work, but I didn't find it. Will SteamLoginSecure work the same as that cookie? (Sorry for such post because I'm one of those unintellectual people that ask for help.) I will leave a link down here v. (Video isn't mine.)
  22. Hello, I have tried multiple github release (from simple javascript to automate advanced json etc). Tested the newest node, npm, node steam and 0.6.8 steam. I can not login with my correct steam credentials on virtual server. I just wanted to idle some hours on 2 titles. Has something happened recently, do they block connections? I cannot pass thru sucessfuly with: steamClient.connect();steamClient.on('connected', function() { steamUser.logOn({ account_name: 'MY_STEAM_LOGIN', password: 'MY_PASSWORD' });}); No guard mails arrive neither... Can you help me please?
  23. Hello With new steam chat we get a trade notification chat message together with any incoming offer from a friend: https://i.imgur.com/PV4TgEu.jpg My problem is that when I'm using this code: //Chat Messages Check //This will fire when we receive a chat message from ANY friend client.on('friendMessage', function(steamID, message) { client.getPersonas([steamID], function (personas) { console.log('Friend message from ' + personas[steamID]["player_name"] + ': ' + message); }); }); Bot's notifications aren't cleared (there is one for every trade offer); so my question is, there's a way to keep that code and clear trade notifications altogether (maybe something which fires after a trade is received)? Thanks
  24. Hello. I want to ask about the new chat things like /spoiler /random /code etc.. or the old chat emotes How the bot can use them?
×
×
  • Create New...