Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //NoobKillerPL for UnknownCheats.me
- var Steam = require('steam');
- //define accounts, ONLY NO STEAMGUARD SUPPORTED!!
- var accounts = [
- {
- nickname: "John // AFK #1",
- username: "yourlogin",
- password: "yourpassword",
- loggedIn: false
- },
- {
- nickname: "John // AFK #2",
- username: "yourlogin",
- password: "yourpassword",
- loggedIn: false
- },
- {
- nickname: "John // AFK #3",
- username: "yourlogin",
- password: "yourpassword",
- loggedIn: false
- },
- {
- nickname: "John // AFK #4",
- username: "yourlogin",
- password: "yourpassword",
- loggedIn: false
- }
- ];
- function randomInt(low, high) {
- return Math.floor(Math.random() * (high - low + 1) + low);
- }
- var RunAccount = function(index)
- {
- var indx = index;
- var account = accounts[index];
- var nickname = account.nickname;
- var username = account.username;
- var password = account.password;
- console.log('[' + username + '][' + indx + '] Initializing...');
- var sClient = new Steam.SteamClient();
- var sUser = new Steam.SteamUser(sClient);
- var sFriends = new Steam.SteamFriends(sClient);
- var AlreadyNotifiedUsers = {}; //map for messages
- var HandledError = false;
- sClient.connect();
- sClient.on('connected', function() {
- sUser.logOn({
- account_name: username,
- password: password,
- });
- });
- sClient.on('logOnResponse', function(logonResp)
- {
- if (logonResp.eresult == Steam.EResult.OK)
- {
- console.log('[' + username + '] Logged in!');
- sFriends.setPersonaName(nickname);
- sFriends.setPersonaState(Steam.EPersonaState.Online);
- sUser.gamesPlayed({
- games_played: [{
- game_id: '730'
- },
- {
- game_id: '440'
- },
- {
- game_id: '227700'
- }]
- });
- var IdlingTime = randomInt(3600000, 7200000);
- var TrueTime = IdlingTime / 60 / 60 / 1000;
- console.log('[' + username + '] Idling for ' + TrueTime + ' hours!');
- setTimeout(function(index) {
- if (!HandledError)
- {
- HandledError = true;
- sClient.disconnect();
- RunAccount(index);
- }
- }, IdlingTime|0, indx); //1 hour delay
- }
- else
- {
- console.log('[' + username + '] Error! :( Reconnecting in 5 minutes...');
- if (!HandledError)
- {
- HandledError = true;
- setTimeout(function(index) {
- sClient.disconnect();
- RunAccount(index);
- }, 300000|0, indx);
- }
- }
- });
- sClient.on('error', function(e) {
- if (e.eresult == Steam.EResult.InvalidPassword) {
- console.log('[' + username + '] Login Failed. Invalid password!');
- } else if (e.eresult == Steam.EResult.AlreadyLoggedInElsewhere) {
- console.log('[' + username + '] Login Failed. You are already logged in elsewhere.');
- if (!HandledError)
- {
- HandledError = true;
- setTimeout(function(index) {
- sClient.disconnect();
- RunAccount(index);
- }, 300000|0, indx);
- }
- } else if (e.eresult == Steam.EResult.AccountLogonDenied) {
- console.log('[' + username + '] Login Failed. Denied by steam. (SteamGuard?)');
- }
- else
- {
- console.log('[' + username + '] Login Failed. ' + e);
- if (!HandledError)
- {
- HandledError = true;
- setTimeout(function(index) {
- sClient.disconnect();
- RunAccount(index);
- }, 600000|0, indx);
- }
- }
- });
- sFriends.on('friend', function(source, action)
- {
- if (action == Steam.EFriendRelationship.RequestRecipient)
- {
- console.log('[' + username + '] Invited to friends by ' + source + '!');
- sFriends.addFriend(source);
- sFriends.sendMessage(source, 'I am currently AFK. Sorry :(', Steam.EChatEntryType.ChatMsg);
- AlreadyNotifiedUsers[source] = true;
- }
- });
- sFriends.on('friendMsg', function(source, message, type, chatter)
- {
- if (type == Steam.EChatEntryType.ChatMsg)
- {
- console.log('[' + username + '] Chat (' + source + '): ' + message);
- if (!AlreadyNotifiedUsers[source])
- {
- sFriends.sendMessage(source, 'I am currently AFK. Sorry :(', Steam.EChatEntryType.ChatMsg);
- AlreadyNotifiedUsers[source] = true;
- }
- }
- });
- }
- var build = function() {
- for (var index in accounts) {
- RunAccount(index);
- }
- }
- build();
Advertisement
Add Comment
Please, Sign In to add comment