mirror of
https://github.com/smallfawn/QLScriptPublic.git
synced 2025-12-17 15:25:10 +08:00
广汽传祺ScriptV1.0
1.优化通知消息 2.简化部分代码
This commit is contained in:
38
gacmotor.js
38
gacmotor.js
@@ -25,7 +25,6 @@ let envSplitor = ["@", "\n"]; //多账号分隔符
|
|||||||
let strSplitor = "&"; //多变量分隔符
|
let strSplitor = "&"; //多变量分隔符
|
||||||
let userIdx = 0;
|
let userIdx = 0;
|
||||||
let userList = [];
|
let userList = [];
|
||||||
let msg = ""
|
|
||||||
class UserInfo {
|
class UserInfo {
|
||||||
constructor(str) {
|
constructor(str) {
|
||||||
this.index = ++userIdx;
|
this.index = ++userIdx;
|
||||||
@@ -36,6 +35,8 @@ class UserInfo {
|
|||||||
this.mallToken = str.split(strSplitor)[3];
|
this.mallToken = str.split(strSplitor)[3];
|
||||||
this.signInStatus = false//默认签到状态false
|
this.signInStatus = false//默认签到状态false
|
||||||
this.userIdStr = ""
|
this.userIdStr = ""
|
||||||
|
this.name = ""
|
||||||
|
this.GDouNum = ""
|
||||||
this.postList = []//自己
|
this.postList = []//自己
|
||||||
this.applatestlist = []//最新帖子列表
|
this.applatestlist = []//最新帖子列表
|
||||||
this.titleList = []//
|
this.titleList = []//
|
||||||
@@ -58,17 +59,14 @@ class UserInfo {
|
|||||||
|
|
||||||
}
|
}
|
||||||
async main() {
|
async main() {
|
||||||
console.log(`---------- 第[${this.index}]个账号执行开始 ----------`);
|
$.log(`==============开始第${this.index}个账号==============`)
|
||||||
await this._userInfo();
|
await this._userInfo();
|
||||||
if (this.ckStatus == true) {
|
if (this.ckStatus == true) {
|
||||||
|
|
||||||
if (process.env["gacmotorLuckyDram"] == undefined) {
|
if (process.env["gacmotorLuckyDram"] == undefined) {
|
||||||
console.log(`默认抽奖次数1`);
|
console.log(`默认抽奖次数1`);
|
||||||
await this._luckyDrawNum()//获取抽奖次数
|
await this._luckyDrawNum()//获取抽奖次数
|
||||||
if (this.luckyDrawNum > 1) {
|
if (this.luckyDrawNum > 1) {
|
||||||
await this._luckyDraw()
|
await this._luckyDraw()
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (process.env["gacmotorLuckyDram"] && Number(process.env["gacmotorLuckyDram"]) !== NaN) {
|
} else if (process.env["gacmotorLuckyDram"] && Number(process.env["gacmotorLuckyDram"]) !== NaN) {
|
||||||
if (process.env["gacmotorLuckyDram"] == 0) {
|
if (process.env["gacmotorLuckyDram"] == 0) {
|
||||||
@@ -236,7 +234,6 @@ class UserInfo {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
$.msg($.name, "", `---------- 第[${this.index}]个账号执行完毕 ----------`)
|
|
||||||
}
|
}
|
||||||
_MD5(str) {
|
_MD5(str) {
|
||||||
const crypto = require("crypto");
|
const crypto = require("crypto");
|
||||||
@@ -435,8 +432,7 @@ class UserInfo {
|
|||||||
let { body: result } = await httpRequest(options)
|
let { body: result } = await httpRequest(options)
|
||||||
result = JSON.parse(result)
|
result = JSON.parse(result)
|
||||||
if (result.code == "0000") {
|
if (result.code == "0000") {
|
||||||
console.log(`抽奖成功 获得${result.data.name}`);
|
$.log(`抽奖成功获得[${result.data.name}]`)
|
||||||
msg += `抽奖成功 获得${result.data.name}\n`
|
|
||||||
} else {
|
} else {
|
||||||
console.log(`抽奖失败`);
|
console.log(`抽奖失败`);
|
||||||
console.log(JSON.stringify(result));
|
console.log(JSON.stringify(result));
|
||||||
@@ -458,8 +454,7 @@ class UserInfo {
|
|||||||
let { body: result } = await httpRequest(options)
|
let { body: result } = await httpRequest(options)
|
||||||
result = JSON.parse(result)
|
result = JSON.parse(result)
|
||||||
if (result.code == "0000") {
|
if (result.code == "0000") {
|
||||||
console.log(`抽奖成功 获得${result.data.name}`);
|
$.log(`答题活动抽奖成功 获得[${result.data.name}]`)
|
||||||
msg += `抽奖成功 获得${result.data.name}\n`
|
|
||||||
} else {
|
} else {
|
||||||
console.log(`抽奖失败`);
|
console.log(`抽奖失败`);
|
||||||
console.log(JSON.stringify(result));
|
console.log(JSON.stringify(result));
|
||||||
@@ -728,8 +723,7 @@ class UserInfo {
|
|||||||
result = JSON.parse(result);
|
result = JSON.parse(result);
|
||||||
//console.log(result);
|
//console.log(result);
|
||||||
if (result.errorCode == "0") {
|
if (result.errorCode == "0") {
|
||||||
console.log(`助力执行成功 可能助力失败 正常情况`);
|
$.log(`助力执行成功 可能助力失败 正常情况`)
|
||||||
msg += `助力执行成功 可能助力失败 正常情况\n`
|
|
||||||
} else {
|
} else {
|
||||||
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
||||||
console.log(JSON.stringify(result));
|
console.log(JSON.stringify(result));
|
||||||
@@ -754,8 +748,8 @@ class UserInfo {
|
|||||||
if (result.resultCode == "0") {
|
if (result.resultCode == "0") {
|
||||||
this.mobile = Buffer.from(result.data.ms, 'base64').toString('utf-8');
|
this.mobile = Buffer.from(result.data.ms, 'base64').toString('utf-8');
|
||||||
Buffer.from(result.data.ms, 'base64').toString('utf-8');
|
Buffer.from(result.data.ms, 'base64').toString('utf-8');
|
||||||
msg += `[${result.data.mobile}][${result.data.nickname}][${result.data.userIdStr}]\n`
|
$.log(`[${result.data.mobile}][${result.data.nickname}][${result.data.userIdStr}]`)
|
||||||
console.log(`[${result.data.mobile}][${result.data.nickname}][${result.data.userIdStr}]`);
|
this.name = `昵称 [${result.data.nickname}]`
|
||||||
this.userIdStr = result.data.userIdStr;
|
this.userIdStr = result.data.userIdStr;
|
||||||
this.ckStatus = true
|
this.ckStatus = true
|
||||||
} else {
|
} else {
|
||||||
@@ -831,8 +825,8 @@ class UserInfo {
|
|||||||
result = JSON.parse(result);
|
result = JSON.parse(result);
|
||||||
//console.log(result);
|
//console.log(result);
|
||||||
if (result.resultCode == "0") {
|
if (result.resultCode == "0") {
|
||||||
msg += `抽奖成功获得[${result.data.medalName}]\n`
|
$.log(`抽奖成功获得[${result.data.medalName}]`)
|
||||||
console.log(`抽奖成功获得[${result.data.medalName}]`);
|
|
||||||
} else {
|
} else {
|
||||||
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
||||||
this.ckStatus = false
|
this.ckStatus = false
|
||||||
@@ -855,8 +849,8 @@ class UserInfo {
|
|||||||
result = JSON.parse(result);
|
result = JSON.parse(result);
|
||||||
//console.log(result);
|
//console.log(result);
|
||||||
if (result.resultCode == "0") {
|
if (result.resultCode == "0") {
|
||||||
msg += `当前G豆数量[${result.data}]\n`
|
this.GDouNum = `G豆 [${result.data}]`
|
||||||
console.log(`当前G豆数量[${result.data}]`);
|
$.log(`当前G豆数量[${result.data}]`)
|
||||||
} else {
|
} else {
|
||||||
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
||||||
console.log(JSON.stringify(result));
|
console.log(JSON.stringify(result));
|
||||||
@@ -930,8 +924,7 @@ class UserInfo {
|
|||||||
result = JSON.parse(result);
|
result = JSON.parse(result);
|
||||||
//console.log(result);
|
//console.log(result);
|
||||||
if (result.resultCode == "0") {
|
if (result.resultCode == "0") {
|
||||||
msg += `已经连续签到${result.data}天\n`
|
$.log(`已经连续签到${result.data}天`)
|
||||||
console.log(`已经连续签到${result.data}天`);
|
|
||||||
} else {
|
} else {
|
||||||
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
||||||
console.log(JSON.stringify(result));
|
console.log(JSON.stringify(result));
|
||||||
@@ -954,7 +947,7 @@ class UserInfo {
|
|||||||
result = JSON.parse(result);
|
result = JSON.parse(result);
|
||||||
//console.log(result);
|
//console.log(result);
|
||||||
if (result.resultCode == "0") {
|
if (result.resultCode == "0") {
|
||||||
console.log(`签到[${result.resultMsg}]`);
|
$.log(`签到[${result.resultMsg}]`)
|
||||||
} else {
|
} else {
|
||||||
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
||||||
console.log(JSON.stringify(result));
|
console.log(JSON.stringify(result));
|
||||||
@@ -1149,7 +1142,8 @@ async function start() {
|
|||||||
if (userList.length > 0) {
|
if (userList.length > 0) {
|
||||||
await start();
|
await start();
|
||||||
}
|
}
|
||||||
await SendMsg(msg)
|
$.msg($.name, "广汽传祺任务 Over", "--------------------")
|
||||||
|
await SendMsg($.logs.join("\n"))
|
||||||
})()
|
})()
|
||||||
.catch((e) => console.log(e))
|
.catch((e) => console.log(e))
|
||||||
.finally(() => $.done());
|
.finally(() => $.done());
|
||||||
|
|||||||
Reference in New Issue
Block a user