Search the Community
Showing results for tags 'steamcommunity'.
-
how best to use a proxy in the steam community
4049_1572836826 posted a topic in node-steamcommunity
Hi, in the future I plan to have more bots in one script they will have functions that will get info from steam pages and I would like to avoid limits. I have made such a solution which works with request.. And I would like to ask if there is another option ? proxy.bot = 'http://xx:xx@xxx:xxx' steamUser.bot = new SteamUser({ httpProxy: proxy.bot }) request.bot = Request.defaults({ forever: true, proxy: proxy.bot }) steamCommunity.bot = new Steamcommunity({ request: request.bot }) steamUser.bot.logOn({ refreshToken: 'xxx' }) steamUser.bot.on('loggedOn', () => { console.log('Logged on!') console.log(steamUser.bot.publicIP) // * to eq proxy IP }) steamUser.bot.on('webSession', (sessionID, cookies) => { steamCommunity.bot.setCookies(cookies) steamCommunity.bot.loggedIn((err, loggedIn) => { if (err) console.log(err) if (loggedIn) console.log('Logged in!') const { request: SCrequest } = steamCommunity.bot SCrequest.get('https://api.ipify.org?format=json', (err, res, body) => { if (err) console.log(err) console.log(JSON.parse(body).ip) // * to eq proxy IP }) SCrequest.get('https://steamcommunity.com/my/profile', (err, res) => { if (err) console.log(err) console.log(res.request.uri.href) // * return /profiles/steamID }) }) }) -
If I have multiple accounts where I want to skip queue once per day is it better to keep them logged in or log in and out on each event? Logging in is via refreshtoken. I'm currently logging in and logging out.
-
steam-user : v. 4.27.1 steamcommunity: v. 3.44.3 Hi, I'm logging into the bot via steam-user and refresToken and after finding webSession, cookies are not valid / setCookies still return Not Logged In. SteamCommunity _checkHttpError return status code 302 redirection to /login Anyone have similar experiences ? steamUser[item.id] = new SteamUser() steamCommunity[item.id] = new SteamCommunity() tradeOfferManager[item.id] = new TradeOfferManager({ steam: steamUser[item.id], community: steamCommunity[item.id], domain: 'localhost', language: 'en' }) steamUser[item.id].logOn({ refreshToken: item.steam_session_token, logonID: 67 })
- 2 replies
-
- steam-sessions
- steamcommunity
-
(and 3 more)
Tagged with:
-
I have a web app that processes steam trades. The goal is to log into steamcommunity with user/pass/2fa once on startup, then use the logged in community object to create offers when trades are processed. I have the current code which seems to successfully process trades (I can't know for sure as the bot account had 2FA enabled just a few days ago), the problem is that every time a trade is processed, a community login is required. If I remember correctly, you can only log in with 2FA once every 30 seconds. For my use case, this is a limitation I am hoping to avoid. import two from './twofactor_76561199485326357.json'; import {TItemsAsset} from "@/helpers/steamTypes"; var SteamTotp = require('steam-totp'); var TradeOfferManager = require('steam-tradeoffer-manager'); var SteamCommunity = require('steamcommunity'); var community = new SteamCommunity(); require('dotenv').config(); export default function createOffer(tradeURL: string, items: TItemsAsset[]) { var logOnOptions = { accountName: process.env.BOT_USER, password: process.env.BOT_PASS, twoFactorCode: SteamTotp.generateAuthCode(two.shared_secret), } community.login(logOnOptions, (err: Error) => { if (err) { console.log('Error logging into community'); throw Error; } else { console.log('Successfully logged into community as ' + logOnOptions.accountName); var manager = new TradeOfferManager({ "community": community, "pollInterval": 5000, "cancelTime": 180000, "pendingCancelTime": 180000, "domain": (process.env.NODE_ENV !== 'production' ? 'localhost:3000' : 'mywebsite.com'), "language": "en", }) let offer = manager.createOffer(tradeURL); //offer.addTheirItems(items.map(item => ({ appid: item.assetid, contextid: item.contextid, assetid: item.assetid }))); offer.addTheirItem({ appid: 730, contextid: 2, assetid: 19506293513 }) offer.setMessage('Items from bounty creator'); offer.send(function(err: Error, status: string) { if (err) { console.log('send err: ' + err); throw Error; } else if (status === 'pending') { community.acceptConfirmationForObject(two.identity_secret, offer.id, (err: Error) => { if (err) { console.log('confirm err: ' + err); } else { console.log('Offer confirmed'); } }); } else { console.log('trade offer sent successfully'); } }); } }); } I respect your time and am not asking you to teach me basic javascript principles, but if you could point me in the right direction that would be very much appreciated. Thanks for creating these libraries, - b_zy
- 1 reply
-
- node.js
- steamcommunity
-
(and 1 more)
Tagged with:
-
I'm trying to post a comment on my group (https://steamcommunity.com/groups/testingwall) but it's not working for some weird reason. const content = "hello world"; const gid = config.clanid; community.postGroupComment(gid, content); This is the "clanid" in my config: { [..] "clanid": "103582791470169702" } This is the error I'm getting when I run the program [..]\Bot\node_modules\steamcommunity\components\groups.js:611 "uri": "https://steamcommunity.com/comment/Clan/post/" + gid.getSteamID64() + "/-1/", ^ TypeError: Cannot read property 'getSteamID64' of undefined at SteamCommunity.postGroupComment ([..]\Bot\node_modules\←[4msteamcommunity←[24m\components\groups.js:611:64) Please help me!
-
The is my steam bot code. Idk what is wrong to code bot it don't work very good because after 1-2 days it brakes. That are the errors that i get: Error: Disconnected at SteamClient._disconnected (/var/server/node_modules/steam/lib/steam_client.js:189:24) at Connection.emit (events.js:189:13) at TCP._handle.close (net.js:600:12) TypeError: Cannot read property 'send' of undefined at SteamClient._send (/var/server/node_modules/steam/lib/steam_client.js:117:20) at SteamClient.send (/var/server/node_modules/steam/lib/steam_client.js:126:8) at SteamUser.requestWebAPIAuthenticateUserNonce (/var/server/node_modules/steam/lib/handlers/user/index.js:37:16) at SteamWebLogOn.<anonymous> (/var/server/node_modules/steam-weblogon/index.js:34:23) at ClientRequest.<anonymous> (/var/server/node_modules/steam-web-api/index.js:34:9) at Object.onceWrapper (events.js:277:13) at ClientRequest.emit (events.js:189:13) at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21) at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17) at TLSSocket.socketOnData (_http_client.js:442:20) at TLSSocket.emit (events.js:189:13) at addChunk (_stream_readable.js:284:12) at readableAddChunk (_stream_readable.js:265:11) at TLSSocket.Readable.push (_stream_readable.js:220:10) at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17) And more errors. I want the best code the this bot without disconnects and with auto session cookies set after expires. Thanks. BOT CODE var bots = { steam: { botname: config.bot_steam.botname, username: config.bot_steam.username, password: config.bot_steam.password, identitySecret: config.bot_steam.identitySecret, sharedSecret: config.bot_steam.sharedSecret } } var new_steam_bot = function() { var connected = false; var community = new SteamCommunity(); var client = new Steam.SteamClient(); var user = new Steam.SteamUser(client); var friends = new Steam.SteamFriends(client); var webLogon = new SteamWebLogon(client, user); var manager = new TradeOfferManager({ steam: client, community: community, domain: 'localhost', language: 'en', cancelTime: 150000 }); client.connect(); return { connected, community, client, user, friends, webLogon, manager, } } var Steam = require('steam'); var TradeOfferManager = require('steam-tradeoffer-manager'); var SteamTotp = require('steam-totp'); var SteamWebLogon = require('steam-weblogon'); var SteamCommunity = require('steamcommunity'); var q = require('q'); var protos = require('./protos'); var steam_bots = new_steam_bot(); steam_bots.client.on('connected', function() { logger.warn('[BOT] Client Connected'); steam_bots.user.logOn({ account_name: bots.steam.username, password: bots.steam.password, two_factor_code: SteamTotp.generateAuthCode(bots.steam.sharedSecret) }); }); steam_bots.client.on('logOnResponse', function(response) { if(response.eresult !== Steam.EResult.OK) { logger.warn('[BOT] Client Login Failed'); steam_bots.client.connect(); return; } logger.warn('[BOT] Client Login Success'); setWebLogOn(); }); steam_bots.client.on('loggedOff', function(eresult, msg) { logger.warn('[BOT] Client Logout. Message: ' + msg); steam_bots.client.connect(); }); steam_bots.client.on('error', function(err) { logger.warn('[BOT] Client Error. Error: ' + err.message); logger.error(err); writeError(err); if(err.message == 'Disconnected') { logger.error('[BOT] Client Disconnected. Reconnecting!'); steam_bots.client.connect(); } }); steam_bots.community.on('confKeyNeeded', function(deepDataAndEvents, updateFunc) { logger.warn('[BOT] Need Conf Key'); updateFunc(null, time, SteamTotp.getConfirmationKey(bots.steam.identitySecret, time(), deepDataAndEvents)); }); steam_bots.community.on('sessionExpired', function(err) { logger.warn('[BOT] Session expired, logging in...'); bots.steam.connected = false; steam_bots.community.stopConfirmationChecker(); setWebLogOn(); }); steam_bots.user.on('updateMachineAuth', function( sentry, callback ) { callback({ sha_file: getSHA1(sentry.bytes) }); }); function getSHA1(bytes) { var shasum = crypto.createHash('sha1'); shasum.end(bytes); return shasum.read(); } function setWebLogOn(){ try{ steam_bots.webLogon.webLogOn(function(sessionID, cookies) { logger.warn('[BOT] Session cookies set'); steam_bots.manager.setCookies(cookies, function(err) { if (err) { logger.error(err); writeError(err); process.exit(1); } }); steam_bots.community.setCookies(cookies); steam_bots.community.startConfirmationChecker(5000, bots.steam.identitySecret); setTimeout(function(){ steam_bots.connected = true; loadOffersSent(); loadPricesAll(); }, 1000); }); } catch(err){ logger.warn('[BOT] Error Web Log On. Error: ' + err.message); logger.error(err); if(client.loggedOn){ user.requestWebAPIAuthenticateUserNonce(function(result){ logger.error('Error: Request Web API Authenticate User Nonce. ' + result); }); } else { client.connect(); } } }
- 1 reply
-
- steam
- steam-tradeoffer-manager
-
(and 3 more)
Tagged with:
-
Hello, I keep getting a bad request error (400) when I try to post with this function. All the info I have in the function should be correct. Any ideas? community.httpRequestPost("https://steamcommunity.com/market/sellitem/", { data: { 'sessionid': sessionID, 'appid': 730, 'contextid': 2, 'assetid': 18534283110, 'amount': 1, 'price': 1 } }, function(err) { if (err) throw err; }); It gets the sessionID variable from logging in, so that shouldn't be an issue.
- 2 replies
-
- market listings
- steam api
-
(and 2 more)
Tagged with:
-
Hello i have authorized node js bot and Steam Web API of my 2nd account, i'm looking for the way to send trade offers to this 2nd account without it's token is there any possible way to do this? I was thinking about sending friend request first and tried this POST request to Steam Web Api but it's seem not working https://api.steampowered.com/IPlayerService/AddFriend/v1/?key=2ND_ACC_API&steamid=BOT_ID
- 2 replies
-
- node.js
- steam-tradeoffer-manager
-
(and 1 more)
Tagged with:
-
const SteamUser = require('steam-user');const SteamTotp = require('steam-totp');const SteamCommunity = require('steamcommunity');const TradeOfferManager = require('steam-tradeoffer-manager'); const client = new SteamUser();const community = new SteamCommunity();const manager = new TradeOfferManager({ steam: client, community: community, language: 'en'}); const logInOptions = { accountName: "........", password: "...........", twoFactorCode: SteamTotp.generateAuthCode("............")}; client.logOn(logInOptions); client.on('loggedOn', () => { console.log('logged on');client.setPersona(SteamUser.EPersonaState.Online, "bot1");client.gamesPlayed(570);});client.on('webSession', (sid, cookies) => {console.log(cookies); manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, "............"); mytrade();}); manager.on('newOffer', offer => { console.log('offer detected'); if (offer.partner.getSteamID64() === '.............') { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(status); } }) } else { console.log('unknown sender'); offer.decline(err => { if (err) { console.log(err); } else { console.log('trade from stranger declined'); } }); }}); function mytrade() {manager.getOfferToken((err, token) => {if (err) {console.log("gsfgfasy", err)}else {var partner="id........"const offer = manager.createOffer('id.....',token);manager.getUserInventoryContents(partner,570, 2, true, (err, myInv) => {if (err) {console.log(err);} else {console.log("myenv",myInv[0]);// myInv.forEach(function(item) {offer.addTheirItem(myInv[0]);offer.setMessage('You received a floral shirt!');offer.send((err, status) => {if (err) {console.log(err);} else {console.log('trade sent');console.log(status);}}) // })}}) }})}
- 1 reply
-
- node.js
- node-steam-tradeoffer-manager
- (and 3 more)
-
Is there a module to confirm sell orders on mobile, I have over 25k+ items that I want to sell and I haven't found a module to confirm mobile orders.
- 3 replies
-
- nodejs
- steamcommunity
-
(and 2 more)
Tagged with:
-
So, I don't know if this is the right section for this thread, but it is tied to steamcommunity... Basically, I'm not using node-steamcommunity because I almost completely developed my app (a Chrome extension) before discovering that it existed. Also I didn't use Node.js... I'm here to ask you if you know of any way to check if a user's session has expired without calling, for example, the user's profile page and checking if you get redirected to the login page. This is how I'm doing it right now but Google doesn't like it because it thinks I'm loading scripts from an external resource (since the call returns HTML). All the steamcommunity.com endpoints I found just return error 400 if the session has expired, which isn't reliable enough. I beg for your help >_> thank you. edit: Welp, Google accepted my code... I don't need this anymore...