Jump to content
McKay Development

vmu123

Member
  • Posts

    3
  • Joined

  • Last visited

vmu123's Achievements

  1. Just search "ez steam hours booster" on google, probably will be the first result.
  2. Thanks for the answer @SnaBe! Sorry if I wasn't clear, but unfortunately it doesn't really answer my question :/ Good news though, is that I was able to partially solve my problem. I made "name" and "persona" global variables, and did this: bot.on("friendMessage", function(steamID, message) { bot.getPersonas([steamID], function(personas) { persona = personas[steamID.getSteamID64()]; 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/away/afk."); bot.chatMessage(steamID, "[Mensagem Automática] Estou ausente no momento."); this.messageReceived[steamID] = true; } });Now I am able to retrieve the username of the person who sent me a message and keeps the "this.username" part working as intended in the console.log function. The only issue is that on the first message that I receive, the "name" variable shows "undefined" in the console log. From the second message onwards, it gets fixed and works as expected. If anyone can help fix this small issue would be great.
  3. 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!
×
×
  • Create New...