Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const SteamUser = require('steam-user'); // Replace this with `require('steam-user');` if used outside of the module directory
- var client = new SteamUser();
- var username = "your_username";
- var password = "your_password";
- var message = "your message to new friends";
- // the amount of time in milliseconds that the bot waits between receiving friend request -> accepting friend request
- // and also between accepting friend request -> sending message (2000 = 2 seconds)
- var delay = 2000;
- client.logOn({
- "accountName": username,
- "password": password
- });
- client.on('loggedOn', function(details) {
- console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID());
- client.setPersona(SteamUser.EPersonaState.Online);
- });
- client.on('friendRelationship', (steamid, relationship) => {
- if (relationship === 2) {
- setTimeout(function() {
- client.addFriend(steamid);
- client.setNickname(steamid,"rl bot added")
- setTimeout(function() {
- client.chatMessage(steamid, message);
- console.log("added and replied to user: " + steamid)
- }, delay);
- }, delay);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement