Jump to content
McKay Development

All Activity

This stream auto-updates

  1. Last week
  2. Yes you are right it appears I have an old version. Installing the newest release fixed the issue
  3. Sounds to me like you probably aren't properly sending your cookies in your requests. The sessionid cookie is just a CSRF token; it can be anything at all.
  4. i have some code that logs into steam so one of my bots can accept a trade, first it gets the rsa key using a bots username then it encrypts a password and sends a request to dologin. i get the cookies back in the response however it is only steamauth, loginsecure, and steam country i get a 403 on trying to do pretty much anything because i have no session id how can i get one? i currently am using this: let sessionid = require('crypto').randomBytes(12).toString('hex'); and then pushing it to the array of cookies however i still get 403 is there a different way i should be doing it?
  5. I don't see any reason why that would happen unless you installed a really old version somehow. Could you paste the contents of node_modules/steamcommunity/package.json?
  6. When running this code I get this message How is it possible I have some methods missing?
  7. There's no list of the order that events get emitted in because it isn't really defined. loggedOn happens first, unless steamGuard happens before you log on. Once you're logged on, everything else happens as Steam sees fit. Obviously, once you're disconnected (disconnected and error events) then further events stop. You could add an event listener inside of another event listener, but unless you use user.once or manually remove the listener every time, then your event handler will start getting called multiple times when the event fires.
  8. Hello. Thank you for your help. I have moved the offer inside webSession and now the error has gone, nonetheless, I am waiting the 7 days cooldown because of new device, but I think it will work as expected inside webSession. About keeping it logged, the few times I have tested trying to keep the bot logged, it randomly asked for SteamGuard code in the console, but it might be something I messed up because of me not being familiar with the events and the order they are fired, since there are events concerning keeping the bot logged. I have searched the wiki, but I wasn't able to find a "list" of events in order of firing. I will keep digging the source code and look for them and try to understand better the way they work, I am doing that but since I am new to Node.JS it takes me a while to understand the syntax. By they way, can you listen an event, inside an already listened event? For instance, can you listed for a chat message inside the callback of listened to a offer recieved? Or events cannot be nested inside each other? Once again, thank you for your help.
  9. webSession will be emitted some time after loggedOn. loggedOn is the first event to be emitted after you log on; everything follows from there. Send your trade inside the webSession event and you should be good to go. Also, there's nothing that says you couldn't keep the bot logged on between requests, avoiding the need to log back on every time.
  10. Hello. I am quite new to Node.JS so I need a little help sorting some things out. I am trying to make the bot controlled by POST request by using Express for the URL routing, so the bot only responds to specific requests made from specific domain to specific endpoints. I am able to login to SteamUser, but I am not able to share the cookies to SteamCommunity. I wasn't able to find a way to keep the bot logged in across different endpoints, I am assuming that it comes from the fact that every request is unique and they are not sharing data between them, so, I have to make the bot log in on each request, and that's fine with me. The problem comes when I try to share the cookies from webSession event, and send a trade on the loggedOn event. It appears that when logged on event fires, cookies are not yet configured. What approach should I use to perform the login on the SteamCommunity module? Here is my current code, that rejects my trade offer, because cookies are not yet configured. app.get('/lero', async (req, res) => { res.send('Loaded'); const SteamUser = require('steam-user'); const SteamCommunity = require('steamcommunity'); const SteamTotp = require('steam-totp'); const TradeOfferManager = require('steam-tradeoffer-manager'); const FS = require('fs'); let client = new SteamUser(); let manager = new TradeOfferManager({ "steam": client, "domain": "bot.test", "language": "es" }); let community = new SteamCommunity(); // Steam logon options let logOnOptions = { "accountName": "censored", "password": "censored", "twoFactorCode": SteamTotp.getAuthCode("censored"), }; if (FS.existsSync('polldata.json')) { manager.pollData = JSON.parse(FS.readFileSync('polldata.json').toString('utf8')); } client.logOn(logOnOptions); const { Sequelize, Op, Model, DataType, DataTypes } = require('sequelize'); const sequelize = new Sequelize('cendsored', 'censored', 'censored', { host: 'localhost', dialect: 'mysql', define: { underscored: true, createdAt: 'created_at', updatedAt: 'updated_at' , deletedAt: 'deleted_at', } }); const initModels = require('./models/init-models'); const models = initModels(sequelize); client.on('webSession', (sessionID, cookies) => { community.setCookies(cookies); manager.setCookies(cookies); console.log(cookies); // console logs this after the error, meaning trade is sent before this }); client.on('loggedOn', async () => { console.log("Logged into Steam"); const su = await models.steam_users.findOne({ where: { steam_personaname: 'censored', }, include: [{ model: models.users, as: 'user', }], }).then((r) => { client.chat.sendFriendMessage(r.steam_steamidmodern, "Sending trade in a moment"); let offer = manager.createOffer('censored'); console.log(offer); console.log(community); let item = { assetid: 'censored', appid: '730', contextid: '2', amount: 1, }; if (offer.addTheirItem(item)) { offer.send((err, status) => { if (err) { console.log(err); } else { console.log(status); } }); } }); }); }); I am familiar with events, since in PHP I have worked with OpenCart, Wordpress and Laravel, but I cannot find the right order of events here, to correctly log in both modules. Any help will be very much appreciated.
  11. Earlier
  12. How would I make the log in process asynchronous, then? I looked at the README but couldn't find anything.
  13. Your promise is getting resolved synchronously before anything actually happens.
  14. Here's the full code: return new Promise(resolve => { if (!username || !password || typeof username !== 'string' || typeof password !== 'string') { throw new Error('Invalid username or password provided.'); } this.steamUser.logOn({ accountName: username, password: password, twoFactorCode: twoFactorCode }); console.log(this.steamUser); this.steamUser.on('loggedOn', details => { console.log(details) this.steamUser.getEncryptedAppTicket(1818750, async (err, appTicket) => { console.log(appTicket); if (err) { throw new Error(err); } const data = await this.info(appTicket.toString('hex')); console.log(data); this.accessToken = data.token; }); }); resolve(this); }); this.steamUser is a construct of SteamUser. Any of the console.logs don't seem to work, although on rare occasions this.steamUser and details are logged to the console.
  15. Where are you logging accessToken? After the promise is resolved? If that's the case, you need to move your resolve(this) line after when the access token is set. I need to see all relevant code, along with debugging output (add console.log statements in places) to provide any further help.
  16. I'm not getting any output. When I console.log accessToken, null is returned.
  17. I've set twoFactorCode to the current value in my Steam app, but the steamGuard event doesn't seem to emit and the .logOn() function doesn't seem to properly log the user in.
  18. It looks like you're passing the same code to the steamGuard event as you used in the logOn method. If it didn't work the first time, it's not going to work a second time. You likely need to wait 30 seconds for the next code to come round, or add 30 seconds to your time offset.
  19. I'm using steam-user in a project where I can't get a Steam Guard code from a user through stdin. I'm using the following code, but it's inconsistent: this.steamUser.logOn({ accountName: username, password: password, twoFactorCode: twoFactorCode }); this.steamUser.on('steamGuard', (_domain, callback) => { callback(twoFactorCode); }); this.steamUser.on('loggedOn', () => { this.steamUser.getEncryptedAppTicket(1818750, async (err, appTicket) => { if (err) { throw new Error(err); } const data = await this.info(appTicket.toString('hex')); this.accessToken = data.token; }); }); resolve(this); The above code works occasionally, but in the few times that it does work, nothing in the .getEncryptedAppTicket() block is executed. What am I doing wrong?
  20. @Dr. McKay I seem to have the same problem. I tried opening new ticket, and it didn't open so im posting it here: module.exports = function(accountDetails, accountSettings, nickname, accountID, games){ this.client = new SteamUser(); this.community = new SteamCommunity(); let csgo = new GlobalOffensive(this.client); this.logOnOptions = { accountName: accountDetails.login, password: accountDetails.password, rememberPassword: true, machineName: machineName, clientOS: 16, dontRememberMachine: false, rememberPassword: true } if(accountDetails.sharedSecret) this.logOnOptions.twoFactorCode = SteamTotp.generateAuthCode(accountDetails.sharedSecret); this.client.setOption("promptSteamGuardCode", false); this.client.setOption("autoRelogin", true); this.client.logOn(this.logOnOptions); this.client.on('loggedOn', () => { ... }); this.client.on('webSession', (sessionId, cookies) => { log(`webSession found.`, this.login); this.community.setCookies(cookies); log(`Cookies set.`, this.login); if(identitySecret){ this.community.startConfirmationChecker(10000, accountDetails.identitySecret); log(`Confirmation checker started.`, this.login); } }); } And all I get is:
  21. Sounds like it's crashing. Not much that can be done to help you without a stack trace.
  22. In the process of locating and offering to buy on csgoempire, my program is unexpectedly closing in an average of 30 minutes, giving much less offers on the listed items (same as a friend's list). I tested 3 different types of internet connection and none proved to be effective, is this usually related to the internet connection? I'm not very experienced with the files so if you can point me to a repair guide or log, I'd be grateful.
  23. i have the very same issue w/ steam mobile app authorization. there is no way you can authorize w/ 2fa enabled on your account so...
  24. Got it running if anyone else needs it user.on('friendMessage', (steamID, message) => { if (message == 'stats') { if (csgo.haveGCSession) { const steamid = new SteamID(steamID.toString()); const final = steamid.accountid.toString(); csgo.requestPlayersProfile(steamid, function(data) { // console.log(data); user.chatMessage(steamID, 'Wins in Matchmaking: ' + data.ranking.wins + '\n' + 'Wins in Wingman: ' + data.rankings[0].wins + '\n' + 'Wins in Dangerzone: ' + data.rankings[1].wins); }); }else { user.chatMessage(steamID, 'Nö'); } } });
  25. Hey, im pretty new to JS and i don't know on how to get the accountData from a specific user. i know that this works, but it just gets me the accountData of my logged in account. csgo.on('accountData', (accountData) => { console.log(accountData); console.log(accountData.player_level); }); How would i make a function to call the accountData of a specific player? Like if someone writes the bot stats it gets the accountData from the player that requested it.
  1. Load more activity
×
×
  • Create New...