You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB
JavaScript

const BingAuto2 = require('./bingauto2')
let sleep = (sec) => {
return new Promise(resolve => setTimeout(resolve, sec * 1000));
}
let main = async () => {
let accounts = [['nemobaki@hotmail.com', 'Rhlehvkd26'], ['yirugi@hotmail.com', 'Dlfnzl26'], ['rosemarymulti2@outlook.com', 'fhwmakfl2'], ['kim.iluk@hotmail.com', 'Dlfnzl26']];
// accounts = accounts.splice(2);
for (let account of accounts) {
let ba = new BingAuto2(account[0], account[1], true);
console.log('Start collection (' + account[0] + ') -', new Date().toLocaleString());
try {
await ba.startBrowser();
await ba.newMainPage();
let curPoint = await ba.getRewardPoint();
for (let i = 0; i < 2; i++) {
await ba.doDailyReward();
await ba.doAllSearch();
}
let earned = await ba.getRewardPoint() - curPoint;
console.log('> Earned : ', earned);
console.log('End collection (' + account[0] + ') -', new Date().toLocaleString());
console.log('\n\n');
} catch (e) {
console.log('Error: ', e);
} finally {
await ba.close();
}
await sleep(100);
}
}
main();