|
|
@ -23,20 +23,30 @@ class UserInfo { |
|
|
|
this.amount = 0; |
|
|
|
this.USER_AGENT = Agent.GetUserAgent(); |
|
|
|
this.imei = ''; |
|
|
|
this.invitusers=[]; |
|
|
|
} |
|
|
|
|
|
|
|
async start () { |
|
|
|
await this.updateInfo(this.userid) |
|
|
|
if (this.imei) { |
|
|
|
//登录
|
|
|
|
await $.wait(200) |
|
|
|
await this.userLogin(this.imei); |
|
|
|
} |
|
|
|
|
|
|
|
//1. 获取邀请的数量,不够30个邀请到30个,每次邀请10个
|
|
|
|
var invitusers = await this.GetInvitUsers(this.userid); |
|
|
|
if (!invitusers) |
|
|
|
await this.GetInvitUsers(this.userid,0); |
|
|
|
if (!this.invitusers) |
|
|
|
return; |
|
|
|
if (invitusers.length <= 20) { |
|
|
|
this.InvitUsers(this.userid, 10); |
|
|
|
invitusers = await this.GetInvitUsers(this.userid); |
|
|
|
|
|
|
|
if (this.invitusers.length < 70) { |
|
|
|
await this.InvitMoreUser(this.userid, 70-this.invitusers.length); |
|
|
|
this.invitusers=[]; |
|
|
|
await this.GetInvitUsers(this.userid,0); |
|
|
|
} |
|
|
|
|
|
|
|
//2. 每个邀请账号刷红包提现
|
|
|
|
for (var user of invitusers) { |
|
|
|
for (var user of this.invitusers) { |
|
|
|
console.log(`\n=====开始用户:${user.userid} 每次刷满5000====`) |
|
|
|
this.amount = 0; |
|
|
|
this.imei=''; |
|
|
@ -84,11 +94,11 @@ class UserInfo { |
|
|
|
return sign |
|
|
|
} |
|
|
|
|
|
|
|
async GetInvitUsers (userid) { |
|
|
|
async GetInvitUsers (userid,page) { |
|
|
|
let url = 'http://dati.dspmz.com/idiomgame/?s=/InviCash/getRecord' |
|
|
|
let timestamp = + new Date() |
|
|
|
let sign = this.encrypt1(userid + timestamp + 0); |
|
|
|
let body = `&userId=${userid}&page=0&timeStamp=${timestamp}&sign=${sign}` |
|
|
|
let sign = this.encrypt1(userid + timestamp + page); |
|
|
|
let body = `&userId=${userid}&page=${page}&timeStamp=${timestamp}&sign=${sign}` |
|
|
|
let urlObject = populateUrlObject(url, body, this.USER_AGENT) |
|
|
|
let httpResultContext = {}; |
|
|
|
await httpRequest('post', urlObject, httpResultContext) |
|
|
@ -100,7 +110,9 @@ class UserInfo { |
|
|
|
//{"redcoupons":"291","addRed":261,"code":0}
|
|
|
|
if (result.success == 1) { |
|
|
|
console.log(`账号${userid} 邀请数为:${result.data.length}`); |
|
|
|
return result.data; |
|
|
|
this.invitusers.push(...result.data); |
|
|
|
if(result.data.length==30) |
|
|
|
await this.GetInvitUsers (userid,++page) |
|
|
|
} |
|
|
|
else { |
|
|
|
console.log(`账号${userid} 获取邀请数据错误: ${JSON.stringify(result)}`); |
|
|
@ -110,9 +122,9 @@ class UserInfo { |
|
|
|
} |
|
|
|
|
|
|
|
//邀请用户
|
|
|
|
async InvitUsers (usreid, count) { |
|
|
|
async InvitMoreUser (usreid, count) { |
|
|
|
for (let index = 0; index < count; index++) { |
|
|
|
USER_AGENT = Agent.GetUserAgent(); |
|
|
|
this.USER_AGENT = Agent.GetUserAgent(); |
|
|
|
await this.regtop(usreid); |
|
|
|
await $.wait(200) |
|
|
|
//注册行账号 并绑定支付宝账号
|
|
|
|