Skip to content

Commit

Permalink
Version 2.0: Rewritten the bot
Browse files Browse the repository at this point in the history
  • Loading branch information
3urobeat authored Jan 25, 2022
2 parents 69e28aa + 5fed750 commit a1c9947
Show file tree
Hide file tree
Showing 16 changed files with 3,392 additions and 4,118 deletions.
6 changes: 2 additions & 4 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# These are supported funding model platforms

patreon: 3urobeat
custom: ["paypal.me/3urobeat", "blockchain.com/btc/address/18cEFztHAGfRGBEfGQKBJ2huQWpjrgv95A"] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
github: HerrEurobeat
custom: ["paypal.me/3urobeat"] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
mass-comment-bot.code-workspace
.eslintrc.json
output.txt
105 changes: 76 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,93 @@
<div align="center">
<h1 align="center">~ Steam Mass Comment Bot ~</h1>
<strong>Comment with a few clicks under a bunch of profiles!</strong><br />See how to set up the bot and customize it below.<br /><br />
<div align="center" markdown=1>
<p align="center"><img width=45% src="https://3urobeat.com/comment-bot/steamLogo.png"></p>
<strong>Comment with a few clicks under a ton of steam profiles & groups!</strong>
<br>See how to set up the bot and customize it below.<br>
<p></p>
</div>

**If you want, you can donate a few bucks on my [Patreon](https://www.patreon.com/3urobeat) or [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VAVVKE4L962H6&source=url)! I would really appreciate it!**
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[![nodejs](https://img.shields.io/badge/node.js-v14-brightgreen)](https://nodejs.org/)
[![Star](https://img.shields.io/badge/-Give%20this%20repo%20a%20star!-yellow)](https://github.com/HerrEurobeat/steam-mass-comment-bot)
[![Steam Group](https://img.shields.io/badge/Steam%20Group-Join!-blue)](https://steamcommunity.com/groups/3urobeatGroup)
[![Donate](https://img.shields.io/badge/donate-%241-orange)](https://paypal.me/3urobeat)
<p align="center">Click on a badge to learn more.</p>

This bot features two customizeable arrays/lists, one for all steamIDs of the profiles were the bot will comment and one for a selection of comments.
You can either choose to leave the same comment under each profile or select a random comment for each profile.
Continue reading for a detailed setup guide.
&nbsp;

## Requirements
**Disclaimer!**
> I, the developer, am not responsible and cannot be held liable for what you do with this bot.
> Please don't misuse this bot by spamming or posting malicious comments. Your accounts can get banned from Steam if you do that.
&nbsp;

- `node` (https://nodejs.org)
## **Download:**
Click here: [Download](https://github.com/HerrEurobeat/steam-mass-comment-bot/archive/master.zip)
Extract the zip and open the `steam-mass-comment-bot` folder.

You need to have at least node.js version 14.15.0 installed: [Download](https://nodejs.org)
To check your version number if you already have node installed, type `node --version` in your console or terminal.

Only necessary if you want to download via command prompt:
- `git` command line ([Windows](https://git-scm.com/download/win)|[Linux](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)|[MacOS](https://git-scm.com/download/mac)) installed
&nbsp;

## Downloading
## **Setup:**

Click here: [Download](https://github.com/HerrEurobeat/steam-bots/archive/master.zip)
Extract the zip and open the `mass-comment-bot` folder.
Open `logininfo.json` with a text editor and fill in the username and password of your account into the provided brackets.
Save and exit.

## Setting the bot up
**The login data will _only_ be used to leave comments under the profiles and groups set in `config.json` with one of the provided comments in `comments.txt`.**

Rename the `logininfo.json.example` to `logininfo.json`.
Open the file with a text editor and fill out the user name and password brackets with your steam login data.
Open `config.json` with a text editor.
Put in the profile links or steamID64s you want to comment on into the `profiles` array.
Put in the group links or steamID64s you want to comment in into the `groups` array.

Make sure you are following this syntax when filling the arrays:
```
"profiles": [
"ID1",
"steamcommunity.com/id/name2",
"https://steamcommunity.com/profiles/ID3"
]
```

**The login data will _only_ be used to leave comments under the profiles of the provided steamIDs with one of the provided comments.**
Take a look below at *Troubleshooting* if you experience issues.

Open `index.js` with a text editor. At the top of the file will be two arrays/lists, called `steamIDsToCommentOn` and `comments`.
Fill out the two arrays like explained in the comments above the two arrays.
If you want to set a custom status and play games when running the bot, fill in the `playingGames` array in the config.
The array works like this: `["custom game text", game id, game id]`
Empty the array (like this `"playingGames": []`) if the bot should not change your online appearance.

If the bot should respond with a message if someone messages you while the bot is running, set a message as `afkMessage`.
Empty the brackets (like this `"afkMessage": ""`) to disable the feature.

The bot is now setup. It will work through the steamIDs from top to bottom and leave a comment on each profile with a delay of 5 seconds.
This delay shouldn't get you a cooldown from steam for too many comments but if it will happen the bot will stop and give you an array of all remaining/failed profiles. You can retry them later.
Everything in the console will be saved to output.txt!
The `commentdelay` value sets the time in ms the bot should wait between comments. I suggest leaving it at the default value.
Setting it too low will result in cooldown errors because Steam considers your account as spamming.
Should you recieve cooldown errors with the default values, increase the value and try again.

## Starting the bot
&nbsp;

To start the bot, double click run.bat on windows or open a command prompt or power shell and navigate to the bot folder and type:
`node index.js`
## **Starting the bot:**

If you have the Steam Guard enabled, the bot will ask for your authenticator code.
The bot will now start and you should see him starting to work!
Please open a console window or terminal in the current folder.
Run the command `npm install` and wait for it to complete. This will install al necessary packages for the bot.

When done, type `node index.js` to start the bot.
It should log into your account, ask for a Steam Guard code if necessary, and start commenting on each profile and group you set in `config.json` after eachother.

If you are on Windows and don't know how to open a console window in the current folder:
- Open the folder of the bot with your Explorer
- Click on the blue `File` button in in the top left
- Click on the `Open PowerShell` or `Open CMD` entry and a console window should appear

&nbsp;

## **Troubleshooting:**

If you don't follow the syntax from above you will get an error because the bot is unable to read the file.
If you are getting a syntax mistake error then check for these common mistakes:
- forgot to add a comma to the end of the line?
- the very last line must not have a comma (look at the example above)
- forgot brackets `"` when writing something?

&nbsp;
If you get another error or have questions, please [open an issue here](https://github.com/HerrEurobeat/steam-mass-comment-bot/issues/new).
Everything that appears in your console/terminal window will also be saved to the `output.txt` file. Please attach the content of your last run to your issue to make it easier for me to troubleshoot.

If a error should happen it will be saved in the output.txt. You can open a new issue on GitHub and post the error with description here.
3 changes: 3 additions & 0 deletions comments.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
+rep
+rep good player
Have a nice day!
11 changes: 11 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"profiles": [
""
],
"groups": [
""
],
"commentdelay": 7500,
"playingGames": ["Idling", 440, 730],
"afkMessage": "Hi, I'm idling."
}
138 changes: 19 additions & 119 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,119 +1,19 @@
//Customizeable variables:
//Add all profile IDs like this: ["ID1","ID2","ID3"] You can press enter after every comma so that the id's are underneath each other or do it like in the example.
const steamIDsToCommentOn = [
"ID1",
"ID2",
"ID3"
]

//Add just one Comment inside the brackets to only post this specific comment on all profiles.
//Add different comments like ["Comment1","Comment2","Comment3"] to randomly select a comment for each profile.
const comments = ["Comment1","Comment2","Comment3"];
//End

const SteamUser = require('steam-user');
const SteamCommunity = require('steamcommunity');
const fs = require('fs')

const bot = new SteamUser();
const community = new SteamCommunity();

const logininfo = require('./logininfo.json');
const d = function d() { return new Date(); }
var randomstring = arr => arr[Math.floor(Math.random() * arr.length)];
function logger(string) {
console.log(string)
fs.appendFileSync("./output.txt", string + "\n", err => {
if (err) console.log("error: " + err)
});
}

const bootstart = d()
const version = "1.0"
const cooldown = 5000;
const steamIDsToCommentOnlength = steamIDsToCommentOn.length;

const logOnOptions = {
accountName: logininfo.accountName,
password: logininfo.password,
};

bot.logOn(logOnOptions);

//Startup
bot.on('loggedOn', () => {
logger(' ')
logger(' ')
fs.appendFileSync('./output.txt', 'All IDs: [\n')
steamIDsToCommentOn.forEach(function(element) {
fs.appendFileSync('./output.txt', '"' + element + '",\n')
});
fs.appendFileSync('./output.txt', ']')
logger(' ')
logger('*---------------------*')
logger('Bot ' + version + ' successfully logged in.');
logger(d())
logger('Console output and steamID array can be found in output.txt!')
const bootend = d() - bootstart
logger('Ready after ' + bootend + 'ms!')
logger('*---------------------*')
logger(' ')
logger('Waiting ' + cooldown + 'ms between each comment.')
logger('Starting in 5 seconds...')
setTimeout(() => {
logger(' ')

//Commenting
steamIDsToCommentOn.forEach((steamID, index) => {
setTimeout(() => {
var comment = randomstring(comments)
logger('Commenting ' + comment + ' on ' + steamID + ' (' + (index + 1) + '/' + steamIDsToCommentOnlength + ')')

community.postUserComment(steamID, comment, (error) => {
if(error !== null) {
logger("postUserComment error: " + error);
if (error == "Error: HTTP error 429") {
logger(" ")
logger("Skipped remaining accounts because of comment cooldown! You can retry them later!")
logger('*---------------------*')
logger("steamID's of failed or skipped comments: [\n")
steamIDsToCommentOn.forEach(function(element) {
logger('"' + element + '",\n');
});
logger("]")
logger('*---------------------*')
logger('Check output.txt! Quitting in 5 seconds...')
setTimeout(() => {
process.exit();
}, 5000)
}
} else {
steamIDsToCommentOn.shift(); //Remove first entry of array if there were no errors
}
});

if (index >= (steamIDsToCommentOnlength - 1)) {
logger("Finished commenting!")
if (steamIDsToCommentOn.length <= 1) {
logger("There were no failed comments!")
} else {
logger("Check output.txt!")
logger("steamID's of failed or skipped comments: [\n")
steamIDsToCommentOn.forEach(function(element) {
logger('"' + element + '",\n');
});
logger("]")
}
logger('Quitting in 5 seconds...')
setTimeout(() => {
process.exit();
}, 5000)
}
}, cooldown*index);
});
}, 5000)
});

bot.on("webSession", (sessionID, cookies) => {
community.setCookies(cookies);
});
/*
* File: index.js
* Project: mass-comment-bot
* Created Date: 11.08.2019 12:10:00
* Author: 3urobeat
*
* Last Modified: 23.01.2022 13:36:59
* Modified By: 3urobeat
*
* Copyright (c) 2022 3urobeat <https://github.com/HerrEurobeat>
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/


//Abfahrt!
require("./src/bot.js").run();
6 changes: 3 additions & 3 deletions logininfo.json.example → logininfo.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"accountName": "",
"password": ""
{
"accountName": "",
"password": ""
}
Empty file removed output.txt
Empty file.
Loading

0 comments on commit a1c9947

Please sign in to comment.