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. I have variable that contains steamid64. There is a reason using variable, Because it changes. This id event is not working, However it does with const. Does it work only with const? If yes, How can i make it work? client.on('friendMessage#' + variable, function(steamID, message) { console.log("works"); client.chatMessage(steamID, "works " + message); });
  2. Hello. Which device is logged in using the logOn method? Mobile or web browser ?
  3. is it possible to read comments from a specific group and leave a comment?
  4. newOffer event is not called sometimes... Even after restart of bot, event is still not fired. After I send second offer, newOffer triggers for both trades Not fired if i send 2 or more offers at the same time. Called only for one offer. Second offer calling newOfferafter sentOfferChanged or recievedOfferChanged triggers. Its seems like bug How could I fix this problem...I had lose many offers because this problem..
  5. I am not new to the steam bots but i am new to making it send steam offers and dont know how to do that with my bots
  6. MrPotato

    error

    0|start | [22:13:15] "User has phone!" 0|start | [22:13:15] "thegamingemu69 has been removed from queue!" 0|start | [22:13:15] "close connection" 0|start | TypeError: Cannot read property 'setTimeout' of undefined 0|start | at CMClient.handlers.(anonymous function) (/root/bot/node_modules/steam-client/lib/cm_client.js:545:19) 0|start | at CMClient._netMsgReceived (/root/bot/node_modules/steam-client/lib/cm_client.js:305:24) 0|start | at TCPConnection.emit (events.js:182:13) 0|start | at TCPConnection.EventEmitter.emit (domain.js:442:20) 0|start | at TCPConnection._readPacket (/root/bot/node_modules/steam-client/lib/tcp_connection.js:183:7) 0|start | at Socket.emit (events.js:182:13) 0|start | at Socket.EventEmitter.emit (domain.js:442:20) 0|start | at emitReadable_ (_stream_readable.js:531:12) 0|start | at args.(anonymous function) (/usr/lib/node_modules/pm2/node_modules/event-loop-inspector/index.js:133:29) 0|start | at process._tickCallback (internal/process/next_tick.js:63:19)
  7. So I'm creating a tf2 bot named Wolfy. I got the trade confirmations, steam login, and such, but the only problem is that how do I identify a tf2 item qualities(Unique, Genuine, Unusuals). Like what am I suppose to do exactly?
  8. "uri": "https://steamcommunity.com/comment/Profile/post/" + userID.toString() + "/-1", "form": { "comment": message, "count": 6, "sessionid": this.getSessionID() }, What's -1 in the end of the URI and what's "count" param?
  9. I've been trying to make async/await work. If someone sends specific message they get specific pre-written reply. I've done that using friendMessage ID event. Down the road, I need to catch the user's reply to include it in the reply. Well i assume if i give you an example of it. Ofc the user should start it as long as bot does something depends on the chat message/ i call it chat command/. User: !addadmin Bot: Who's it? Send the steamid64 to me. User: xxxxxxxxxxxxxxxxx /*sends steamid64*/ Bot: xxxxxxxxxxxxxxxxx is not in my friends list. Tell him to add me. OR Bot: xxxxxxxxxxxxxxxxx is in my friends list. Made him/her the master of me. It was an example. If you are able to, code the catching of user reply and using it in some checks then replies.
  10. var _ = require('lodash'); var carrier = require('carrier'); var crypto = require('crypto'); var fs = require('fs'); var net = require('net'); var path = require('path'); var prompt = require('prompt'); var steamid = require('steamidconvert')() var Steam = require('steam'); var steamClient = new Steam.SteamClient(); var steamFriends = new Steam.SteamFriends(steamClient); var steamUser = new Steam.SteamUser(steamClient); var config = require(path.join(__dirname,'config.json')); config.sentryPath = path.join(__dirname, config.login+'-sentry.bin'); var q = {}; var usersLastLogoff = []; var schema = { properties: { steamauth: { description: 'Enter your steam auth code: ', message: 'This should be emailed to you.', type: 'string', required: true, pattern: /[0-9a-zA-Z\s]*/ } } }; steamClient.connect(); steamClient.on('connected', function() { var sha = undefined; if(fs.existsSync(config.sentryPath)) { console.log('Sentry file found. Sending to server.') var file = fs.readFileSync(config.sentryPath); sha = crypto.createHash('sha1').update(file).digest(); } steamUser.logOn({ account_name: config.login, password: config.pass, auth_code: config.auth, sha_sentryfile: sha }); }); steamClient.on('logOnResponse', function(logonResp) { if (logonResp.eresult === Steam.EResult.AccountLogonDenied) { steamClient.disconnect(); prompt.get(schema, function (err, result) { if (result.steamauth){ config.auth = result.steamauth; steamClient.connect(); } }); prompt.start(); }else if (logonResp.eresult === Steam.EResult.OK) { console.log('Logged in!'); steamFriends.setPersonaState(Steam.EPersonaState.Online); steamFriends.setPersonaName(config.displayName); }else{ console.log('Login failed.'); } }); steamUser.on('updateMachineAuth', function(sentry, cb) { console.log('Obtained sentry. Writing to '+config.sentryPath); fs.writeFileSync(config.sentryPath, sentry.bytes); cb({ sha_file: crypto.createHash('sha1').update(sentry.bytes).digest() }); }); steamFriends.on('relationships', function(){ checkFriendsLimit(); var friends = steamFriends.friends; for(var friend in friends){ if (friends[friend] === 2){ steamFriends.addFriend(friend); } } }); steamFriends.on('friend', function(friend, type){ checkFriendsLimit(); if(type === 2){ steamFriends.addFriend(friend); } }); steamFriends.on('personaState', function(state){ if ((_.has(state, 'last_logoff')) && !(_.has(state, 'persona_state'))){ usersLastLogoff.push(state); cleanUsers(); }else{ var id = state.friendid; if (_.has(q, id)){ _.each(q[id], function(message){ steamFriends.sendMessage(id, message); }); delete q[id]; } } }); var checkFriendsLimit = _.debounce(function (){ var friends = steamFriends.friends; var friendsArray = Object.keys(friends); if (friendsArray.length > config.maxFriends){ steamFriends.requestFriendData(friendsArray, Steam.EClientPersonaStateFlag.LastSeen); } } , 5000); var cleanUsers = _.debounce(function (){ if (steamClient.connected){ var sorted = _.sortBy(usersLastLogoff, 'last_logoff'); var purgeAmount = sorted.length - config.maxFriends; console.log('Purging old friends.') _.times(purgeAmount, function(i){ var id = sorted[i].friendid; console.log('Removing: ', id); steamFriends.removeFriend(id); }); usersLastLogoff = []; } } , 5000); var connect = _.debounce(function (){ steamClient.connect(); } , 5000); steamClient.on('error', function (e){ console.log(e); connect(); }); net.createServer(function (socket) { socket.on('error', function(err){ console.log('Socket Error: \n', err); }); carrier.carry(socket, function(line) { if (steamClient.connected){ if ((_.startsWith(line, 'BCMD')) && (line.length > 12)) { var cmd = line.substring(4, 8); var packet = line.substring(8).split('|'); var id = steamid.convertTo64(packet[0]); var msg = packet[1]; if (_.has(steamFriends, ['friends', id])){ if (steamFriends.friends[id] === 3){ steamFriends.sendMessage(id, msg); } if (steamFriends.friends[id] === 4){ q[id].push(msg); } }else{ checkFriendsLimit(); steamFriends.addFriend(id); if (!(_.has(q, id))){ q[id] = []; } q[id].push(msg); } } } }); }).listen(config.port); console.log('Server running on port '+config.port+'\n'); it was working very well script but When I change my vds suddenly its not working, its not login to steam account.. someone can help me ?
  11. ClientGamesPlayed does not seem to work, I made sure the bot's privacy settings allowed for it client.gamesPlayed(440);
  12. Hi, someone have idea on antyspam? I just won't get spam like 20 messages from the same user in 3 sec ( or more). Have a nice day
  13. So, I've tried the use of proxies quite a few time, but I found out none or very little of the free proxies that I can gather, actually works. On the contrary, any arbitrary free VPN works great with node-steam (and steam client). I'm not well educated on the topic of proxies and VPN's, but what is so different, that free proxies not work, while free VPN's do? Is there such a thing as a virtual/local VPN, which we can use instead of a proxy (thus not affecting all network traffic, as a normal VPN would)?
  14. client.on('appOwnershipCached', function() { const appIDs = client.getOwnedApps(); const appDetails = client.getProductInfo(appIDs, () => { fs.writeFileSync('./logs/info.json', JSON.stringify(appDetails, null, 4)); }); }); This is my code I was trying to get the product info of all the app I have but I got this error Logged into Steam! /mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:134 packages = packages.map(function(pkg) { ^ TypeError: packages.map is not a function at SteamUser.getProductInfo (/mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:134:22) at SteamUser.<anonymous> (/mnt/e/Projects/web/steam-bot/bot.js:51:29) at emitNone (events.js:106:13) at SteamUser.emit (events.js:208:7) at /mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:481:9 at /mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/apps.js:295:5 at Object.cb (/mnt/e/Projects/web/steam-bot/node_modules/steam-user/components/messages.js:174:4) at CMClient._netMsgReceived (/mnt/e/Projects/web/steam-bot/node_modules/steam-client/lib/cm_client.js:321:26) at CMClient.handlers.(anonymous function) (/mnt/e/Projects/web/steam-bot/node_modules/steam-client/lib/cm_client.js:603:8) at CMClient._netMsgReceived (/mnt/e/Projects/web/steam-bot/node_modules/steam-client/lib/cm_client.js:305:24) Can anyone Plese help?
  15. Hello, I used some open source bots, and configured it as I like it. Currently I want to add !buygems [n] option. I looked at many discussions, mostly on this site. My problem is I filter the gems, and type theirGems.amount = n * CONFIG.BUYINGGEMS(never mind what I put here). I tried to console.log theirGems and theirGems.amount and it says the same number as it should be n * CONFING.BUYINGGEMS but in the trade offer it adds whole sack of gems. https://pastebin.com/p70bwckf http://prntscr.com/kod0gg
  16. When I call this API in the browser http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=steam_key&steamid=my_steam_id_64&format=json I get { "response": { "game_count": 2, "games": [ { "appid": 304390, "playtime_2weeks": 20, "playtime_forever": 20 }, { "appid": 654310, "playtime_2weeks": 20, "playtime_forever": 20 } ] } } Which is correct You can confirm by seeing my profile https://steamcommunity.com/id/auto-bot TF2 doesn't show up as it is free I guess. but when I call client.getOwnedApps(); I get an array of 207 appIDs out of which 204 are the ones that steam adds by default. So what I wanted to ask was that Is there any way I can only get the appIDs of games that are present in my account. Your help will be greatly appreciated.
  17. What is needed and how can a "auth secret" be used that is returned by the "getAuthSecret" method. And what does "pre-shared key" mean?
  18. Hello, i'm newbie in creating bots and i don't know how to make trade sending system properly(It doesn't add items). I provide code below: var incomeMessage = message; var splittedMsg = incomeMessage.split(" "); if(splittedMsg[0] == "!buy") { splittedMsg = incomeMessage.slice(5); client.chatMessage(steamID, "Sellin' item named " + splittedMsg); manager.getUserInventoryContents(steamID, 440, 2, true, (err, inv) => { if (err) { throw err; } else { const offer = manager.createOffer(steamID); let item = inv.filter(item => item.market_name == splittedMsg); let itemsToTrade = item[0]; offer.addMyItem(itemsToTrade); offer.setMessage('You recieved a Refined Metal!'); offer.send((err, status) => { if (err) { console.log(err); } else { console.log('trade sent'); console.log(status); } }); } }); } I send message to bot like !buy Refined Metal and it has to put 1 Refined Metal to trade and then send it to me. But i has error 26. I know it means that i don't have such items in my inventory. So can you help me with that?
  19. TypeError: Cannot read property 'getSteamID64' of undefined at SteamCommunity.getUserInventory (/root/bot/node_modules/steamcommunity/components/users.js:287:39) at TradeOfferManager.loadUserInventory (/root/bot/node_modules/steam-tradeoffer-manager/lib/index.js:331:18) at Object.GetInventory (/root/bot/Code/BotsManager.js:143:17) at Server.<anonymous> (/root/bot/Code/RemoteAccess.js:48:11) at next (/root/bot/node_modules/restify/lib/server.js:1125:29) at f (/root/bot/node_modules/once/once.js:36:25) at Server.<anonymous> (/root/bot/node_modules/express-ipfilter/lib/ipfilter.js:205:14) at next (/root/bot/node_modules/restify/lib/server.js:1125:29) at f (/root/bot/node_modules/once/once.js:36:25) at Server.parseBody (/root/bot/node_modules/restify/lib/plugins/bodyParser.js:152:17) Please help. What could be causing these errors?
  20. I need steamMachineAuth<steam64id> cookie after webSession, if you login in web browser, you'll get this cookie, i need it to auth in my browser by all webSession cookies. Or how can i get this cookie? UPD: I set "rememberPassword": true in my logOn options, not working.. thank you
  21. Can you give an example , how to use proxy. And what type need to use socks5 or http/https?
  22. i saw one guy he use this to make Crafting scrap
  23. code: let client = new Steam.CMClient(); let user = new SteamUser(client); client.setHttpProxy("http://user:[email protected]:8000"); user.logOn({"accountName": username,"password": password, "authCode": code}); user.on('loggedOn', function(details) { console.log("Logged into Steam as " + user.steamID.getSteam3RenderedID()); console.log("change email to " + newEmail) user.changeEmail({ "password": password, "newEmail": newEmail }, function(err) { ... }); }); user.on('error', function(e) { res.end('error'); }); user.on('webSession', function(sessionID, cookies) { console.log("Got web session"); }); log: username: qusoraierylined password: -- guard: twoFactorCode code: WH2NF Logged into Steam as [U:1:319178106] change email to [email protected] Got web session { Error: RateLimitExceeded at Object.exports.eresultError (/root/bot/node_modules/steam-user/components/helpers.js:75:12) at /root/bot/node_modules/steam-user/components/account.js:129:21 at Object.cb (/root/bot/node_modules/steam-user/components/messages.js:174:4) at CMClient._netMsgReceived (/root/bot/node_modules/steam-client/lib/cm_client.js:321:26) at CMClient.handlers.(anonymous function) (/root/bot/node_modules/steam-client/lib/cm_client.js:603:8) at CMClient._netMsgReceived (/root/bot/node_modules/steam-client/lib/cm_client.js:305:24) at emitOne (events.js:116:13) at TCPConnection.emit (events.js:211:7) at TCPConnection._readPacket (/root/bot/node_modules/steam-client/lib/tcp_connection.js:183:7) at emitNone (events.js:106:13) eresult: 84 } user.publicIP returns my proxy's ip addres in loggedOn() event
  24. var SteamUser = require('steam-user'); var SteamTotp = require('steam-totp'); var botFactory = {}; botFactory.buildBot = function (config) { var bot = new SteamUser({ promptSteamGuardCode: false, dataDirectory: "./sentry", singleSentryfile: false }); bot.username = config.username; bot.password = config.password; bot.sharedSecret = config.sharedSecret; bot.games = config.games; bot.messageReceived = {}; bot.on('loggedOn', function(details) { console.log("[" + this.username + "] Logged into Steam as " + bot.steamID.getSteam3RenderedID()); bot.setPersona(SteamUser.EPersonaState.Away); bot.gamesPlayed(this.games); }); bot.on('error', function(e) { console.log("[" + this.username + "] " + e); setTimeout(function() {bot.doLogin();}, 5*60*1000); }); bot.doLogin = function () { this.logOn({ "accountName": this.username, "password": this.password }); } bot.on('steamGuard', function(domain, callback) { if ( !this.sharedSecret ) { var readlineSync = require('readline-sync'); var authCode = readlineSync.question("[" + this.username + "] " + 'Steam Guard' + (!domain ? ' App' : '') + ' Code: '); callback(authCode); } else { var authCode = SteamTotp.generateAuthCode( this.sharedSecret ); console.log("[" + this.username + "] Generated Auth Code: " + authCode); callback(authCode); } }); bot.on("friendMessage", function(steamID, message) { console.log("[" + this.username + "] Message from " + " (" + steamID + ")"+ ": " + message); if ( !this.messageReceived[steamID] ) { bot.chatMessage(steamID, "[Automated Message] I am currently idle."); bot.chatMessage(steamID, "[Mensagem Automática] Estou ausente no momento."); this.messageReceived[steamID] = true; } }); bot.on('vacBans', function(numBans, appids) { if(numBans > 0) { console.log( "[" + this.username + "] " + numBans + " VAC ban" + (numBans == 1 ? '' : 's') + "." + (appids.length == 0 ? '' : " In apps: " + appids.join(', ')) ); } }); bot.on('accountLimitations', function(limited, communityBanned, locked, canInviteFriends) { var limitations = []; if(limited) { limitations.push('LIMITED'); } if(communityBanned) { limitations.push('COMMUNITY BANNED'); } if(locked) { limitations.push('LOCKED'); } if(limitations.length !== 0) { console.log("[" + this.username + "] Limitations: " + limitations.join(', ') + "."); } }); return bot; } module.exports = botFactory; First of all, this is a "bot" to farm hours. I want help with this particular part of the code: bot.on("friendMessage", function(steamID, message) { console.log("[" + this.username + "] Message from " + " (" + steamID + ")"+ ": " + message); if ( !this.messageReceived[steamID] ) { bot.chatMessage(steamID, "[Automated Message] I am currently idle."); bot.chatMessage(steamID, "[Mensagem Automática] Estou ausente no momento."); this.messageReceived[steamID] = true; } });So what i want to do is show in console not only the steamID of the sender, but also its display name on Steam (if there's anyway to also show a nickname I set for the sender that would be nice). I did some research and could get it to work, but then it would break the part where it shows the name of the account that got the message, by doing: bot.on("friendMessage", function(steamID, message) { bot.getPersonas([steamID], function(personas) { var persona = personas[steamID.getSteamID64()]; var name = persona ? persona.player_name : ("[" + steamID.getSteamID64() + "]"); console.log("[" + this.username + "] Message from " + name + " (" + steamID + ")"+ ": " + message); }); if ( !this.messageReceived[steamID] ) { bot.chatMessage(steamID, "[Automated Message] I am currently idle."); bot.chatMessage(steamID, "[Mensagem Automática] Estou ausente no momento."); this.messageReceived[steamID] = true; } }); Any help is appreciated!
  25. I have this line for the intention of selling my card sets for his gems. instead it gets the other users whole inventory.
×
×
  • Create New...