Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. /**
  2. * SteamUser example - BasicBot
  3. *
  4. * Simply logs into Steam using account credentials, goes online on friends, and launches Team Fortress 2
  5. */
  6.  
  7. 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
  8. var clients = [new SteamUser(), new SteamUser()]; // Eric: add ", new SteamUser()" for each account
  9.  
  10. clients[0].logOn({
  11. "accountName": "put ur username here",
  12. "password": "put ur password here"
  13. });
  14.  
  15. clients[1].logOn({
  16. "accountName": "put another username here",
  17. "password": "put another password here"
  18. });
  19.  
  20. // Eric: And so on...
  21.  
  22. // Eric: Copy from here...
  23. clients[0].on('loggedOn', function(details) {
  24. console.log("Logged into Steam as " + clients[0].steamID.getSteam3RenderedID());
  25. clients[0].setPersona(SteamUser.EPersonaState.Online);
  26. var steamId = "put the group id here";
  27. while (true) {
  28. for (var i = 0; i < clients.length; i++) {
  29. clients[i].joinChat(steamId);
  30. clients[i].leaveChat(steamId);
  31. }
  32. }
  33. });
  34. // 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...
  35. // Eric: Example below
  36. clients[1].on('loggedOn', function(details) {
  37. console.log("Logged into Steam as " + clients[1].steamID.getSteam3RenderedID());
  38. clients[1].setPersona(SteamUser.EPersonaState.Online);
  39. var steamId = "put the group id here";
  40. while (true) {
  41. for (var i = 0; i < clients.length; i++) {
  42. clients[i].joinChat(steamId);
  43. clients[i].leaveChat(steamId);
  44. }
  45. }
  46. });
  47.  
  48. clients[0].on('error', function(e) {
  49. // Some error occurred during logon
  50. console.log(e);
  51. });
  52.  
  53. clients[0].on('webSession', function(sessionID, cookies) {
  54. console.log("Got web session");
  55. // Do something with these cookies if you wish
  56. });
  57.  
  58. clients[0].on('newItems', function(count) {
  59. console.log(count + " new items in our inventory");
  60. });
  61.  
  62. clients[0].on('emailInfo', function(address, validated) {
  63. console.log("Our email address is " + address + " and it's " + (validated ? "validated" : "not validated"));
  64. });
  65.  
  66. clients[0].on('wallet', function(hasWallet, currency, balance) {
  67. console.log("Our wallet balance is " + SteamUser.formatCurrency(balance, currency));
  68. });
  69.  
  70. clients[0].on('accountLimitations', function(limited, communityBanned, locked, canInviteFriends) {
  71. var limitations = [];
  72.  
  73. if(limited) {
  74. limitations.push('LIMITED');
  75. }
  76.  
  77. if(communityBanned) {
  78. limitations.push('COMMUNITY BANNED');
  79. }
  80.  
  81. if(locked) {
  82. limitations.push('LOCKED');
  83. }
  84.  
  85. if(limitations.length === 0) {
  86. console.log("Our account has no limitations.");
  87. } else {
  88. console.log("Our account is " + limitations.join(', ') + ".");
  89. }
  90.  
  91. if(canInviteFriends) {
  92. console.log("Our account can invite friends.");
  93. }
  94. });
  95.  
  96. clients[0].on('vacBans', function(numBans, appids) {
  97. console.log("We have " + numBans + " VAC ban" + (numBans == 1 ? '' : 's') + ".");
  98. if(appids.length > 0) {
  99. console.log("We are VAC banned from apps: " + appids.join(', '));
  100. }
  101. });
  102.  
  103. clients[0].on('licenses', function(licenses) {
  104. console.log("Our account owns " + licenses.length + " license" + (licenses.length == 1 ? '' : 's') + ".");
  105. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement