Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global._mckay_statistics_opt_out = true;
- // CONFIG
- const timeout = 2000; // 2 second (2000 ms) delay between each chat message
- const message = `PUT
- HERE
- YOUR
- MESSAGE!`;
- const blacklist = [
- "765611900000000000",
- "765611900000000001",
- "765611900000000002"
- ];
- var credentials = {
- steam: {
- "accountName": "Xxx",
- "password": "*Xxx"
- /*},
- winauth: {
- "deviceid": "android:xxx",
- "shared_secret": "Xxx/xxx=",
- "identity_secret": "Xxx="*/
- }
- }
- // CODE
- const SteamUser = require("steam-user"),
- logger = require("datetime-logger"),
- client = new SteamUser();
- console.log = logger({ "filename": "log.txt" });
- if (credentials.hasOwnProperty("winauth")) {
- const SteamAuth = require("steamauth");
- SteamAuth.Sync(function(error) {
- if (error) console.log(error);
- var auth = new SteamAuth(credentials.winauth);
- auth.once("ready", function() {
- credentials.steam.twoFactorCode = auth.calculateCode();
- steamLogin();
- });
- });
- } else {
- steamLogin();
- }
- function steamLogin() {
- credentials.steam.rememberPassword = true;
- credentials.steam.logonID = Date.now();
- client.logOn(credentials.steam);
- client.on("loggedOn", function(response) {
- console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID());
- });
- client.on("error", function(error) {
- console.log(error);
- });
- client.on("friendsList", function() {
- var i = 0;
- for (var steamid in client.myFriends) {
- if (!blacklist.includes(steamid) && client.myFriends[steamid] === 3) {
- i++;
- setTimeout(function() {
- client.chatMessage(steamid, message);
- console.log("Successfully sent a steam chat message to " + steamid);
- }, i * timeout);
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement