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. Hy, i'm new in node js, my english is not that good. First, i wanna make a script which is load the player's inventory, accept all keys expect low price keys (like hydra case key or CSGO capsulekey),t hen select ? keys (depends on what command he uses in the chat (!buyadmin->3keys, !buyvip->2keys)). After the select, the bot will send an offer for the keys and he gets his rank (I can make this part). I have a starter script (I tried to learn and code something). Code: const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp');const SteamID = require('steamid');const SteamCommunity = require('steamcommunity');const TradeOfferManager = require('steam-tradeoffer-manager');const config = require('./config.json'); const client = new SteamUser();const community = new SteamCommunity();const manager = new TradeOfferManager({ steam: client, community: community, language: 'en'}); const logOnOptions = { accountName: config.username, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.sharedSecret)}; client.logOn(logOnOptions); client.on('loggedOn', () => { console.log('[Vortex] Sikeres bejelentkezés a steam-be!'); client.setPersona(SteamUser.Steam.EPersonaState.Online); client.gamesPlayed(730);}); client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(10000, config.identitySecret);}); manager.on('newOffer', offer => { if (offer.partner.getSteamID64() === 'config.owenerID') { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(`[Vortex] Owner csereajánlat elfogadva. Státusz: ${status}.`); } }); } }); client.on("friendMessage", function(steamID, message) { if (message == "!help") { client.chatMessage(steamID, "[Vortex] Parancsok: !weboldal, !szerverek, !rangok, !adminok, !buyadmin, !buyvip+, !buyvip, !buypskin");console.log(steamID.getSteam2RenderedID()); } if (message == "!weboldal") { client.chatMessage(steamID, "[Vortex] Weboldalunk: ");console.log(steamID.getSteam2RenderedID()); } if (message == "!szerverek") { client.chatMessage(steamID, "[Vortex] Szervereink: ");console.log(steamID.getSteam2RenderedID()); } if (message == "!rangok") { client.chatMessage(steamID, "[Vortex] Rangok: ");console.log(steamID.getSteam2RenderedID()); } if (message == "!adminok") { client.chatMessage(steamID, "[Vortex] Adminok: ");console.log(steamID.getSteam2RenderedID()); } if (message == "!buyadmin") { client.chatMessage(steamID, "[Vortex]");const steam2id = (steamID.getSteam2RenderedID());const steamid = (steamID.getSteamID64());const offer = manager.createOffer(steamid); community.getUserInventory(steamid, 730, 2, false, function(err, inventory) {console.log(inventory[0].amount);}); } if (message == "!buyvip+") { client.chatMessage(steamID, "[Vortex]"); } if (message == "!buyvip") { client.chatMessage(steamID, "[Vortex]");console.log(steamID.getSteam2RenderedID()); } if (message == "!buypskin") { client.chatMessage(steamID, "[Vortex]");console.log(steamID.getSteam2RenderedID()); } if (message != "!help" && message != "!weboldal" && message != "!rangok" && message != "!adminok" && message != "!buyadmin" && message != "!buyvip+" && message != "!buyvip" && message != "!buypskin"){client.chatMessage(steamID, "[Vortex] Nincs ilyen parancs, segítségért írd be: !help");}}); manager.on('newOffer', offer => { if (offer.itemsToGive.length === 0) { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log('[Vortex] Támogatás elfogadva. Státusz: ${status}.'); } }); } else { offer.decline(err => { if (err) { console.log(err); } else { console.log('[Vortex] Támogatás elutasítva. (Tárgyat akart kérni a bot-tól!)'); } }); }}); (steamID.getSteam2RenderedID()); -> I need this for sourcemod admin setup.
  2. i'm getting the callback is not a function in the steamcommunity/user.js:484 file I have no idea what line of code of mine is causing this, I am trying to make a level bot and get all the sets in our inventory and add as many sets until the amount is reached which is the buyRate * how many keys the user wants to use. error D:\Documents\Google Drive\Node\SteamBot\node_modules\steamcommunity\components\users.js:484 callback(null, inventory, currency, body.total_inventory_count); ^ TypeError: callback is not a function at SteamCommunity.<anonymous> (D:\Documents\Google Drive\Node\SteamBot\node_modules\steamcommunity\components\users.js:484:5) at Request._callback (D:\Documents\Google Drive\Node\SteamBot\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (D:\Documents\Google Drive\Node\SteamBot\node_modules\request\request.js:185:22) at Request.emit (events.js:182:13) at Request.<anonymous> (D:\Documents\Google Drive\Node\SteamBot\node_modules\request\request.js:1161:10) at Request.emit (events.js:182:13) at IncomingMessage.<anonymous> (D:\Documents\Google Drive\Node\SteamBot\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:273:13) at IncomingMessage.emit (events.js:187:15) at endReadableNT (_stream_readable.js:1086:12) and here is the code that is possibly causing the error ( I am also using https://www.npmjs.com/package/steam-market-search for the market search as I couldn't get the one in steamcommunity to work) for(var i = 0; i < cardApps.length; ++i){ //Loop through all the appid's we have steamMarket.searchCommunity(cardApps[i]).then(function(item){ //searches steam market for the appid var itemCount = 0; var cards = []; for(var j = 0; j < item.length; ++j){ //loop through each item if(item[j].type.includes('Trading Card') && item[j].rarity.includes('Normal')){ //if they are a normal trading card ++itemCount; var ata = 0; if(ata <= cardApps[i].amountToAdd){ for (let y = 0; y < myItems.length; ++y) { //loop through all our items if(myItems[y].market_hash_name == myItems[j].hash_name){ //if our item matches the one we are currently looking at cards.push({id: myItems[y].id, appid: 753, contextid: 6}); // add to item array ++ata; } } } } if(cards.length == itemCount){ offer.addMyItems(cards); cardApps.splice(i, 1); } } }, console.error); }
  3. Hello, I don't really know if I'm doing it right. I have VPS (where I idle steam game hours) and I have 2 the same idle scripts on VPS (different IP) and on local PC. Sometimes I need to run idle script on local PC without killing session on VPS, but I getting error: LoggedInElsewhere, and I can't login with local PC, so I decided to try kickPlayingSession. using this script: click bot.setPersona(SteamUser.EPersonaState.Offline); bot.kickPlayingSession((callback) => { console.log(callback) }); bot.gamesPlayed(this.games, true);then I getting crash in my app with: Error: Cannot kick other sessionbut orginal session getting error too: LoggedInElsewhere, but its not crashing can you please help me what I'm doing wrong here.
  4. I want handle 'FriendMessagesClient.NotifyAckMessageEcho#1' message, it's possible?
  5. help i can accept the offer in web but can't accept it with node-steamcommunity in some reason our country block the steamcommunity.com when we visit the site our targetlink will be reset,so if we want visit steamcommunity.com we must use a vpn and one day some one find the way to visit it without vpn it's called Reverse Proxy, i thought.(sry for my bad english) The question is now i can visit steamcommunity.com with web and steamclient, but i can't visit is by node-steamcommunity the first offer worked becacuse i use a another ipaddress in hosts, and then i change the hosts to my Reverse Proxy server, and then show Unable to accept offer: self signed certificate what should i do ? can you give me some suggestions? I am very grateful to you for reading these. thanks
  6. Guest

    Display link like steam

    https://gyazo.com/10cec7112e61627598031bf00b26c388 When I send a link through node steam-user it just send the text, when I send a link through Steam, then it is displayed in expanded form, how can I send the link so that it appears as a steam?
  7. I am trying to only get defined number of keys in a trade, but instead it adds all the items as they share the same id (item is a TF2 Mann co. key) here is my current code for the trade offer, (the steam id in create offer is a mates steamid as I can't test with my own account due to vac) function buy(steamID, amount){ if(isNaN(amount) || amount === undefined){ client.chatMessage(steamID, "Please enter a valid number"); } else{ var count = 0; var i = 0; client.chatMessage(steamID, "Creating Offer, please wait!"); //Check Players inventory for the keys, and make sure we have enough sets to supply var offer = manager.createOffer('76561198008100070'); offer.setMessage("Price: " + amount + " Keys. Sets: " + amount * config.buyRate); offer.getPartnerInventoryContents(440, 2, function(err, inventory, currencies){ if(err){ console.log(err); } /*for (var j = 0; j < amount; ++j){ if(inventory[i].market_hash_name == config.keysAccepted){ ++count; console.log("Adding Item"); offer.addTheirItem({id: inventory[i].id, appid: 440, contextid: 2}); } }*/ inventory.forEach(function(val){ if(val.market_hash_name == config.keysAccepted){ console.log("Adding Item"); offer.addTheirItem({id: val.instanceid, appid: 440, contextid: 2}); ++count; } }); if(count < amount){ console.log("count: "+count); client.chatMessage(steamID, "You don't have enough keys for me to send this trade."); } else{ offer.send(function(err, status){ if(err){ console.log(err); client.chatMessage(steamID, "An Error has Occured while sending offer."); } if(status == "pending"){ client.chatMessage(steamID, "Confirming Offer!"); } if(status == "sent"){ client.chatMessage(steamID, "Offer Sent!"); } }); } }); } }
  8. Hello, I'd like to ask if there is something like getGameBadgeLevel, but for another user.
  9. I am trying to get the tf2 quantities, but how am I supposed to get it. I saw on the post that you need an item tag, but how do I get it?\ LINK: https://dev.doctormckay.com/topic/1863-how-do-i-identify-tf2-qualities/
  10. i am trying to get the current xp of a user and the xp required to achieve a level but i don't know how to see how much xp they currently have? is there something built into steam-user or should i use another module? here is my code for the command function level(steamID, level){ client.getSteamLevels([steamID], function(results){ console.log("level: " + results[steamID] + "xp: " + results[steamID].xp); // just gives me undefined for the result for xp if(level === undefined){ level = results[steamID]; } if(level >= results[steamID]){ client.chatMessage(steamID, "You would need " + /*xp required here*/ + "more xp for level " + level); } else{ client.chatMessage(steamID, "Please enter a higher number"); } });}
  11. Can you help me i dont know how to create this function with command !all take all partner cupons to offer. client.on("friendMessage", (partner, message) => { if(message === "!all"){ const offer = manager.createOffer(partner); manager.loadUserInventory(partner, 753, 3, true, (err, theirInv) => { if (err) { console.log(err); } else { const theirItem = theirInv[Math.floor(Math.random() * theirInv.length - 1)]; offer.addTheirItems(theirItem); offer.setMessage( `U cuppon` ); offer.send((err, status) => { if (err) { console.log(err); } else { console.log(`Sent offer. Status: ${status}.`); } }); } } ); } });
  12. Hello, I'm currently stuck with something that I assume is very simple, but I can't find any tutorial or help about it anywhere on the internet... I'm currently trying to create a bot that trades random Steam game codes for random steam cards, but my problem right now is that I don't know how to check if all items that the bot will receive are trading cards. I'm aware that this probably is a really easy thing, but I really have no idea where to find my answers :/ Thanks a lot for reading this, hopefully you can me with that This is what I have done so far : //This is where the pain begins. function processOffer(offer) { if (offer.partner.getSteamID64() === config.ownerID) { acceptOffer(offer); } else if (offer.isGlitched() || offer.state === 11) { console.log("Offer was glitched, declining."); declineOffer(offer); } else { var theirItems = offer.itemsToReceive var ourItems = offer.itemsToGive }} manager.on('newOffer', (offer) => { console.log("Offer received, processing"); processOffer(offer); })}
  13. how can i send a message to group using gid or url?
  14. I don't understand what to put in the username and password fields, My main steam account? I've got it logged it but i left the two fields and twoFactorCode Blank. Do I manually register a new steam account through steam? I'm trying to make a trading bot. I understand this is a stupid question, any help would be appreciated.
  15. I want to confirm offer from server app but i am also using SteamDesktopAuth and while i am trying to confirm it there is a error: Error: It looks like your Steam Guard Mobile Authenticator is providing incorrect Steam Guard codes. This could be caused by an inaccurate clock or bad timezone settings on your device. If your time settings are correct, it could be that a different device has been set up to provide the Steam Guard codes for your account, which means the authenticator on this device is no longer valid. at /usr/home/MMMM/domains/XXX/public_trade2/node_modules/steamcommunity/components/confirmations.js:33:14 at SteamCommunity.<anonymous> (/usr/home/MMMM/domains/XXX/public_trade2/node_modules/steamcommunity/components/confirmations.js:276:3) at Request._callback (/usr/home/MMMM/domains/XXX/public_trade2/node_modules/steamcommunity/components/http.js:67:15) at Request.self.callback (/usr/home/MMMM/domains/XXX/public_trade2/node_modules/request/request.js:185:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request.<anonymous> (/usr/home/MMMM/domains/XXX/public_trade2/node_modules/request/request.js:1161:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at Gunzip.<anonymous> (/usr/home/MMMM/domains/XXX/public_trade2/node_modules/request/request.js:1083:12)So it is possible to confirm it from server?
  16. is there any method to find group by ID64? I know how to grab groupID64, for example: https://steamcommunity.com/groups/multiplay/memberslistxml/?xml=1 but if somebody change URL, how can I find group with only ID64?
  17. Hello, I want to make a website about my group member statistics (like Steam Level, Games, etc) using React After i installing node-steamcommunity and i want to trying the module, i got an error 44 | } // Report stats hourly, and immediately in 10 minutes 45 | 46 | 47 | setInterval(reportStats, 1000 * 60 * 60).unref(); 48 | setTimeout(reportStats, 1000 * 60 * 10).unref(); 49 | 50 | if (isDebugging()) { setupReportingD:/testing/node_modules/@doctormckay/stats-reporter/index.js:47 Did I make a mistake?Thank you
  18. I know that we can set a message to trade offers that we send. I'm wondering how to get/extract the message in incoming trade offers.
  19. Hello I guess i can`t manage to setup sentOfferChanged event. This is my code: const SteamUser = require('steam-user'); const TradeOfferManager = require('steam-tradeoffer-manager'); const fs = require('fs') // steam 2fa. generate steam guard code for login. const SteamTotp = require('steam-totp'); const bot = new SteamUser(); const manager = new TradeOfferManager({ steam: bot, language: 'en' }); if (fs.existsSync('polldata.json')) { manager.pollData = JSON.parse(fs.readFileSync('polldata.json').toString('utf8')); } bot.logOn({ accountName: 'user', password: 'password', twoFactorCode: SteamTotp.generateAuthCode('secret') }); bot.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); sendRandomItem(); }); function sendRandomItem() { console.log('Sending the offer') const partner = 'trade_url'; const offer = manager.createOffer(partner); offer.addTheirItem({ assetid: "id", appid: 730, contextid: 2 }); offer.setMessage( `HIIII` ); offer.send((err, status) => { if (err) { console.log({err}); } else { console.log(`Sent offer. Status: ${status}.`); } }); }; manager.on('sentOfferChanged', function (offer, oldState) { console.log(`Offer #${offer.id} changed: ${TradeOfferManager.ETradeOfferState[oldState]} -> ${TradeOfferManager.ETradeOfferState[offer.state]}`); }); manager.on('pollFailure', function (err) { console.log({err}) }) manager.on('pollData', function (pollData) { fs.writeFileSync('polldata.json', JSON.stringify(pollData)); }); This is polldata.json {"sent":{"3358172656":2}} Console log $ node ./modules/bot Sending the offer Sent offer. Status: sent. But when i accept or decline the offer sentOfferChanged doesnt fire up.
  20. Hello! Added possibility send custom headers for any request in the library. https://github.com/DoctorMcKay/node-steam-user/pull/194 - Please merge it.
  21. hello i need the inventory value from a Steamid64. How do i do that. Sry that iam asking but iam kinda new here thanks for ur help
  22. Since the latest UI update I'm not able to get this event, does anyone know what changed? I can't even get a simple console.log out of it anymore.
  23. I got loginKey after first login with twofactorcode, and then i was loggining with this loginKey, but after time i got this error: InvalidPassword. Password was valid! I removed line with loginKey option, and typed my twofactorcode and everything is fine for the moment, why did it throw invalidPassword? Thanks!
×
×
  • Create New...