Jump to content
McKay Development

TheMaster

Member
  • Posts

    18
  • Joined

  • Last visited

Recent Profile Visitors

8669 profile views

TheMaster's Achievements

  1. ummm i have a problem idk y this is happening can anyone diagnose? the below is the only connection logic client.logOn(logOnOptions); client.on('loggedOn', function() { console.log(green,`Logged into Steam ${accname}`); }); setInterval(() => { if (!client.steamID) { client.logOn(logOnOptions); } },600000); // 10 mins 600000 setInterval(() => { if (!client.steamID) { client.logOn(logOnOptions); }else{ client.webLogOn(); } },3600000); // 1 hour 3600000 C:\New folder\node_modules\steam-user\components\09-logon.js:49 let alreadyConnectingError = new Error('Already attempting to log on, cannot log on again'); ^ Error: Already attempting to log on, cannot log on again at SteamUser.logOn (C:\New folder\node_modules\steam-user\components\09-logon.js:49:32) at Timeout._onTimeout (C:\New folder\mainimprovements.js:788:20) at listOnTimeout (node:internal/timers:573:17) at process.processTimers (node:internal/timers:514:7) Node.js v21.7.1
  2. well that seems like a bigger problem with your connection logic the session websession even is called when ever ur current websession expires its a automatic process and does not require ur intervention u need to look at ur reconnection or the weblogon etc stuff i think
  3. NP, and definitely your choice this function and method automatically updates the access token when ever the websession is established and the plus point is that u dont need to write another function to me its more compact
  4. just use the getwebapi method in other libraries like node steam community async function getWebApiKey() { return new Promise((resolve, reject) => { community.getWebApiKey((err, key) => { if (err) { reject(err); } else { webapi=key console.log(green,"Got API key: " + webapi); resolve(key); } }); }); }
  5. are u sing this in this in the constructer?
  6. acutally u can listed to client.on wesbsession as it has the callback cookies u and the steam login secre cookie u can extract the access token from there ill give u the function to do that function extractJWTToken(tokenString) { const jwtRegex = /ey[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_.+/=]+/; const jwtToken = tokenString.match(jwtRegex); return jwtToken ? jwtToken[0] : null; } client.on('webSession', async (sessionID, cookies) => { //console.log(cookies) let jwtToken = extractJWTToken(cookies[0]) //console.log(jwtToken) cookiesformarket=jwtToken manager.setCookies(cookies, function(err) { //console.log(cookies) if (err) { console.log(red,err); process.exit(1); // Fatal error since we couldn't get our API key return; } safePromise(withTimeout(stayOnline(refreshToken, marketapi,cookiesformarket), 10000,"stayOnline")) // Adjust timeout as needed .catch(error => console.error(red,'Error staying online:', error)); // Error handling //webapi=manager.apiKey //fetchActiveTradeOffers(); // Call the function } ); can u testify my answer?
  7. hey what procedure do u use to automatically cancel trades after a certain amount of time?
  8. yo man thank u very much u sve me a lot of hassle how u found this tho? but when i use this the webapi is null its not getting the webapi correctly client.on('webSession', async (sessionID, cookies) => { manager.setCookies(cookies, function(err) { if (err) { console.log(red,err); process.exit(1); // Fatal error since we couldn't get our API key return; } console.log(green,"Got API key: " + manager.apiKey); webapi=manager.apiKey //fetchActiveTradeOffers(); // Call the function } );
  9. the NewOffers event in the steam trader offer manager no longer posts trader offers nor the trade status change after the cs2 update i think this need to be updated
  10. the issue is stated in the topic it appears randomly and i cant seem to find the cause never seen that error before
  11. understood sir one more question this is a utmost importance i am looking to automatically loginto websites using steam i found that steam uses OPENID2 but i have no clue how to loginto through steam using that are i have seen the node steam user and the community can u point me what to do here?
  12. ok i will set a timer to run that function ever 1 hour and let u know the results however this maybe a dumb question please excuse my ignorance but we are sending the client once to the steam-tradeoffer-manager if we webLogOn() this will update the client in the steam tradeoffer manager too or do we have to create a new object const steamOptions = { autoRelogin: true, httpProxy : proxy }; let client = new SteamUser(steamOptions); const communityOptions = {}; communityOptions.request = Request.defaults({ 'proxy': proxy }); let community = new SteamCommunity(communityOptions); let manager = new TradeOfferManager({ "steam": client, // Polling every 30 seconds is fine since we get notifications from Steam "domain": "localhost", // Our domain is example.com "language": "en" // We want English item descriptions });
  13. if (config.steam.acceptOffers) { // Accepts all offers empty from our side this.managers[config.steam.accountName].on("newOffer", (offer) => { if (offer.itemsToGive.length > 0 && !offer.isOurOffer) { // offer.decline(); } else { offer.accept(); } }); }
  14. think that the session is disconnected far too often while in client and the browser on which we are logged in the session dosent break for months i think that alot of sessions make and break also alert steam is there are a way to keep the session open for a long time as i can see there are a number of ways to sign into steam using steam-user P.S i am using the accname pass and the guard code for login also by using this approach for example i run my bot for 1 day the client we are sending over to steam-tradeoffer-manager expires and it begins to give error message Error= Not Logged IN
×
×
  • Create New...