Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var lastPos = 0;
- function exec_code(){
- var fs = require('fs');
- var child_process = require('child_process');
- //var lastPos = 0;
- function getFriends() {
- var friendsList = [];
- var friends = fs.readFileSync('usernames.txt');
- for (friend of friends.toString().split('n')) {
- friend = friend.replace('r', '');
- friendsList.push(friend);
- }
- return friendsList;
- }
- function getUsers() {
- var list = getFriends();
- var result = list.splice(lastPos, 94)
- lastPos+=94;
- return result;
- }
- function getProxList(cb) {
- var temp = [];
- fs.readFile('proxies.txt', (err, lines) => {
- if (err) throw err;
- for (p of lines.toString().split('n')) {
- temp.push({host: p.split(':')[0].replace('r', ''), port: p.split(':')[1].replace('r', '')});
- }
- cb(temp);
- });
- }
- fs.readFile('accounts.txt', (err, data) => {
- getProxList(function(proxList) {
- var timeout = 0;
- for (line of data.toString().split('n')) {
- var prox = proxList[Math.floor(Math.random() * proxList.length) + 1];
- var username = line.split(':')[0].replace('r', '');
- var password = line.split(':')[1].replace('r', '');
- //if (prox.host === undefined || prox.port === undefined) { continue; }
- var usersList = getUsers();
- (function(h, p, us, pp, l, t) {
- setTimeout(function() { // TEST IT
- console.log('Run: '+us);
- console.log('L: '+l);
- child_process.fork('./app.js', [h, p, us, pp, l]);
- }, t * 1000); // 5 sec
- })(prox.host, prox.port, username, password, usersList, timeout);
- timeout+=5; //60
- }
- });
- });
- // child_process.fork('./app.js', [username, password, friend.replace('r', '')]);
- }
- exec_code();
- setInterval(exec_code, 14400000)
- mzapc@mzabox ~/casper/test/works_Adder_without_delay
- $ node start.js
- C:cygwin64homemzapccaspertestworks_Adder_without_delaystart.js:55
- })(prox.host, prox.port, username, password, usersList, timeout);
- ^
- TypeError: Cannot read property 'host' of undefined
- at C:cygwin64homemzapccaspertestworks_Adder_without_delaystart.js:55:11
- at C:cygwin64homemzapccaspertestworks_Adder_without_delaystart.js:32:9
- at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement