Jump to content
McKay Development

Search the Community

Showing results for tags 'Node.js'.

  • 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. var offer = manager.createOffer(partnerId);offer.getUserDetails(function (err, them) {if(err){console.log(`Error getting trade info of partnerId; ${partnerId}\nerr:${err}`);}else{console.log(them.escrowDays);console.log(them.contexts);}}); Before I want to send an offer, I want to check the partner inventory. what will console.log(them.contexts); print? I can't test it because my bot account can't trade till 15 days are passed. Does it just print the contexts of the games that the partner have? If this is the case, is manager.getUserInventoryContents the way to get trade?
  2. How can i make my program have a one time login so user doesn't have to login every time? I originally tried just saving login details in a .json file but then realized would still have to enter steam guard code since there was to shared secret. Is there a way to get shared secret not through sda?
  3. I do not understand how to reset the value. I want it to be reset after how the value was shown in the console. client.on("newItems", function(count) { if (parseInt(count) > 0) { console.log("New items: " + count); // RESET } });
  4. Hello i use this code community.postGroupAnnouncement("103582791463279214", title, msg, (err) => { if (err) { console.log("Error while posting announcement. Error " + err); } console.log("Posted announcement!"); console.log(" - Title: " + title); console.log(" - Message: " + msg); client.chatMessage(steamID, "hadi kapı orda yürü."); }); i not get any error or warn. But not sended announcement please help me
  5. Solution for getting appOwnershipChached apps' name instead of appid. I got config.default_apps by using an empty Steam account to get the numerical list of apps each account has by default and on that line I compare that default list to the list of the fetched user account which might have some games and then filter to remove the default apps. //get GAME LIST client.on('appOwnershipCached', async() => { try { const appIDs = await client.getOwnedApps() let gameList = appIDs.filter((game) => { // remove default apps from list return !config.default_apps.includes(game) }) const appDetails = await client.getProductInfo(gameList, []) let appData = appDetails.apps let arr = await Object.keys(appData).map(key => { // convert list to array return appData[key] }) let cleanGameList = [] await arr.forEach(app => { // push only app names into array if (app.appinfo.common !== undefined) { // necessary only .common since .common.name gives TypeError cleanGameList.push(app.appinfo.common.name) } }) log(cleanGameList) } catch(err) { log(err) } }) Well, I've been trying/searching different things for hours now without any sufficient results. I am trying to get the name of the app/game instead of the appid number via appOwnershipCached. I am actually trying to get the games in the users account instead of also apps and default apps that come with a Steam account. I managed to get the names with an npm package called appid, but it takes a while until it converts all of them since it's fetching it from Steam API, so unfortunately it's not an option and I've run out. So I have two questions: Is there a way to get an apps' name instead of appid? Is there a way to get only the games without apps and default apps? Edit: I actually managed to filter it to the point until I get only the games in my library. I basically filter default apps from the appOwnershipCached fetch of appIDs and then if the appID has a name, it puts it into the gameList array. But the problem is, some games seem not to have names, why is that? For example: Rocket League only has { appid: '252590', public_only: '1' } on .appinfo... OLD NOT WORKING //get GAME LIST client.on('appOwnershipCached', async() => { try { const appIDs = await client.getOwnedApps() log(appIDs) let gameList = appIDs.filter((game) => { return !config.default_apps.includes(game) }) log(gameList) accountData.games = await gameList // log("my games: " + accountData.games) const appDetails = await client.getProductInfo(gameList, []) // ROCKET LEAGUE TEST const rl = await client.getProductInfo([252590], []) log(rl.apps[252590].appinfo) // let appData = appDetails.apps // log(appData) let arr = await Object.keys(appData).map(key => { return appData[key] }) // log(arr) let cleanGameList = [] await arr.forEach(app => { if (app.appinfo.common.name != null) { // log(app.appinfo.common.name) console.log("list: ", cleanGameList) return cleanGameList.push(app.appinfo.common.name) } }) } catch(err) { log(err) } })
  6. I want to someone type my bot !selltf, his sell max 15 sets per game how can i do that? My Code; Inventory.prototype.getCustomerSets = function(ignore, sid64, callback, permit){ let self=this; this.community.getUserInventoryContents(sid64, 753, 6, true, (err, items) => { if(err){ callback(err); } else { items = items.filter(item => { if(item.getTag("item_class").internal_name == "item_class_2" && item.getTag("cardborder").internal_name == "cardborder_0"){ return item; } }); let customer_sets=[], customer_cards={}; items.forEach( card => { const appid=card.market_hash_name.split("-")[0]; if(!customer_cards[appid]){customer_cards[appid]={};} if(!customer_cards[appid][card.market_hash_name]){customer_cards[appid][card.market_hash_name]=[];} customer_cards[appid][card.market_hash_name].push(card); }); for(let appid in customer_cards){ if(self.card_db[appid]){ if(Object.keys(customer_cards[appid]).length == self.card_db[appid]){ let customerHave = Math.min.apply( Math, values(customer_cards[appid]).map( card => card.length ) ), botHave = self.AvailableSets[appid] ? self.AvailableSets[appid].length : 0, limit = permit ? (self.maxStock+permit) : self.maxStock, falt = limit-botHave; customerHave = !ignore ? ( (falt > 0) ? ( Math.min( ...[ falt, customerHave ] ) ) : 0 ) : customerHave; for (let i=0;i<customerHave;i++) { let currentCustomerSet=[] for(let card in customer_cards[appid]){ currentCustomerSet.push(customer_cards[appid][card][i]); } customer_sets.push(currentCustomerSet); } } } else { self.getAppIdCount(appid); } } callback(null, customer_sets); } }); }
  7. Hi im looking for a sample code to extract steam ids from a gameserver
  8. Previously, everything worked and remained. now does not want to save the file. rememberPassword is on
  9. Guest

    user using phone

    Hi, how can i know that user online by phone ? Can i know it using event "user" ?
  10. now,i use this ways, first accept all offer, then i send a message to my bot ,to confirm i want offer if (message.indexOf("@confirm") >=0) { if (steamID == Config.admin) { community.acceptConfirmationForObject(Config.identity, message.replace("@confirm ",""), function(err){ if(err){ console.log(' Cant confirmed the offer. Please try again later'); client.chatMessage(Config.admin, "HI admin: Cant confirmed the offer"); } else { console.log(' Succesfully confirmed the offer.'); client.chatMessage(Config.admin, "HI admin: Offer was successful"); } }); } } now how can i send a message to make my bot accept offer or decline offer? may be i can accept all offer and then i send confirm message to finish i want trade and every 2hours decline all offer to decline i needn't offer please help
  11. Hey there, I'm such a newbie in steambot coding. The main objective of the code would be that the bot should request a cs:go / tf2 key from a user who sends the command "!order" via trade offers. My current state is that the bot creates the offer but there's always an error because I get the error: "Cannot send an empty trade offer." Is there anything which I'm too blind to see? Thanks in advance! My code: function checkKeys(steamID) { var theirKeys = []; var amountOfKeysToAdd = 1; manager.getUserInventoryContents(steamID, config.keysFromCSGO && config.keysFromTF2, 2, true, function(err, inventory) { if (err) { console.log('Error getting user inventory.'.red); } else { console.log('Checking if user has CS:GO or TF2 keys.'.green); for (var n = 0; n < inventory.length; n++) { if(theirKeys.length < amountOfKeysToAdd && config.acceptedKeys.indexOf(inventory[n].market_hash_name) >= 0) { theirKeys.push(inventory[n]); console.log(inventory[n].market_hash_name); } } console.log('User has' + theirKeys.length + 'key(s).'); } }); } function sendOffer(sender) { let theirKeys = []; var offer = (manager.createOffer(sender.getSteamID64())); offer.addTheirItems(theirKeys); offer.send ((err, status) => { if (err) { console.log('There was an error sending the offer.'.red + err); } else { console.log('An offer has been sent.'.green); console.log(status); } }); } client.on('friendMessage', (sender, message) => { if (message === "!start") { client.chatMessage(sender, config.startMessage); } else if (message === "!owner") { client.chatMessage(sender, config.ownerMessage); } else if (message === "!help") { client.chatMessage(sender, config.helpMessage); } else if (message === "!order") { client.chatMessage(sender, config.orderMessage); client.chatMessage(sender, 'Processing your request....'); checkKeys(sender); console.log('Creating offer...'.cyan); sendOffer(sender); } else if (message === "!proof") { client.chatMessage(sender, config.proofMessage); } });
  12. Hello, I'm using only 'node-steam-user' library and sometimes (randomly, not only during Tuesday maintenance) my script is crashing when I'm doing 'client.webLogOn();' (I'm doing it in intervals to keep my session alive - just in case every 30 minutes) sometimes I'm getting this error (very rare case): /node_modules/steam-user/components/web.js:10 throw new Error("Cannot log onto steamcommunity.com without first being connected to Steam network"); is there any method that instead of crashing app I can try to login account again with 'client.logOn'? because I don't want to check my VPS if script got crashed or no (I want to run it constantly without worring that something crashed there) something with try, catch method?
  13. Hello Error: Must be logged in before trying to do anything with confirmations I get this error when executing code in BAS (Browser Automation Studio) [[IDENTITY_SECRET]] = JSON.parse([[FILE_CONTENT]]).identity_secret var SteamTotp = require('steam-totp'); [[code2]] = SteamTotp.generateConfirmationKey([[IDENTITY_SECRET]]); [[code3]] = SteamTotp.getConfirmationKey([[code2]]); [[TIME]] = SteamTotp.time([[timeOffset]]); var SteamCommunity = require('steamcommunity'); var community = new SteamCommunity(); var Steam = require('steam-client'); var client = new Steam.CMClient(Steam.EConnectionProtocol.TCP); var TradeOfferManager = require('steam-tradeoffer-manager'); var manager = new TradeOfferManager(); client.on('webSession', (sessionID, cookies) => { manager.setCookies(cookies, function (err) { if (err) { logger.error(err) //игнор.прав process.exit(1); } }); community.setCookies(cookies); community.startConfirmationChecker(10000, [[code3]]); }); var time = [[TIME]]; var confKey = [[code3]]; var allowKey = [[code3]]; community.acceptAllConfirmations(time, confKey, allowKey, function(err, confs){ if(err){ res.sendError(err); return; } if(confs == null) confs = []; res.sendSuccess(confs); });
  14. I do wonder if it's possible to interact with the workshop.
  15. Hello, I am using latest verision of steam-user 4.12.2 i am trying to use the new steam chat features /pre, /code, /quote etc So i have already tried alot and i found that only /me works no others if i create a message for example "/quote Processing your request" so the bot replies with plain text "/quote Processing your request" Thanks in advance
  16. I want to create bot with automatic sending spesific trading card with spesific input //the conversation A: !badges 570 2 BOT: Sending 2sets of Dota 2 A: !badges 440 5 BOT: Sending 5sets of Team Fortress 2 //my spesific input ... client.on("friendMessage", function(steamID, message) { var msg; if (steamID == account.owner){ ... else if (msg = message.match(/^!badges(\d+) (\d+))) { var appID = msg[1]; var count = msg[2]; client.chatMessage(steamID, "..."); } } else{ ... } ... Can anyone help me to get the code?
  17. Hi, if someone can help me out with this i dont rl know how to build this and i created such a mess here with all of this code... I tryed to search up everywhere and i cant find similar problem... I have prices database in database.json file witch bot loads and then u can acces to !prices <item name>, similar to that i created !buy <item name> command witch is triggered when user insert name of item witch exist in database.json and in bots inventory(inventory.json)... After that bot needs to create offer with this items witch are selected...There i start having some issues. Down is my messed code if someone can explain what im doing wrong, and how i can make trade offer with selected items for price thats inside of database by chat command ? } else if (command === "!buy" && itemName) { const database = JSON.parse(fs.readFileSync('./database.json', 'utf8')); if(database[itemName]) { const buyPrice = database[itemName].sell; const sellPrice = database[itemName].sell.metal let offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=12345678&token=xxxxxxxx"); let t = manager.createOffer(steamID.getSteamID64()); t.getUserDetails((ERR, ME, THEM) => { if (ERR) { console.log("## An error occurred while getting trade holds: " + ERR); client.chatMessage(steamID, "An error occurred while getting your trade holds. Please try again"); } else if (ME.escrowDays == 0 && THEM.escrowDays == 0) { client.chatMessage(steamID, "Processing your request."); manager.getUserInventoryContents(steamID.getSteamID64(), 440, 2, true, (ERR, INV, CURR) => { offer.addTheirItems(INV); offer.addMyItems(INV); var MyItems = require(`./Inventory.JSON`); offer.send(function(err, status) { }, client.chatMessage(steamID, "Prepairing offer...")); if (ETradeOfferState == 12) { console.log(`Offer #${offer.id} sent, but requires confirmation`); community.acceptConfirmationForObject("identitySecret", offer.id, function(err) { if (err) { console.log(err); } else { console.log("Offer confirmed"); } }); } else { console.log(`Offer #${offer.id} sent successfully`); client.chatMessage(steamID, `Trade offer created ! [ offer ID: ${offer.id} ]`); } if (ERR) { console.log("## An error occurred while getting inventory: " + ERR); client.chatMessage(steamID, "An error occurred while loading your inventory. Please try later, or check if your inventory isnt on private ! \n If is that not case error is caused by Steam servers witch seems to be offline... \n Try to sent offer with up given price at link:\n https://steamcommunity.com/tradeoffer/new/?partner=xxxxxxxx "); } }); } });
  18. I have application on node it has steam-bots and socket.io server, during initialization bots they receive an instance socket.io and send to the admin panel requests about the status of trades When I need to update the server's socket.io code, I have to restart the application completely. How to make the bots not reboot when changing the server's socket.io code? Or - how can I organize data exchange between two nodejs applications?
  19. Hello, for some reason I can't login on any Steam accounts. — Node.js version: 12.4.0 / 8.16.0 node-steam-user version: 4.12.2 — Debug log (first part, then it repeat immediately inf. amount of times): Connecting to TCP CM: 155.133.230.34:27019 TCP connection established Handled message: ChannelEncryptRequest Channel encrypt request: protocol 1, universe 1, nonce 2c1378e10fb52fd105a21685874390d8, 0 remaining bytes Sending message: ChannelEncryptResponse Handled message: ChannelEncryptResult Sending message: ClientLogon Handled message: ClientLogOnResponse Log on response: TryAnotherCM Code: console.log('> Loading, please wait.') const SteamUser = require('steam-user') const client = new SteamUser() const logOnOptions = { accountName: '***', password: '***', } console.log('> Loaded, logging in.') client.logOn(logOnOptions) client.on('loggedOn', () => { console.log('> Logged into Steam.') client.setPersona(SteamUser.Steam.EPersonaState.Online, 'aeonix.space') client.gamesPlayed('Idling', 730) }) client.on('debug', console.log)
  20. Hi, I'm trying to make my bot work but I have the following error: C:\Users\Admin\Desktop\123456789\SteamCardBot-master\index.js:91 console.log("## Logged in as #" + client.steamID + " (" + personas[client.steamID].player_name + ")"); ^ TypeError: Cannot read property '[object Object]' of null at client.getPersonas (C:\Users\Admin\Desktop\123456789\SteamCardBot-master\index.js:91:75) at Immediate.setImmediate (C:\Users\Admin\node_modules\@doctormckay\stdlib\components\promises.js:24:6) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5) What am i missing? I've thislet client = new SteamUser(),manager = new TradeOfferManager({"steam": client,"language": "en","pollInterval": "10000","cancelTime": "7200000" // 2 hours in ms}),community = new SteamCommunity(); This is the logg client.logOn({accountName: CONFIG.USERNAME,password: CONFIG.PASSWORD,twoFactorCode: SteamTotp.getAuthCode(CONFIG.SHAREDSECRET),rememberPassword: true}); client.on("loggedOn", (details, parental) => {client.getPersonas([client.steamID], (personas) => {console.log("## Logged in as #" + client.steamID + " (" + personas[client.steamID].player_name + ")");});client.setPersona(1);}); client.on("webSession", (sessionID, cookies) => {manager.setCookies(cookies, (ERR) => {if (ERR) {console.log("## An error occurred while setting cookies.");} else {console.log("## Websession created and cookies set.");}});
  21. Hello. I tried to log in to your account through the library Steam. I get a link to unreadable captcha. Captcha example: https://imgur.com/a/Wf0K5wU Link I've received: https://steamcommunity.com/login/rendercaptcha/?gid=2364870837474478762
  22. Hi, getting error when user change state TypeError: Cannot set property 'rich_presence' of undefined at node_modules/steam-user/components/friends.js:724 at processTicksAndRejections (internal/process/task_queues.js:86)
  23. Hello guys i began to create a programm and i want to send messages any friend through api. I found https://api.steampowered.com/ISteamWebUserPresenceOAuth/Logon/v0001 and pass access_token - https://steamcommunity.com/dev/managegameservers and dev api key and i get an answer UnauthorizedAccess is denied. Retrying will not help. Please verify yourkey=parameter. What is that problem? How i can fix that? Help pls!
×
×
  • Create New...