Jump to content
McKay Development

What Comes Around

Member
  • Content Count

    24
  • Joined

  • Last visited

Recent Profile Visitors

157 profile views
  1. So I'm trying to replicate what SDA (steam desktop authentication) does with nodejs. I can add a phone number using some puppeteer code, I can setup 2FA, but I don't get some of the other details that SDA gets, like device_id. Any idea how I could get that? Nevermind, I found out how to do it with Steam-Totp. I was just searching in the wrong place. My bad!
  2. Thank you very much. Sorry for the late response, been having too much work lately. But yes it seems like it's just not possible go through the verification process with that method. For now I guess I'll stick to some headless puppeteer verification solution I made, it's retarded, it's resource heavy, but that's all I know and it gets things done. Wish I could reach a level of understanding where I could do what you do but just don't have the time. Thank you very much for your efforts though!
  3. Right, sucks I made that mistake again. Since the last time I did, a bunch of users had their accounts reset on a database. Whoops.
  4. So I'll start with the second function. Firstly not sure why you have square brackets around steamid. What you need to do is make an array. You can do this like so: var steamidstolookup = [040230453045, 0342034023402(fake ids but u get the point)] <--- this can also be strings that can be parsed into SteamID objects as stated in the docs. As for why you are getting the error it's because you are trying to look for an object that doesn't exist in the first parameter of the callback. Here's an example of how you should do it: client.getPersonas(steamidstolookup, (err, personas) => { if (err) { console.log(err) } else { console.log(personas) } }) //This uses an arrow function, it's very similar to a normal function (It just can't use "this", arguments and some other things, tbh I don't really know all the differences because I haven't really needed to care lmao, but maybe one day I will) So as you can see the first callback param is err, when it successfully gets a response from steam, the function returns err = null. That's why u were getting an error of cannot read property ... of null. Not sure if you have grown a fear of if statements since the last posts but really they're great to use. Like in this case you wouldn't need to validate personas because if err is not null (there is an error) it won't run the code in else.
  5. Hmm, that's odd because I believe it is verified. Here is some code I used to check it, but I have also checked it manually. client.requestValidationEmail(function(){ console.log("verified") store.setCookies(cookies); store.addPhoneNumber('+31************', true, (err) => { if (err) { console.log(err) } }) }); Log: *********** has successfully logged in verified { Error: Unknown state email_verification at Request.request.post [as _callback] (D:\Node Projects\Steam-Bot-Setuper\node_modules\steamstore\components\account.js:47:14) at Request.self.callback (D:\Node Projects\Steam-Bot-Setuper\node_modules\request\request.js:185:22) at Request.emit (events.js:198:13) at Request.<anonymous> (D:\Node Projects\Steam-Bot-Setuper\node_modules\request\request.js:1154:10) at Request.emit (events.js:198:13) at Gunzip.<anonymous> (D:\Node Projects\Steam-Bot-Setuper\node_modules\request\request.js:1076:12) at Object.onceWrapper (events.js:286:20) at Gunzip.emit (events.js:203:15) at endReadableNT (_stream_readable.js:1145:12) at process._tickCallback (internal/process/next_tick.js:63:19) confirmation: false } I should mention I don't have steam guard enabled. I do however get the emails asking if I would like to add this phone number to my account.
  6. Normally in this kind of situation it's much better to use a switch statement. Which would look like this: switch(expression) { case x: // code block break; case y: // code block break; default: // code block } Here is some example code, that produces this result: const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp'); const SteamCommunity = require('steamcommunity'); const TradeOfferManager = require('steam-tradeoffer-manager'); const SteamStore = require('steamstore'); const credentials = require('./credentials'); var client = new SteamUser(); var community = new SteamCommunity(); var manager= new TradeOfferManager(); var store = new SteamStore(); var logindetails = { accountName: credentials.account.accountName, password: credentials.account.password, } client.logOn(logindetails); client.on('loggedOn', () => { console.log(`${logindetails.accountName} has successfully logged in`); }) client.on('friendMessage', function(steamid, message){ switch (message.toLowerCase()) { case "!hello": client.chatMessage(steamid, 'Hiya'); break; case "!why": client.chatMessage(steamid, 'Because you told me to'); break; case "!lol": client.chatMessage(steamid, 'You are funny'); break; default: client.chatMessage(steamid, 'Adios'); break; } }) client.on('friendRelationship', (steamid, relationship) => { if (relationship === 2) { client.addFriend(steamid); console.log("Person Added As Friend!"); } }); })
  7. No idea why that's happening. I copy and pasted the code and everything seemed fine: also, I believe you could improve this by lower casing the message contents to make both the capitalized and non-capitalized versions of the same command work. This is what the code for that looks like: client.on('friendMessage', function(steamid, message){ if (message.toLowerCase() == '!hello'){ client.chatMessage(steamid, 'Hiya'); } else { client.chatMessage(steamid, 'Adios!'); } }) As for why it's giving you the if and the else result on messages, I would check the rest of the code as if statements haven't ever and will never change. So it must be an issue elsewhere, maybe you call the if statement twice and one if statement is reversed? I mean I don't know but that's all I can do to explain it. If you would like the full code that I used here it is: const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp'); const SteamCommunity = require('steamcommunity'); const TradeOfferManager = require('steam-tradeoffer-manager'); const SteamStore = require('steamstore'); const credentials = require('./credentials'); var client = new SteamUser(); var community = new SteamCommunity(); var manager= new TradeOfferManager(); var store = new SteamStore(); start(); function start() { var logindetails = { accountName: credentials.account.accountName, password: credentials.account.password, } client.logOn(logindetails); client.on('loggedOn', () => { console.log(`${logindetails.accountName} has successfully logged in`); }) client.on('friendMessage', function(steamid, message){ if (message.toLowerCase() == '!hello'){ client.chatMessage(steamid, 'Hiya'); } else { client.chatMessage(steamid, 'Adios!'); } }) client.on('webSession', (sid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(20000, logindetails.identitySecret); community.clearPersonaNameHistory((err) => { if (err) { console.log(err); } }); }) } You can ignore some things like webSession as you probably won't be confirming trades and overall using community, manager, or store. Where I add my account details you could just replace that with your details. You can use this to compare it to your code to maybe find a mistake. But as far as I know this works completely fine. Also you don't need all the stuff in a function called start. That was just a copy and paste from older code I had so I didn't have to rewrite everything. Also I can send you some trade listening code if you like, but I'll need to go look for some good examples in my projects. P.S: Remember to install all the npms if you don't want to change anything except the log in details.
  8. Thank you very much, noted. However I still have one question. I still get an error of Unknown state email_verification. When I looked through the source of the error I see that the function addPhoneNumber makes a post request then gets the response. How do I find the time to respond to the email?
  9. Why not use a tradeoffer event listener? I think that would be a much easier route. You can get the sender id, the contents of the trade, the message, a lot more. If by respond back you meant send a message back, you could get the steamid using the partner id and just send the user a message.
  10. store.setCookies(cookies); store.addPhoneNumber('+31062571****[true]', (err, status, bypassConfirmation) => { if (err) { console.log(err) } if (status) { console.log(status) } if (bypassConfirmation) { console.log(bypassConfirmation) } I have some questions regarding the addPhoneNumber method. Is this the right way to pass bypassConfirmation = true? I have never seen this way of passing params : number[, bypassConfirmation], callback. The "[]" part in specific. Also I got a number of different errors while trying it. First I got a bunch of Error: Phone number is invalid errors, my guess was I wasn't passing in the param for phone number the right way. The final error that I got before coming here (and the one I presume I had the best progress with) is "Error: Unknown state email_verification". My guess is I need to verify adding my phone first, BUT it accepted my phone number? So that was a step in the right direction. So now I'm wondering if bypassconfirmation worked? Does it not bypass email confirmation? Or did I just not set the param right? Sorry for the long read, hope I didn't take much of your time.
  11. So I am currently setting up bots with 2FA manually using steam desktop authentication, but I think it's time, it's time to use my brain again. So I have been looking through the steam community npm docs and I found 2FA methods but no add phone methods. I'd like to be able to take accounts with no steam guard, add a phone number, and then turn on 2FA, and finally console log all the information about the account, all the secrets and everything. Would this be possible? (mainly the phone part) Otherwise I'll have to use puppeteer but that's sorta resource heavy and not ideal (also I don't know cheerio). Any advice would be appreciated!
  12. Because I don't want to take up an entire new thread, I'll ask here, how can I check if a user's trade token is valid? Should I just try manager.createOffer and check if there's an error?
  13. Quick question, From reading the docs from what I understand unless doing a real-time trade I won't be able to find out if the trade was accepted, only if it was sent. Is this correct? Is there any reliable way to find out if a user accepted a trade offer without using real-time trades?
×
×
  • Create New...