OczkoSX Posted September 19, 2017 Report Posted September 19, 2017 Hi. I need to run many accounts (it may be even 100accs in the future) so I can't just copy methods and functions for every account. I was thinking about few solutions: 1) running separate instances of bot.js with given botID as a parameter (node bot.js [id]): - pretty easy - bots don't depend on each other, won't crash others 2) make a bot class and make an array: - if one bot crashes, the others too - easier then the first one Which one do you think? I would go with the first one. How can I launch many instances of an app? I would need to check length of .json file and then make a for-loop. Best regards Quote
Axle Posted September 19, 2017 Report Posted September 19, 2017 I would go with the first one. It's not quite as simple as making a bot class because you have to make sure that every steamcommunity function acted on each bot in parallel, which would obviously be difficult to do with that amount of bots (you might be able to create separate steamcommunity instances though I'm not very familiar with this). Also if you're running that many bots you will need to use proxies to avoid rate limits otherwise you will get screwed fast. OczkoSX 1 Quote
OczkoSX Posted September 19, 2017 Author Report Posted September 19, 2017 I would go with the first one. It's not quite as simple as making a bot class because you have to make sure that every steamcommunity function acted on each bot in parallel, which would obviously be difficult to do with that amount of bots (you might be able to create separate steamcommunity instances though I'm not very familiar with this). Also if you're running that many bots you will need to use proxies to avoid rate limits otherwise you will get screwed fast. And how would you run these instances? I need to check length of an array in .json file (bots' credentials) and then launch many bot.js with given id (node bot 0, node bot 1...node bot 90 etc.). I'm using PM2 Quote
Axle Posted September 19, 2017 Report Posted September 19, 2017 (edited) And how would you run these instances? I need to check length of an array in .json file (bots' credentials) and then launch many bot.js with given id (node bot 0, node bot 1...node bot 90 etc.). I'm using PM2I don't like running my bot daemonized so I just use screen but if you're running that many you will probably have to. There are several ways to do what you want, depending on how reusable/updatable you want it to be. The easiest would probably just to add a command line argument with the bot ID to your script. Then you can just edit one script to update all the bots, but they're not inherently reliant on each other. Of course you have to play with where everything is saving (poll data, etc.). To start all of the bots I would recommend just making a simple bash script, just use a for loop and change the id in the command line argument. Edited September 19, 2017 by Axle Quote
OczkoSX Posted September 19, 2017 Author Report Posted September 19, 2017 I was thinking about bash script, but I can't get a json array length the simple way. I was thinking about making .js file and spawning child processes? Quote
Axle Posted September 19, 2017 Report Posted September 19, 2017 (edited) I was thinking about bash script, but I can't get a json array length the simple way. I was thinking about making .js file and spawning child processes? Theres not too much reason for needing the actual array length in the script, you can just set it to for loop the amount of bots you would need to start. Obviously you would have to edit this to account for adding bots, but if you need to restart your scripts constantly I wouldn't recommend daemons in the first place. I was thnking of using it as a one time spawning script Edited September 19, 2017 by Axle Quote
OczkoSX Posted September 20, 2017 Author Report Posted September 20, 2017 So what you think? Calling shell script within pm2 start config file (altogether with other node files) and exec many pm2 start bot [id] from the script? Quote
Axle Posted September 20, 2017 Report Posted September 20, 2017 Thats what I would do, something like pm2 start bot.js -[bot #] in a bash script with each bot. I'm not familiar with where node-steam things saves stuff, so you might have problems with that initially. Quote
OczkoSX Posted September 20, 2017 Author Report Posted September 20, 2017 I will create separate poll data file for every bot, no problem with that. Thanks for all the responses, gonna ask here If I need further assistance Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.