Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * SteamUser example - BasicBot
- *
- * Simply logs into Steam using account credentials, goes online on friends, and launches Team Fortress 2
- */
- var SteamUser = require('E:/Downloads/node-steam-user-3.14.0/node-steam-user-3.14.0/index.js'); // Replace this with `require('steam-user');` if used outside of the module directory
- var clients = [new SteamUser(), new SteamUser()]; // Eric: add ", new SteamUser()" for each account
- clients[0].logOn({
- "accountName": "put ur username here",
- "password": "put ur password here"
- });
- clients[1].logOn({
- "accountName": "put another username here",
- "password": "put another password here"
- });
- // Eric: And so on...
- // Eric: Copy from here...
- clients[0].on('loggedOn', function(details) {
- console.log("Logged into Steam as " + clients[0].steamID.getSteam3RenderedID());
- clients[0].setPersona(SteamUser.EPersonaState.Online);
- var steamId = "put the group id here";
- while (true) {
- for (var i = 0; i < clients.length; i++) {
- clients[i].joinChat(steamId);
- clients[i].leaveChat(steamId);
- }
- }
- });
- // Eric: To here and paste below. Change all clients[0] to clients[1] and so on. There is probably a better way to do all of this but I am not too familiar with JS...
- // Eric: Example below
- clients[1].on('loggedOn', function(details) {
- console.log("Logged into Steam as " + clients[1].steamID.getSteam3RenderedID());
- clients[1].setPersona(SteamUser.EPersonaState.Online);
- var steamId = "put the group id here";
- while (true) {
- for (var i = 0; i < clients.length; i++) {
- clients[i].joinChat(steamId);
- clients[i].leaveChat(steamId);
- }
- }
- });
- clients[0].on('error', function(e) {
- // Some error occurred during logon
- console.log(e);
- });
- clients[0].on('webSession', function(sessionID, cookies) {
- console.log("Got web session");
- // Do something with these cookies if you wish
- });
- clients[0].on('newItems', function(count) {
- console.log(count + " new items in our inventory");
- });
- clients[0].on('emailInfo', function(address, validated) {
- console.log("Our email address is " + address + " and it's " + (validated ? "validated" : "not validated"));
- });
- clients[0].on('wallet', function(hasWallet, currency, balance) {
- console.log("Our wallet balance is " + SteamUser.formatCurrency(balance, currency));
- });
- clients[0].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("Our account has no limitations.");
- } else {
- console.log("Our account is " + limitations.join(', ') + ".");
- }
- if(canInviteFriends) {
- console.log("Our account can invite friends.");
- }
- });
- clients[0].on('vacBans', function(numBans, appids) {
- console.log("We have " + numBans + " VAC ban" + (numBans == 1 ? '' : 's') + ".");
- if(appids.length > 0) {
- console.log("We are VAC banned from apps: " + appids.join(', '));
- }
- });
- clients[0].on('licenses', function(licenses) {
- console.log("Our account owns " + licenses.length + " license" + (licenses.length == 1 ? '' : 's') + ".");
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement