Advertisement
Guest User

Untitled

a guest
Feb 28th, 2018
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. global._mckay_statistics_opt_out = true;
  2.  
  3. // CONFIG
  4. const timeout = 2000; // 2 second (2000 ms) delay between each chat message
  5. const message = `PUT
  6. HERE
  7. YOUR
  8. MESSAGE!`;
  9. const blacklist = [
  10. "765611900000000000",
  11. "765611900000000001",
  12. "765611900000000002"
  13. ];
  14. var credentials = {
  15. steam: {
  16. "accountName": "Xxx",
  17. "password": "*Xxx"
  18. /*},
  19. winauth: {
  20. "deviceid": "android:xxx",
  21. "shared_secret": "Xxx/xxx=",
  22. "identity_secret": "Xxx="*/
  23. }
  24. }
  25.  
  26. // CODE
  27. const SteamUser = require("steam-user"),
  28. logger = require("datetime-logger"),
  29. client = new SteamUser();
  30.  
  31. console.log = logger({ "filename": "log.txt" });
  32. if (credentials.hasOwnProperty("winauth")) {
  33. const SteamAuth = require("steamauth");
  34. SteamAuth.Sync(function(error) {
  35. if (error) console.log(error);
  36. var auth = new SteamAuth(credentials.winauth);
  37. auth.once("ready", function() {
  38. credentials.steam.twoFactorCode = auth.calculateCode();
  39. steamLogin();
  40. });
  41. });
  42. } else {
  43. steamLogin();
  44. }
  45.  
  46. function steamLogin() {
  47. credentials.steam.rememberPassword = true;
  48. credentials.steam.logonID = Date.now();
  49. client.logOn(credentials.steam);
  50. client.on("loggedOn", function(response) {
  51. console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID());
  52. });
  53. client.on("error", function(error) {
  54. console.log(error);
  55. });
  56. client.on("friendsList", function() {
  57. var i = 0;
  58. for (var steamid in client.myFriends) {
  59. if (!blacklist.includes(steamid) && client.myFriends[steamid] === 3) {
  60. i++;
  61. setTimeout(function() {
  62. client.chatMessage(steamid, message);
  63. console.log("Successfully sent a steam chat message to " + steamid);
  64. }, i * timeout);
  65. }
  66. }
  67. });
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement