Jump to content
McKay Development

Search the Community

Showing results for tags 'node-steamcommunity'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Announcements
    • Releases & Updates
  • Help & Support
    • General
    • Guides
    • node-steam-user
    • node-steamcommunity
    • node-steam-tradeoffer-manager
    • node-steam-session

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Location


Interests

  1. Please change your loadUserInventory function like this https://www.reddit.com/r/SteamBot/comments/5he94k/psa_there_is_a_new_endpoint_for_fetching_user/
  2. I'm writing a SteamBot to send offers to different accounts and to automatically confirm these offers after this. But I'm getting 'Error: Could not act on confirmation' when trying to respond to every confirmation. Can you suggest what am I doing wrong? Here is how I'm using steamcommunity (I'm using babel to transpile all of this into ES5): class SteamBot { // this class has a login function, which logs bot in, // and also some fields like 'shared' and 'identity' // this.community is a SteamCommunity object confirmAll() { return new Promise((res, rej) => { const time = Math.floor(Date.now() / 1000) const key = SteamTotp.getConfirmationKey(this.identity, time, 'conf') this.community.getConfirmations(time, key, async (err, confirmations) => { if (err) return rej(err) log(confirmations.map(JSON.stringify).join(', ')) // just for debugging for (let confirmation of confirmations) { try { const confirmRes = await this.confirmConfirmation(confirmation) log(`Confirmed ${confirmation.creator}`, true, true) } catch (e) { log(`Confirmation failed: ${e}`, true, true) return rej(e) } } return res(confirmations) }); }) } confirmConfirmation(confirmation) { return new Promise((res, rej) => { const time = Math.floor(Date.now() / 1000) const key = SteamTotp.getConfirmationKey(this.identity, time, 'allow') console.log(this.identity) // for debugging purposes console.log(confirmation) // also for this confirmation.respond(time, key, true, (err) => { if (err) return rej(err) return res() }) }) } constructor(login, password, shared, identity) { this.login = login this.password = password this.shared = shared this.identity = identity this.loginBot() // logging in, not necessary for now, since it's working okay } } var bot = new SteamBot(login, password, shared, identity) // and after logging in and sending tradeoffer, I'm trying to do this: bot.confirmAll()I've tried to send offer to my other account and to confirm it immediately, and after that call bot.confirmAll(). It shows that I have confirmations, but when I try to respond to them, it shows an error: 'Could not act on confirmation'. I'm pretty sure that I'm using the right identity_secret (since I've used it with startConfirmationChecker() and everything worked fine, also I console.log()'ed it inside a function just to make sure it's the right one and yes, it's the right one). I'm not sure what I did wrong, I've seen an example that worked pretty much the same (well, without Promises and ES6 stuff, but still), so if you know what could I do wrong, can you suggest me? Thanks in advance.
  3. Hi. I have bot and everything was fine until yesterday. This code is never called community.on('confKeyNeeded', function (tag, callback) { console.log("generirane na kluch"); callback(null, time, SteamTotp.getConfirmationKey(account.identity_secret, time(), tag));}); community.on('newConfirmation', function (confirmation) { console.log("doide nova oferta"); var time = time(); var key = SteamTotp.getConfirmationKey(account.identity_secret, time, 'allow'); confirmation.respond(time, key, true, function (err) { if (err) { console.log("neshto stana s ofertata" + err); return; } });}); This is my login function login(err, sessionID, cookies, steamguard) { if (err) { if (err.message == "SteamGuardMobile") { account.twoFactorCode = SteamTotp.generateAuthCode(account.shared_secret); setTimeout(function () { community.login(account, login); }, 5000); return; } process.exit(0); } account.sessionID = sessionID; account.cookies = cookies; community.getWebApiKey('website.com', webApiKey); community.startConfirmationChecker(60000, account.identity_secret); console.log("startira logina ama nakraq debug" + account.identity_secret);} I change limit to 60000 and same problem. Anyone know if steam changed something ?
  4. Can I get sticker name by value or float_value { "defindex": 113, "value": 1063, "float_value": 1.4895802675772805e-042 } in GetPlayerItems? I found this: "1063" { "name" "columbus2016_team_fntc" "item_name" "#StickerKit_columbus2016_team_fntc" "description_string" "#StickerKit_desc_columbus2016_team_fntc" "sticker_material" "columbus2016/fntc" "item_rarity" "rare" "tournament_event_id" "9" "tournament_team_id" "6" } But in this API has no name and no image of the sticker
  5. Getting a error when trying to execute this code: community.httpRequestPost('https://steamcommunity.com/market/sellitem/', { form: { sessionid: community.getSessionID(), appid: item.appid, contextid: item.contextid, assetid: item.assetid, amount: 1, price: 10000 // 10000 == $100 }, headers: headers, json: true }, (err, response, json) => { if(err) { console.log(`Sell item HTTPREQUESTPOST error: ${err.toString()}`); return; } console.log(json); }, "steamcommunity"); My headers are: 'Host': 'steamcommunity.com','Origin': 'https://steamcommunity.com''Referer': 'https://steamcommunity.com/market/''User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36','X-Prototype-Version': '1.7','X-Requested-With': 'XMLHttpRequest', Cookies: (first 4 getting from node-steam-tradeoffer-manager)steamLoginsteamLoginSecuresteamMachineAuthsessionidwebTradeEligibility (from your's reddit post)strInventoryLastContext=730_2Steam_Language=english I've tried to do request from REST Client with client's account cookies, headers, and it works (from client, not from node).
  6. Hi, i have a problem with GetConfirmations community.getConfirmations(SteamTotp.time(), SteamTotp.getConfirmationKey("DF+rFxd2PGEWUAXqPtXcNsISI9E=", SteamTotp.time(), "conf"), function(err, confirmations) { confirmations.forEach(function(confirmation) { console.log(confirmation); }); }); ?
  7. http://steamcommunity.com/app/{gameID}/tradingforum/ or http://steamcommunity.com/app/{gameID}/tradingforum/{postID}And i need there to edit a Thread. I can not find such a function. Can you help me ?
  8. I checked everything and tried but failed. How to automatic click Sign in in screenshot. I have link but need to make bot auto click that Sign in button. Screenshot: http://prnt.sc/d11i77 EDIT : I did it with Selenium Webdriver.
  9. I have two questions 1- How to login a non-steam website with steam cookies. I want to auto login bet site. 2- How to use steamuser with steamcommunity sametime.
  10. Hey there, i am using your steam-community node.js module. I am a trying to post a group comment. Since that function not yet is implemented in steam-community i tried to figure it out myself. On reddit i got this answer: Oops, my bad. I haven't seen this implemented anywhere but here are the details: URL: POST http://steamcommunity.com/comment/Clan/post/<GROUPID64>/-1/ Data: comment=<Actual comment text> count=6 sessionid=<sessionid that matches your cookie> However, i cant fingure out how to implement it. I tried to add this to groups.js: SteamCommunity.prototype.postGroupComment = function(gid, content, callback) {if(typeof gid === 'string') {gid = new SteamID(gid);} var self = this;this.httpRequestPost({"uri": "https://steamcommunity.com/comment/Clan/post/"+ gid.getSteamID64() + "/-1/", "form": {"sessionID": this.getSessionID(),"comment": content,"count": 6}}, function(err, response, body) {if(!callback) {return;} callback(err || null);}, "steamcommunity");}; Calling it like community.postGroupComment("gid", "Test"); However, steam just returns success: false. Could you help me or implement group comments in your steam-community? Thank you.
  11. i already binded it to steam-users and now i use the cookies from it in steamcommunity. if i try to bind the ip to steamcommunity i get an error that community.Constructor is not a function. community.Constructor({localAddress: ip}); https://github.com/DoctorMcKay/node-steamcommunity/wiki/SteamCommunity#constructoroptions anyone can help me?
  12. Hello, my bot sends the exchange, but does not confirm it. Please help me. Fasten code below. var SteamUser = require('steam-user'); var SteamCommunity = require('steamcommunity'); var SteamTotp = require('steam-totp'); var TradeOfferManager = require('steam-tradeoffer-manager'); var fs = require('fs'); var request = require('request'); var async = require('async'); var client = new SteamUser({ "dataDirectory": null }); var manager = new TradeOfferManager({ "steam": client, "domain": "site.ru", "language": "ru" }); var community = new SteamCommunity(); var steamID = SteamCommunity.SteamID; if(fs.existsSync('./users/users.json') && fs.existsSync('./users/master_ssfn')) { var users = JSON.parse(fs.readFileSync('./users/users.json')); var sentry = fs.readFileSync('./users/master_ssfn'); } else { console.log("Users file or master ssfn missing. Exiting.."); process.exit(1); } var user = users.thor; var logOnOptions = { "accountName": user.accountName, "password": user.password, "twoFactorCode": SteamTotp.getAuthCode(user.twoFactorCode) }; if(fs.existsSync('./polls/' + user.accountName + '.json')) { manager.pollData = JSON.parse(fs.readFileSync('./polls/' + user.accountName + '.json')); } client.setSentry(sentry); client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam account " + user.accountName); }); client.on('webSession', function(sessionID, cookies) { manager.setCookies(cookies, function(err) { if(err) { console.log(err); process.exit(1); return; } console.log("Got API key: " + manager.apiKey + " for user " + user.accountName); }); community.setCookies(cookies); community.startConfirmationChecker(10000, user.identitySecret); // Checks and accepts confirmations every 30 seconds client.setPersona(SteamUser.Steam.EPersonaState.Online, user.personaName); sessionInterval(3600000); }); manager.on('newOffer', function(offer) { var steamID64 = offer.partner.getSteamID64(); console.log('Received new offer from ' + steamID64); if(steamID64 == "steamID") { offer.accept(); } else { offer.decline(); } }); manager.on('sentOfferChanged', function(offer, oldState) { var offerTradeId = offer.id; var state = offer.state; console.log('Offer.Changed: ', offerTradeId + " is now " + state); request({ "url": "http://site/steam/set-offer-state/" + offerTradeId + "/" + state }); }); manager.on('pollData', function(pollData) { fs.writeFile('./polls/' + user.accountName + '.json', JSON.stringify(pollData)); }); function sessionInterval(time) { setTimeout(function() { console.log('Getting new cookies.'); client.webLogOn(); }, time); } /** * Express API to access SteamBot features and functions */ var express = require('express'); var app = express(); var bodyParser = require('body-parser'); app.use(bodyParser.json()); // for parsing application/json app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded app.get('/', function(req, res) { res.send('"Иди в дом, там мама тебе нальёт томатного." - Энди Картрайт'); }); app.post('/MakePlayerExchange/:steamid', function(req, res) { var user = new steamID(req.params.steamid); var bot = new steamID(req.body['botsteamid']); var token = req.body['token']; var uItems = req.body['userItems']; var bItems = req.body['botItems']; manager.getEscrowDuration(user, token, function(err, him, me) { if( err) { res.json({ "error": err }); return; } if( ! (him == 0 && me == 0)) { res.json({ "error": "Escrow Error. User has not enabled 2FA." }); return; } async.parallel({ userInventory: function(callback) { manager.loadUserInventory(user, 730, 2, true, function(err, inventory) { if( err) { callback(err); } else { callback(null, inventory); } }); }, botInventory: function(callback) { manager.loadUserInventory(bot, 730, 2, true, function(err, inventory) { if( err) { callback(err); } else { callback(null, inventory); } }); } }, function(err, results) { if( err) { res.json({ "error": err }); return; } var Exchange = manager.createOffer(user); var Message = "Site.ru | Thank You for trading with us. Here's your items from the Exchange page. This offer expires in 10 minutes."; var ExchangeUser = GetExchangeItems(results.userInventory, uItems); var ExchangeBot = GetExchangeItems(results.botInventory, bItems); if(typeof ExchangeUser.error != "undefined") { res.json(ExchangeUser); return; } if(typeof ExchangeBot.error != "undefined") { res.json(ExchangeBot); return; } Exchange.addTheirItems(ExchangeUser); Exchange.addMyItems(ExchangeBot); Exchange.send(Message, token, function(err, status) { if( err) { res.json({ "error": err }); return; } console.log('Exchange send: ', status); console.log('Exchange Offer ID: ', Exchange.id); res.json({ "offer": Exchange.id, "status": status, "state": Exchange.state }); }); }); }); }); function GetExchangeItems(Inventory, Items) { var ReturnItems = []; var i; for(i in Items) { var Item = i; var Count = +Items[i]; var j; for(j in Inventory) { var invItem = Inventory[j]; if(invItem.market_hash_name == Item) { //console.log('Should push here: ', invItem.classid); ReturnItems.push(invItem); Count--; } //console.log(invItem.market_hash_name, Count); if(Count == 0) { break; } } if(Count > 0) { return { "error": "Not enough Items in Inventory. Missing: " + Item + ", need " + Count + " more. Only got " + (+Items[i] - Count) }; break; } } //console.log(ReturnItems); return ReturnItems; }
  13. Hello, could you look here? It's seems to be right, but it doesn't conferm trades automaticaly var SteamUser = require('steam-user'); var SteamCommunity = require('steamcommunity'); var SteamTotp = require('steam-totp'); var TradeOfferManager = require('../lib/index.js'); // use require('steam-tradeoffer-manager') in production var fs = require('fs'); var client = new SteamUser(); var offers = new TradeOfferManager({ "steam": client, // Polling every 30 seconds is fine since we get notifications from Steam "domain": "example.com", // Our domain is example.com "language": "en" // We want English item descriptions }); var community = new SteamCommunity(); var logOnOptions = { "accountName": "*****", "password": "***", "twoFactorCode": SteamTotp.getAuthCode("****") }; if (fs.existsSync('polldata.json')) { offers.pollData = JSON.parse(fs.readFileSync('polldata.json')); } client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam"); }); client.on('webSession', function(sessionID, cookies) { offers.setCookies(cookies, function(err) { if (err) { console.log(err); process.exit(1); // Fatal error since we couldn't get our API key return; } console.log("Got API key: " + offers.apiKey); }); var trade = offers.createOffer("76561197982243076"); offers.loadInventory(570, 2, true, function(err, myItems) { if(err) { console.log(err); return; } trade.loadPartnerInventory(570, 2, function(err, theirItems) { if(err) { console.log(err); return; } trade.addMyItem(myItems[0]); //trade.addMyItem({"appid": "570","contextid": "2", "assetid": "994253688" }); trade.addTheirItem(theirItems[0]); trade.send(function(err, status) { if (err) { console.log("send" + err); } else { console.log("Offer #" + trade.id + " " + status) } }); }); }); community.setCookies(cookies); community.startConfirmationChecker(30000, "identitySecret"); }); And could you say, how bot can get assetid of item because than I use "id" from http://steamcommunity.com/profiles/76561198106184535/inventory/570/2 it brings error(26)
  14. I consider that error 504 when I use function acceptConfirmationForObject like an error 16 on newOffer and sometimes this offer is accepted. Can I track this offer with event unknownOfferSent and decline it?
  15. Hi there. Im developing steam trade-bot but i have one issue during mothes. I need to reboot my server manually because after 1-3 days i got "Error malformed response" or smth like this. I got my code sample, can u say me whats wrong? i'm tired of this var client = new SteamUser; var steam = new SteamCommunity(); var community = steam; // alias var app = express(); app.listen(app_settings.port, function () { console.log('App is running on ' + app_settings.port); }); var logOnOptions = credentials.getDefault(); client.logOn(logOnOptions); client.on('webSession', function(sessionID, cookies) { community.setCookies(cookies); manager.setCookies(cookies); community.startConfirmationChecker('10000', app_settings.identity_secret); }); client.on('disconnected', function(){ setTimeout(function(){ var logOnOptions = credentials.getDefault(); client.webLogOn(logOnOptions); }, 10000); }); community.on('sessionExpired', function(err) { var logOnOptions = credentials.getDefault(); community.login(logOnOptions, function(err, sessionID, cookies, steamguard){ if (err) { console.log("There was an error logging in! Error details: " + err.message); process.exit(1); //terminates program } else { console.log("Successfully logged in as " + logOnOptions.accountName); steam.chatLogon(); manager.setCookies(cookies, function(err) { if (err) { console.log(err); process.exit(1); } }); } }); });
  16. at least since 24 hours the mobile confirmations not working anymore. was there an steam update which has destroyed your plugin functionality? or are the steam servers are just broken and steam don't care about it? i found more people with the same problem, who saying it is just showing "Invalid session errors": https://www.reddit.com/r/SteamBot/comments/51x5ty/question_current_trade_status/ the website https://steamstat.us/ is switching the whole day between "normal" and "100.0% Failed Trades" as well.
  17. I can easily get the amount that the item is sold in the last hour, but how in the last 24 hours? Like it does on steam. I am happy to do restful calls or anything else
  18. I use code from topic "Minimal code to stay logged in forever..." to stay online. It's working perfectly, but bot keep disconnecting from chat after a while. I tried use "chatLogoff()" on sessionExpired - not working. Setting chatLogon interval to 4000 - not working. chatLogOnFailed event not triggering. Any advice to fix this ? Edit: I tested after "chatLogoff()" bot cannot go online in chat with chatLogon(). Am I doing something wrong ?
  19. Essentially it appears `p` in the query string in /inventoryhistory is blacklisted and will unconditionally error out. Just with this hilariously enough. ?foobar22=1 is fine. It looks like they're doing something more or less like primary key-based paging now with after_time and after_trade. Which must be interesting on their end sorting-wise. Also the pagination stat regexps are no longer valid because they apparently no longer exist as such. So fix-wise I guess remove the regexp lines and avoid using the properties. Also remove "&p=" + options.page from inventoryhistory.js. These things appear to be the only breaking changes. No actual markup changed beyond that inner text. Which was nice of them I suppose. Overall an interesting strategy of load reduction on Valve's part. I must say.
  20. I have spent some time checking the node-steamcommunity GitHub wiki, and first of all : Dr. McKay, you are a hero for building up such an easy npm interface for the messy Steam API... I came up with some code to make sure I'm logged in almost 24/7 : // Modules are required and secret stuff is ready... function logOnSteam() { console.log("Logging in to Steam..."); steamCommunity.login(logOnOptions, function (e, sessionID, cookies, steamguard) { if (e) { console.log("There was an error logging in ! Error details : " + e.message); setTimeout(logOnSteam, 1000*60*4); // try to reconnect in 4 minutes return; } else { console.log("Successfully logged in as " + logOnOptions.accountName + " !"); steamCommunity.chatLogon(); // to appear online tradeOfferManager.setCookies(cookies, function (err) { if (err) { console.log(err); return; } }); } // automatic confirmation of EVERYTHING every "confirmationPeriod" ms steamCommunity.startConfirmationChecker(confirmationPeriod, identitySecret); }); } function checkSteamLogged() { steamCommunity.loggedIn( function (err, loggedIn, familyView) { if (err) { console.log(err); setTimeout(checkSteamLogged, 1000*60*4); // check again in 4 min } else if ( ! loggedIn ) { console.log("Steam login check : NOT LOGGED IN !"); logOnSteam(); } else { console.log("Steam login check : already logged in !"); } }); } steamCommunity.on('sessionExpired', function (err) { if (err) {console.log(err);} logOnSteam(); }); logOnSteam(); setInterval(checkSteamLogged, 1000*60*30); I guess this is enough to be safe... (unless I made some rookie mistake ?) This code is obviously the starting point for some TradeOfferManager handling, and I was wondering if I didn't go too far : if the 'sessionExpired' event is really triggered whenever we are not logged in, does it mean the 'checkSteamLogged()' function can be safely removed without harm ?'.startConfirmationChecker()' doesn't create a new instance each time it is called ? (I don't want to trigger 10 confirmations checkers leading to 10 times the intended check rate...)Thanks for any input !
  21. Hi guys! I do not know and where to start. I want to make steam bot. On the Internet, many libraries for this, but I settled on (this) because there is someone to ask. What I have in stock: Steam account, which can make and receive exchange Look like that's it. Questions: To begin, I just want to make the authorization, as I realize it is from my computer via a bot. How can I do it? So as for Steam authentication requests from the phone key. Please help experts!
  22. Is there a full example of a bot that sends trade offers and then confirms using startconfirmationchecker as i always get this error once the method is called. Am i just missing something? https://gyazo.com/a59aa36fed4a641325a926e41ccb890f steamClient.on('logOnResponse', function(logonResp) { if (logonResp.eresult === Steam.EResult.OK) { console.log('Logged in'); steamFriends.setPersonaState(Steam.EPersonaState.Online); steamWebLogOn.webLogOn(function(sessionID, newCookie) { getSteamAPIKey({ sessionID: sessionID, webCookie: newCookie }, function(err, APIKey) { offers.setup({ sessionID: sessionID, webCookie: newCookie, APIKey: APIKey }); fetchtradeurl(); offerItems(); community.startConfirmationChecker(10000, identity_secret); }); }); } });
  23. Hi there. My web-app have ATM about 10k users. It is good idea to use only 1 bot for loadUserInventory on my web app or should I make more bots for this? Regards.
×
×
  • Create New...