Hey everyone, I'll first give you a background story so you get an idea of what I'm trying to do. I'm interested in adding 100 accounts in one steam group all done by a bot. I succesfully made myself a bot that creates a random generated username and password saved in a .txt file on my Desktop. What I want to do now is either make it so when I create a Steam Account it will automatically join the group OR I make a bot that scrapes all the username:password logins from that .txt file and logs in on them and joins my group. I think the first option is way easier, that's why I tried it;
const SteamUser = require("steam-user");
const SteamCommunity = require("steamcommunity");
const client = new SteamUser();
const community = new SteamCommunity();
var colors = require("colors");
var fs = require("fs");
var groupID64 = "103582791458129100";
var Username = "username" + String(Math.trunc(Math.random() * 1000000));
var Password = "password" + String(Math.trunc(Math.random() * 1000000));
const SteamID = require("steamid");
const groupID = new SteamID(groupID64);
client.logOn();
client.on("loggedOn", () => {
console.log("Logged into Steam".cyan);
client.createAccount(Username, Password, "
[email protected]", function(result){
if (result === 1) {
fs.appendFile("Desktop/text.txt", Username + ":" + Password + "\n", function(err) {
if(err) {
console.log(err);
} else {
console.log(Username + ":" + Password + " - Saved.".green);
client.logOff(); // NOT WORKING?
console.log("Logging off Steam".red);
const logOnOptions = {
accountName: Username,
password: Password
};
client.logOn(logOnOptions);
client.on("loggedOn", () => {
console.log("Logged into Steam".green);
client.gamesPlayed("BOT Testing");
community.getSteamGroup(groupID, function(err, group) {
group.join(function(err) {
if (err) console.log('error', err);
});
});
});
//process.exit(1)
}
});
} else {
console.log("ERROR: ".red + result);
process.exit(1)
}
});
});
This outputs:
Logged into Steam
username625656:password356952 - Saved.
Logging off Steam
C:\Users\Admin\node_modules\steam-user\components\logon.js:11
throw new Error("Already logged on, cannot log on again");
^
Error: Already logged on, cannot log on again
at SteamUser.logOn (C:\Users\Admin\node_modules\steam-user\components\logon.js:11:9)
at C:\Users\Admin\account-maker.js:33:13
at FSReqWrap.oncomplete (fs.js:123:15)
My guess is that my client.logOff(); doesn't work. Is there a way to fix this? Regards lad