Search the Community
Showing results for tags 'node-steam-user'.
-
Hey everyone, I'll first give you a background story so you get an idea of what I'm trying to do. I'm interested in adding 100 accounts in one steam group all done by a bot. I succesfully made myself a bot that creates a random generated username and password saved in a .txt file on my Desktop. What I want to do now is either make it so when I create a Steam Account it will automatically join the group OR I make a bot that scrapes all the username:password logins from that .txt file and logs in on them and joins my group. I think the first option is way easier, that's why I tried it; const SteamUser = require("steam-user"); const SteamCommunity = require("steamcommunity"); const client = new SteamUser(); const community = new SteamCommunity(); var colors = require("colors"); var fs = require("fs"); var groupID64 = "103582791458129100"; var Username = "username" + String(Math.trunc(Math.random() * 1000000)); var Password = "password" + String(Math.trunc(Math.random() * 1000000)); const SteamID = require("steamid"); const groupID = new SteamID(groupID64); client.logOn(); client.on("loggedOn", () => { console.log("Logged into Steam".cyan); client.createAccount(Username, Password, "[email protected]", function(result){ if (result === 1) { fs.appendFile("Desktop/text.txt", Username + ":" + Password + "\n", function(err) { if(err) { console.log(err); } else { console.log(Username + ":" + Password + " - Saved.".green); client.logOff(); // NOT WORKING? console.log("Logging off Steam".red); const logOnOptions = { accountName: Username, password: Password }; client.logOn(logOnOptions); client.on("loggedOn", () => { console.log("Logged into Steam".green); client.gamesPlayed("BOT Testing"); community.getSteamGroup(groupID, function(err, group) { group.join(function(err) { if (err) console.log('error', err); }); }); }); //process.exit(1) } }); } else { console.log("ERROR: ".red + result); process.exit(1) } }); }); This outputs: Logged into Steam username625656:password356952 - Saved. Logging off Steam C:\Users\Admin\node_modules\steam-user\components\logon.js:11 throw new Error("Already logged on, cannot log on again"); ^ Error: Already logged on, cannot log on again at SteamUser.logOn (C:\Users\Admin\node_modules\steam-user\components\logon.js:11:9) at C:\Users\Admin\account-maker.js:33:13 at FSReqWrap.oncomplete (fs.js:123:15) My guess is that my client.logOff(); doesn't work. Is there a way to fix this? Regards lad
-
I need some help with my bot.. so here is my problem.. I tried making an if statement like this: client.on('friendMessage', function (steamID, message) { if(steamID == '765611......'){ client.chatMessage(steamID, 'Working...'); } else { client.chatMessage(steamID, 'You are not my master!'); } }); But everytime i send the bot something it sends "Working..." but i want it to only respond with a command like !help or !test Any help or suggestions would be helpful.
-
Hi. I'm tryng to use changeEmail function, but nothing happens I think i use it wrong. Thanks. Sample code which I use: var login = "exampleLogin"; var pass = "examplePass"; var newEmail = "[email protected]"; client.logOn({ "accountName": login, "password": pass }); client.on('loggedOn', function(details) { console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID()); }); client.on('changeEmail', function(password, newEmail, err){ console.log(err); });
-
So this is the error from console. When my session expires, I use this code to come back on track: community.on('sessionExpired', (ERR) => {console.log("## Session Expired. Relogging.");client.webLogOn();}); Not sure if it synced with this code, but I will write it too client.on('webSession', function (sessionID, cookies) {manager.setCookies(cookies, function (err) {if (err) {console.log(dateFormat(Date(), "dd.mm.yyyy HH:MM:ss ") + " - " + err);//process.exit(1); I commented this cause I don't want to stop the node immediatelyclient.webLogOn(); // I put this in order to do webLogon again, not sure if necessaryreturn;}}); community.setCookies(cookies);community.chatLogon();community.startConfirmationChecker(config.steam.refreshInterval, config.steam.secret);if (config.social.hasToUpdateProfile) {updateProfile();}}); So yeah, any ideas how to solve this problem, and not get my node getting down after this Error("Cannot log onto steamcommunity.com without firs t being connected to Steam network"); ? Thank you in advance! One solution would be to use forever npm, but I would like to hear other opinions how I could rework the code, to not make the node go off, because I'm not up to use that npm due to some variables being saved while bot is being up.
-
Hello everyone, previously i made few steam bots without having any issue but this time whenever i try to run the bot with node then i get this error : /home/bot/node_modules/steamcommunity/node_modules/steam-totp/nod[email protected]<script data-cfhash='f9e31' type="text/javascript">/* */</script>/stats-reporter/index.js:9 let g_StartupTimestamp = Math.floor(Date.now() / 1000); ^^^^^^^^^^^^^^^^^^ SyntaxError: Unexpected identifier at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (/home/bot/node_modules/steamcommunity/node_modules/steam-totp/index.js:1:63) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) can anyone please help me ? thank you
-
Hello. Is it possible to get someone's friendlist (SteamIDs)? Regards.
-
Question "Steam Guard App Code" when logging in frequently
DevDuck posted a topic in node-steam-user
This is my code: manager.on('pollSuccess', () => { if (!client.steamID) { client.logOn(getLogOnOptions()); } });But today some bots did not restart. In the logs I found the following: Steam Guard App CodeIs it possible to catch this event? Or how to avoid errors when restart? -
Hello all, I just finished working on a bot using this tutorial. After trying to use it I noticed from debugging this: Exception has occurred: Error TypeError: Cannot read property 'on' of undefined at Object.<anonymous> (c:\node\tradebot.js:127:15) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Timeout.Module.runMain [as _onTimeout] (module.js:604:10) at ontimeout (timers.js:386:14) at tryOnTimeout (timers.js:250:5) at Timer.listOnTimeout (timers.js:214:5) Here is the code causing the error. client.friends.on('relationships', function(){ After closely looking at the comments in the guide I saw McKay said this: So to fix the issue do I download the github repo for steam-user and override mine with the 1.13.0 version? Otherwise how would you go about doing things involving friends without using client.friends.on() ? Thanks for your time and help
-
HI, I'm having trouble employing the group invite function of the steam-user module. My script is very simple, and meant to just invite the user to a designated group upon login: const SteamUser = require('steam-user'); const net = require('net'); const client = new SteamUser(); const SteamID = require('steamid'); ///First, log into Steam const logOnOptions = { accountName: 'xxx', password: 'xxx' //Disable your steam guard }; client.logOn(logOnOptions); client.on('loggedOn', () => { console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID()); client.setPersona(SteamUser.EPersonaState.Online); client.gamesPlayed(440); var sid = new SteamID("103582791434188513"); client.inviteToGroup( "76561198161775645", sid ); }); client.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("Our account has no limitations."); } else { console.log("Our account is " + limitations.join(', ') + "."); } if (canInviteFriends) { console.log("Our account can invite friends."); } }); The output is as follows: And yet, I don't receive any invitation. The SteamID64 and GroupID64 are both valid, so why might I have this issue?
-
After today's maintenance, my bot stopped to be online. I can't restore my bot. I tried to reproduce the disconnection with Steam. I determine that my bot is offline manager.on('pollSuccess', () => { if (!client.steamID || !csgo.haveGCSession) { // My bot is offline. Maybe there's another way? } });If I do client.logOff() then I try to relog client.relog()I'am getting nothing. Ok. I changed my code to: if (client.steamID) { client.relog(); } else { client.logOn(getLogOnOptions()); }But after client.logOff(), client.steamID - is set and relog is not working. Why after client.logOff() my condition is not working? Maybe I need something to add to the condition? Update And after client.logOff() invoked event disconnected but autoRelogin not invoked.
-
Hello! I'm getting the Sentry file from the 'steam' module. When I try to logon using this module, I set the sentry file and it still requests me to input the Steam Guard code. Here's how I'm getting the sentry from Steam.SteamUser: function MakeSha(bytes) { var hash = crypto.createHash('sha1'); hash.update(bytes); return hash.digest(); } this.steamClientUser.on('updateMachineAuth', (sentry, cb) => { fs.writeFileSync(/* path */, sentry.bytes); // Method which uses steam-user module this.loginWithSentry(); cb({ sha_file: MakeSha(sentry.bytes) }); this.steamClient.disconnect(); });And here, how I set the sentry, reading from the file that was written in the above code. let sentryFile = fs.readFileSync((/* path */)); this.steamUser.setSentry(sentryFile); this.steamUser.logOn({ accountName: this.username, password: this.password });After this, the console asks for the steam guard code, apparently ignoring the sentry.PS: The sentry file is actually 2KB.
-
Hi, when Steam prompts me for a SteamGuard code and the steamGuard event is fired, It keeps on saying that the last provided code is wrong and the event is fired again and again. I set the 'promptSteamGuardCode' to false. Any idea why might this be? Your help is much appreciated. client.on('steamGuard', function(domain, callback, lastCodeWrong) { console.log("SteamGuardCode will be provided in 5 seconds!"); setTimeout(function() { var twoFactorCode = SteamTotp.getAuthCode(logonOptions.twoFactorCode); console.log(lastCodeWrong); // true return callback(twoFactorCode); }, 5000); }); Regards, tbo
-
Hey, I want to display a message as a non-Steam game and I also want to idle a game on the background. What I have now: console.log("Logging in to Steam..."); client.logOn(logOnOptions); client.on('loggedOn', () => { console.log('Logged into Steam'); client.setPersona(1); client.gamesPlayed("Custom message", 440); }); But tf2 doesnt idle
-
Hello How to get badge level another person, friend?
- 4 replies
-
- node.js
- node-steam-user
-
(and 3 more)
Tagged with:
-
Hello, var aaaaaaaaaa= "76561198041931474";client.on('getchatHistory', function(aaaaaaaaaa, callback) {console.log(callback);}); It doesn't return anything.
-
Hey guys! I would like to ask for help. Someone can tell me where to find it my shared_secret and identity_secret? I use Steam Desktop Authenticator (jessecar96). Thanks for the help!
-
Hi! When I try to list all users in current group chat it only returns a single user, when i print object of the group chat i get: { name: '...', members: { '76561198067864125': { rank: 1, permissions: 891} }, <-- it says there is only one member private: false, invisibleToFriends: false, officersOnlyChat: false, unjoinable: false } },other members appear when they join/rejoin chat.
- 1 reply
-
- node.js
- node-steam-user
-
(and 1 more)
Tagged with:
-
Hi guys! At the moment I'm working on a chat-bot Steam, the essence of which will be giving out things for winning in the game, and all this will happen right in the bot, but I ran into the problem that I can not get data from the user: client.on('friendOrChatMessage', (senderID, message) => { if (message.indexOf("/bet %user number%") == 0){ client.chatMessage(senderID, 'Your bet is: ' + %user number%); } }); where %user number% is the number that the user enters, but I do not know how it can be implemented :C Is it even possible to do this and how? Please help me!
-
Hello, I'm trying to send this packet: https://github.com/DoctorMcKay/node-steam-user/blob/master/protobufs/steammessages_clientserver.proto#L832 I don't get an error but it doesn't update the statistic.
-
Question Problems with accepting/ignoring group invites
ScorpionOfWar posted a topic in node-steam-user
sclient.on('groupRelationship', (steamid, relationship) => { groupSteamID = steamid; if(relationship === 2) { dbot.channels.get('302817074269519873').sendMessage('You have been invited to this group: "' + groupSteamID + '" \n If you want to accept the group request, reply with ``!accept group``. \n And if you want to decline it, reply with ``!decline group``.'); console.log('New group invite to this group: "' + groupSteamID + '"'); } }); if (command === "accept-group") { sclient.accept(groupSteamID) = true; dbot.channels.get('302817074269519873').sendMessage("Accepted group invite: " + friendrqst); console.log("Accepted group invite: " + friendrqst); } if (command === "decline-group") { sclient.accept(groupSteamID) = false; dbot.channels.get('302817074269519873').sendMessage("Declined group invite: " + groupSteamID); console.log("Declined group invite: " + groupSteamID); } I am using the node-steam module and the discord.js module just for you information. sclient.accept(groupSteamID) is not a function is my error when I try to accept/decline the invite -
How can I get a groups/users name except the steam64id/groupid? Currently I just get something like this for a group: 103582791456793547 Or for a user his Steam64ID
-
Some time bot login again . I want to know how long session expired . And how increase time session live . Thank !
-
Hi, I'm trying to make a bot with this package. After I call the client.logOn method with my account name, password and twoFactorCode, I handle the loggedOn event. But even if details.eresult is set to OK, I can't put my bot into Online state, and the event who should be fired after the login isn't emitted (like accountInfo, wallet, accountLimitations, ...). There is my little code : // Require const config = require('config'); const SteamTOTP = require('steam-totp'); const SteamUser = require('steam-user'); console.log("> Welcome."); let steamCredentials = config.get('steam'); // Init SteamUser let client = new SteamUser(); client.on('loggedOn', function(details) { if(details.eresult !== SteamUser.EResult.OK) { console.log("> An error occurred when login."); return; } console.log("> Login successful."); client.setPersona(SteamUser.EPersonaState.Online); }); // This event is emit when the connection is lost with Steam. client.on('error', function(e) { console.log("> An error occurred :"); console.log(e); }); client.on('steamguard', function(domain, callback) { console.log("> Steam Guard code needed."); let code = SteamTOTP.generateAuthCode(steamCredentials.totp_shared_secret); callback(code); }); client.on('accountInfo', function(name, country, authedMachine, flags, facebookID, facebookName) { console.log("> Your name is " + name); console.log("> Your country is " + country); }); // Now, we log on. console.log("> Initiate Login."); client.logOn({ "account_name": steamCredentials.account_name, "password": steamCredentials.password, "twoFactorCode": SteamTOTP.generateAuthCode(steamCredentials.totp_shared_secret) }); I can't see why i don't have any event after the login...
-
Hello, is there any possible way to like fetch/get comments from a profile?
-
Hi, I'm using SteamUser.gamesPlayed({"game_id": 440}); but when I try start game on steam client, bot get this error: "Error: LoggedInElsewhere" and crashes. How to make bot doesn't crash, And waited until the account is freed and reconnect after that?