Jump to content
McKay Development

iulian

Member
  • Posts

    3
  • Joined

  • Last visited

Everything posted by iulian

  1. Hi again. 15 days have passed and I can confirm trades using the trade manager. Thank you! However, I noticed a bug, or maybe I'm doing something wrong. If I get a new offer when the script is working, I can immediately see it on the newer event, and I can immediately accept it. I can't accept the trade afterward if I don't act on this event. I've tried to use a setInterval and check manager.getOffers, but the detected offer is not on the list. Even if I directly call manager.getOffer(offerId), I get undefined. Even if I restart the script, I can't find the offer, which I can see on Steam's trade offer web page. // just some sample code to reproduce the issue let client = new SteamUser(); let manager = new TradeOfferManager({ steam: client, // Polling every 30 seconds is fine since we get notifications from Steam language: "en", // We want English item descriptions pollInterval: 30000, useAccessToken: true, }); let community = new SteamCommunity(); async function main() { let logOnOptions = { accountName, password, twoFactorCode: SteamTotp.getAuthCode(sharedSecret), // shared secret }; if (FS.existsSync("polldata.json")) { manager.pollData = JSON.parse( FS.readFileSync("polldata.json").toString("utf8") ); } client.logOn(logOnOptions); } manager.on("pollData", function (pollData) { FS.writeFileSync("polldata.json", JSON.stringify(pollData)); }); client.on("webSession", function (sessionID, cookies) { manager.setCookies(cookies, function (err) { if (err) { console.log(err); process.exit(1); } console.log("Cookies set"); }); community.setCookies(cookies); setInterval(checkTrades, 1 * 30 * 1000); }); manager.on("newOffer", function (offer) { console.log( "New offer #" + offer.id + " from " + offer.partner.getSteam3RenderedID() ); // i can accept the offer here if I wish }); function checkTrades() { console.log("Checking for trade offers..."); manager.getOffers( TradeOfferManager.EOfferFilter.All, null, (err, offers) => { if (err) { console.error("Error fetching trade offers:", err); return; } // offers doesn't include the offer id i saw in the newOffer event // filtering getOffers with ActiveOnly results in an empty array // manager.getOffer(offerId) is undefined offers.forEach((offer) => { //... }) } ); }
  2. I figured that one out, I had to do some digging but it looks like shared secrets are generated when setting up the mobile authenticator. On a separate note, I'm using the script to accept gift offers, which works fine. But, after about 24 hours, it seems like the script is not responding or getting any new steam notifications. I have a feeling that the session isn't kept alive properly. I experienced something similar with SIH on Chrome when I was keeping a Steam tab open for long periods of time. Is there a way of solving this issue besides trying to re-login?
  3. Hello. I'm starting to use this project to automate some trading. I'm using this example: https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/blob/master/examples/storehouse-steam.js I added useAccessToken in the construct to retrieve CS2 trade offers. 15 days ago disabled and re-enabled my 2-factor authenticator to retrieve my shared_secret and identity_secret with the examples found in node-steamcommunity. I have my mobile authenticator back on my phone, btw. I'm able to log in and see my incoming offers with the trade offer manager and it works accepting 'gift' offers (empty on my side). However, when confirming the trade offers where I'm giving away an item, I get 'Invalid Authenticator'. I noticed a few things, so maybe something went wrong along the way. When I'm logging in, I need to copy-paste my Steam Guard Code to log in, even though I have the twoFactorCode option there. The generated SteamTotp.getAuthCode(sharedSecret) is different from what I see in my authenticator. I tried playing with time offsets, either by adding 1, -1, or leaving it at 0. SteamTotp.getTimeOffset usually retrieves a 0. I'm on MacOS if that matters.
×
×
  • Create New...