Jump to content
McKay Development

What Comes Around

Member
  • Posts

    76
  • Joined

  • Last visited

Everything posted by What Comes Around

  1. Good day/night, I'd like to ask what I am doing wrong? Here is what I have: client.logOn(loginOptions); client.on('loggedOn', () => { console.log('logged on'); client.setPersona(1); }); client.on('webSession', async (sid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(20000, config.identity_secret); let item = await getItem() var requestoptions = { form: { sessionid: community.getSessionID(), appid: item.appid, contextid: item.contextid, amount: 1, price: 10 }, headers: { 'Origin': 'http://steamcommunity.com', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Referer': 'http://steamcommunity.com/my/inventory/', 'Connection': 'keep-alive', 'Cookie': cookies, 'Host': 'steamcommunity.com', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'en-US,en;q=0.5' }, json: true } console.log(requestoptions) community.httpRequestPost('https://steamcommunity.com/market/sellitem/', {requestoptions}, (err, response, json) => { if (err) { console.log(err.toString()); return; } console.log(json) }, "steamcommunity") }) const getItem = () => { return new Promise((resolve, reject) => { manager.getInventoryContents(730, 2, true, (err, inventory) => { if (err) { reject(err); } else { resolve(inventory[0]); } }) }) } I keep getting: Error: HTTP error 400 Any advice?
  2. Why not just check settings.language first and if it's blank/null/undefined set it to a default value?
  3. 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!
  4. 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!
  5. 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.
  6. 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.
  7. 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.
  8. 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!"); } }); })
  9. 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.
  10. 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?
  11. 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.
  12. 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.
  13. 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!
  14. 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?
  15. 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?
  16. Yes I was mistaken, my bad. Thanks again! Your code is very clean, would have taken me a while to get all the mess I had perfected.
  17. This makes perfect sense! I tried using a callback and it worked, but I didn't like the mess I created so I made the code in my original question. Your solution is clean and makes sense. Also I will use getInventoryContents. Thanks a bunch! Oh but one question. getInventoryContents has a steamid param, so I'd assume you can fetch other users inventories, but there is a getUserInventoryContents function for that. What's the difference?
  18. Good day, So I am kind of new to js and this may be a noob question, if it is I am very sorry for asking. But here is what I am having issues with: const getInventory = () => { manager.loadInventory(730, 2, true, (err, inventory) => { if (inventory) { return inventory; } if (err) { console.log(err); } }) } So I export this function, but when I try console logging it, it doesn't return anything, just undefined. But when I put inventory into a callback, I get it. Is there something I am missing here? Thanks!
  19. Hey there, today I managed to try out the code and I have another question. I get: SteamID { universe: 1, type: 1, instance: 1, accountid: 92222221 } when using this function: module.exports.IDFetcher = function(link) { const SteamID = require('steamid'); const URL = require('url'); steamid_of_user = SteamID.fromIndividualAccountID(URL.parse(link, true).query.partner); return steamid_of_user; } So while it gives me the account id, it doesn't convert it to a SteamID, which is something I don't know how to do. I have also tried inputting account id's into SteamID.fromIndividualAccountID but still get an object with what I input.
  20. I couldn't find the answer just looking it up on your site and google, so hopefully this helps anyone with the same question in the future. Thank you very much!
  21. Hey there, So basically I need to get the steam id to make sure a user does not exploit a system. But for easy of use I chose to use tradeofferurls for users, but how do I get the steamid from the tradeofferurl?
  22. Hello, I have recently been trying to make a card farming bot but I have one problem. I don't know how to find out which apps contain card drops. After looking around a lot I found out I can use client.getOwnedApps to find the apps I own but can't find any npms that help me find which apps have card drops available. Also .getOwnedApps() shows all apps owned, including default apps. How do I find a list of default apps to delete from my array? Big daddy Dr. McKay shows that he knows how to get rid of the default apps in this thread: Anyone know what I could use to get an array of apps with card drops or just how to get rid of the default apps?
×
×
  • Create New...