Jump to content
McKay Development

Recommended Posts

Posted

Hello,
 
I'm trying to set a config on a bot I found on the internet.
 
I'm trying to set the name of the current game that I'm playing to something like "Boosting Hours" or any string. Also tried to set to Snooze like this:

bot.setPersona(SteamUser.EPersonaState.Snooze);

and didn't work...
 
This is the bot:
 
IdlerConfig.js

    var steamClientFactory = require('./steamClient.js');
    var configsArray = [];
    var config;
    var botArray = [];
    
    config = {};
    config.username = 'nick1';
    config.password = 'pass1';
    config.sharedSecret = ''; //Shared Secret(for 2FA only) https://github.com/Jessecar96/SteamDesktopAuthenticator/releases
    config.games = [730,440,570]
    configsArray.push(config);
	
    config = {};
    config.username = 'nick2';
    config.password = 'pass2';
    config.sharedSecret = ''; //Shared Secret(for 2FA only) https://github.com/Jessecar96/SteamDesktopAuthenticator/releases
    config.games = [730,440,570]
    configsArray.push(config);
	
	
	
    console.log('Number of configurations set up: ' + configsArray.length);
     
    for	(index = 0; index < configsArray.length; index++) {
    	var config = configsArray[index];
		
		var bot = steamClientFactory.buildBot(config);
		bot.doLogin();
		botArray.push(bot);
    }
     
    console.log('Running ' + botArray.length + ' bots.');

steamClient.js

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.Online);
		bot.gamesPlayed(this.games);
	});
 
	bot.on('error', function(e) {
		console.log("[" + this.username + "] " + e);
		setTimeout(function() {bot.doLogin();}, 30*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. I will respond when I am next available.");
			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;

Can anyone help me?
 
Thank you all

Posted

Setting snooze worked fine for me. If you're not in-game, you will appear as "Away" in the newest Steam client, with a "ZZZ" icon. If you're in-game, just the "ZZZ" icon will appear.

 

If you want a custom in-game string, make the string the first entry in your array that you pass to gamesPlayed.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...