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. 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); } });
  2. 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 } });
  3. 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?
  4. I do wonder if it's possible to interact with the workshop.
  5. 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?
  6. 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 "); } }); } });
  7. 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?
  8. 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
  9. 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
  10. 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)
  11. 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.");}});
  12. 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!
  13. 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)
  14. I am new in node js, i start 2 days ago. Is that possible to create multiple specific input message? steam chat a: hello bot: !mymoney, !checkname [gameid] a: !checkname 440 bot: Team Fortress 2 a: !checkname 570 bot: Dota 2 node.js code ..... client.on("friendMessage", function(steamID, message) { if (message == "!mymoney") { client.chatMessage(steamID, duitgw) } else if (message == "!checkname"){ if (message.line2 == "440"){ //like this ..... } else if (message.line2 == notnumber){ //another condition .... } else if (message.line2 == isnt set){ //another condition .... } } else{ client.chatMessage(steamID, "!mymoney, !checkgame [gameid]") } }); ..... edit: i use comment for highlight
  15. This is my question, if somebody can help me I would be grateful!
  16. When working with your library there was a difficulty... How can i promise example here: botInfo = {}; client.logOn(logOnOptions); client.on('wallet', function(hasWallet, currency, balance) { botInfo.balance = balance; }); client.on('emailInfo', function(address, validated) { botInfo.emailAddress = address; botInfo.emailValidated = validated; }); console.log(botInfo); // i want to log data after fill info no one promise don't work....
  17. Guest

    event user not emitted

    Hi. Event "user" not emitted when you accepting friend invite using method client.addFriend, but emitted when user accepting your invite
  18. Hello, I have migrated from SteamKit to node-steam-user to be able to interface with the new steamchat. I had a chatbot that made heavy use of a 'group chat' in order to notify administrators of reports in-game (via a plugin) and provide them with all the info via steam without any other access needed (authorized via steamid, only 'members' can join chat group) I was interested in making use of the chatroom channels feature of the new steam groups to keep everything tidy, however looking over the methods available to me, this is not possible (or I am blind and didnt see it) are there any plans on adding a way to 'create a channel' in a steam group chat? Here is the flow of what I want to do, but currently it looks like there is no way for a bot to 'manipulate' the channels to make this possible. User submits report Bot sees new report in database, creates channel #report-$id Bot notifies online admins of #report-$id Admin(s) investigate report, close report after being handled. Bot closes/deletes channel after timestamp is 24h old.
  19. Hello, I'm new to Node.js progamming and I'm trying to make a Steam gifting bot, that would add people, buy the gift and send it to them. Is it possible to do it using only node-steam-user or do I need more packages? Any threads/tips/documentation would be appreciated.
  20. some user inventories are really big, and the module would be doing lots of requests to steam, so if only a single one request fails, it would have to start all over again, to have a few extra attempts to that specific request if we receive a mailformed response or a common http error would be realy cool
  21. Hi there, I'm using steam-user to try to make a bot, but I cannot get it to set it's status to online. Furthermore, is there a way to check if the login was successful as the loggedOn event appears to trigger even if I try entering bogus account details. Code is as follows: const SteamUser = require ("steam-user");const SteamTotp = require ("steam-totp");const config = require("./config"); const client = new SteamUser();const details = {accountName: config.accountName,password: config.password,twoFactorCode: SteamTotp.generateAuthCode("redacted"),rememberPassword: true}; client.logOn(details); client.on("loggedOn", () => {console.log("signed in");client.setPersona(1);})
  22. Hi all, I am trying to send a game invitation friend message using node-steam-user. I am using sendFriendMessage function with EChatEntryType option established as 3 (InviteGame value at https://github.com/DoctorMcKay/node-steam-user/blob/master/enums/EChatEntryType.js) const SteamUser = require('steam-user'); const client = new SteamUser(); client.chat.sendFriendMessage("steam64Id Here", '[lobbyinvite appid="App Game IdHere" lobbyid="Lobby Id Here"][/lobbyinvite]', {chatEntryType: 3});The result is that there is no invitation sent in steam chat I supposted to fill the message parameter like that because of im getting the lobbies invitation history chat in that format. I saw all node-steam-user docs and i did not found any tutorial or explain about how to use this function with EChatEntryType as InviteGame value. ¿how can i use this function to send a game lobby invitation message to a friend? ¿What data and would be the message parameter format in the function? Thanks in advance,
  23. I was doing some tests in one of my projects that use this module, and i noticed that de polling sometimes requests to much ram, after get further the module in github, the "problem", seems to be that to much information is cached in the LeastUsedCache(), this happens only when there is a that bot account has to many items i suppose.. so having that in mind, i have a question that can possibly lower the ram usage, what if we use a mongoDB or something alike to store that data intead(as an option to implement of course), this would only be useful in some cases like mine, but it might improve a little the ram usage, and also would be possible to store more data for more time if needed.. i could have did it myself and test it to see if is worth it, but i'd rather see you guys thoughts first, and also the possibility of this to be implemented in the module by the @Doctor himself, if the results seems to be good
  24. I cant seem to find a craft-able property in the econ item object can someone point to it in this object bellow, thanks! EconItem {appid: 440, contextid: '2', assetid: '7846925808', classid: '11040732', instanceid: '11040552', amount: 1, missing: false, est_usd: '92', icon_url: 'fWFc82js0fmoRAP-qOIPu5THSWqfSmTELLqcUywGkijVjZULUrsm1j-9xgEYeQocWAndqzBCjM31Mv6NGucF1Yps5MQEjDM6xlF5Y7uwMjQxIlfHVaEOXqNso1rpCnJmuZ5hUIaw8blIOVK4ag0bm_o', icon_url_large: 'fWFc82js0fmoRAP-qOIPu5THSWqfSmTELLqcUywGkijVjZULUrsm1j-9xgEYeQocWAndqzBCjM31Mv6NGucF1Yps5MQEjDM6xlF5Y7uwMjQxIlfHVaEOXqNso1rpCnJmuZ5hUIaw8blIOVK4ag0bm_o', icon_drag_url: '', name: 'Summer Shades', market_hash_name: 'Summer Shades', market_name: 'Summer Shades', name_color: '7D6D00', background_color: '3C352E', type: 'Limited Level 10 Glasses', tradable: true, marketable: true, commodity: false, market_tradable_restriction: 7, market_marketable_restriction: 0, fraudwarnings: [], descriptions: [ { type: 'text', value: 'These are famous.', app_data: '' } ], actions: [ { name: 'Item Wiki Page...', link: 'http://wiki.teamfortress.com/scripts/itemredirect.php?id=486&lang=en_US'}, { name: 'Inspect in Game...', link: 'steam://rungame/440/76561202255233023/+tf_econ_item_preview%20S%owner_steamid%A%assetid%D2327250644315844062' } ], market_actions: [ { name: 'Inspect in Game...', link: 'steam://rungame/440/76561202255233023/+tf_econ_item_preview%20M%listingid%A%assetid%D2327250644315844062' } ], tags: [ { internal_name: 'Unique', name: 'Unique', category: 'Quality', color: '7D6D00', category_name: 'Quality', localized_tag_name: 'Unique', localized_category_name: 'Quality' }, { internal_name: 'misc', name: 'Cosmetic', category: 'Type', category_name: 'Type', localized_tag_name: 'Cosmetic', color: '', localized_category_name: 'Type' }, { internal_name: 'Scout', name: 'Scout', category: 'Class', category_name: 'Class', localized_tag_name: 'Scout', color: '', localized_category_name: 'Class' }, { internal_name: 'Sniper', name: 'Sniper', category: 'Class', category_name: 'Class', localized_tag_name: 'Sniper', color: '', localized_category_name: 'Class' }, { internal_name: 'Soldier', name: 'Soldier', category: 'Class', category_name: 'Class', localized_tag_name: 'Soldier', color: '', localized_category_name: 'Class' }, { internal_name: 'Demoman', name: 'Demoman', category: 'Class', category_name: 'Class', localized_tag_name: 'Demoman', color: '', localized_category_name: 'Class' }, { internal_name: 'Medic', name: 'Medic', category: 'Class', category_name: 'Class', localized_tag_name: 'Medic', color: '', localized_category_name: 'Class' }, { internal_name: 'Heavy', name: 'Heavy', category: 'Class', category_name: 'Class', localized_tag_name: 'Heavy', color: '', localized_category_name: 'Class' }, { internal_name: 'Pyro', name: 'Pyro', category: 'Class', category_name: 'Class', localized_tag_name: 'Pyro', color: '', localized_category_name: 'Class' }, { internal_name: 'Spy', name: 'Spy', category: 'Class', category_name: 'Class', localized_tag_name: 'Spy', color: '', localized_category_name: 'Class' }, { internal_name: 'Engineer', name: 'Engineer', category: 'Class', category_name: 'Class', localized_tag_name: 'Engineer', color: '', localized_category_name: 'Class' } ], app_data: { def_index: '486', quality: '6', slot: 'Cosmetic', filter_data: { '931505789': [Object], '1662615936': [Object] }, player_class_ids: { '0': '1', '1': '2', '2': '3', '3': '4', '4': '5', '5': '6', '6': '7', '7': '8', '8': '9' }, highlight_color: '7a6e65' }, id: '7846925808', owner_descriptions: [], owner_actions: [] }
×
×
  • Create New...