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 userIdx = 0;
|
||||
let userList = [];
|
||||
let msg = ""
|
||||
class UserInfo {
|
||||
constructor(str) {
|
||||
this.index = ++userIdx;
|
||||
@@ -36,6 +35,8 @@ class UserInfo {
|
||||
this.mallToken = str.split(strSplitor)[3];
|
||||
this.signInStatus = false//默认签到状态false
|
||||
this.userIdStr = ""
|
||||
this.name = ""
|
||||
this.GDouNum = ""
|
||||
this.postList = []//自己
|
||||
this.applatestlist = []//最新帖子列表
|
||||
this.titleList = []//
|
||||
@@ -58,17 +59,14 @@ class UserInfo {
|
||||
|
||||
}
|
||||
async main() {
|
||||
console.log(`---------- 第[${this.index}]个账号执行开始 ----------`);
|
||||
$.log(`==============开始第${this.index}个账号==============`)
|
||||
await this._userInfo();
|
||||
if (this.ckStatus == true) {
|
||||
|
||||
if (process.env["gacmotorLuckyDram"] == undefined) {
|
||||
console.log(`默认抽奖次数1`);
|
||||
await this._luckyDrawNum()//获取抽奖次数
|
||||
if (this.luckyDrawNum > 1) {
|
||||
await this._luckyDraw()
|
||||
} else {
|
||||
|
||||
}
|
||||
} else if (process.env["gacmotorLuckyDram"] && Number(process.env["gacmotorLuckyDram"]) !== NaN) {
|
||||
if (process.env["gacmotorLuckyDram"] == 0) {
|
||||
@@ -236,7 +234,6 @@ class UserInfo {
|
||||
}*/
|
||||
|
||||
}
|
||||
$.msg($.name, "", `---------- 第[${this.index}]个账号执行完毕 ----------`)
|
||||
}
|
||||
_MD5(str) {
|
||||
const crypto = require("crypto");
|
||||
@@ -435,8 +432,7 @@ class UserInfo {
|
||||
let { body: result } = await httpRequest(options)
|
||||
result = JSON.parse(result)
|
||||
if (result.code == "0000") {
|
||||
console.log(`抽奖成功 获得${result.data.name}`);
|
||||
msg += `抽奖成功 获得${result.data.name}\n`
|
||||
$.log(`抽奖成功获得[${result.data.name}]`)
|
||||
} else {
|
||||
console.log(`抽奖失败`);
|
||||
console.log(JSON.stringify(result));
|
||||
@@ -458,8 +454,7 @@ class UserInfo {
|
||||
let { body: result } = await httpRequest(options)
|
||||
result = JSON.parse(result)
|
||||
if (result.code == "0000") {
|
||||
console.log(`抽奖成功 获得${result.data.name}`);
|
||||
msg += `抽奖成功 获得${result.data.name}\n`
|
||||
$.log(`答题活动抽奖成功 获得[${result.data.name}]`)
|
||||
} else {
|
||||
console.log(`抽奖失败`);
|
||||
console.log(JSON.stringify(result));
|
||||
@@ -728,8 +723,7 @@ class UserInfo {
|
||||
result = JSON.parse(result);
|
||||
//console.log(result);
|
||||
if (result.errorCode == "0") {
|
||||
console.log(`助力执行成功 可能助力失败 正常情况`);
|
||||
msg += `助力执行成功 可能助力失败 正常情况\n`
|
||||
$.log(`助力执行成功 可能助力失败 正常情况`)
|
||||
} else {
|
||||
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
||||
console.log(JSON.stringify(result));
|
||||
@@ -754,8 +748,8 @@ class UserInfo {
|
||||
if (result.resultCode == "0") {
|
||||
this.mobile = 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`
|
||||
console.log(`[${result.data.mobile}][${result.data.nickname}][${result.data.userIdStr}]`);
|
||||
$.log(`[${result.data.mobile}][${result.data.nickname}][${result.data.userIdStr}]`)
|
||||
this.name = `昵称 [${result.data.nickname}]`
|
||||
this.userIdStr = result.data.userIdStr;
|
||||
this.ckStatus = true
|
||||
} else {
|
||||
@@ -831,8 +825,8 @@ class UserInfo {
|
||||
result = JSON.parse(result);
|
||||
//console.log(result);
|
||||
if (result.resultCode == "0") {
|
||||
msg += `抽奖成功获得[${result.data.medalName}]\n`
|
||||
console.log(`抽奖成功获得[${result.data.medalName}]`);
|
||||
$.log(`抽奖成功获得[${result.data.medalName}]`)
|
||||
|
||||
} else {
|
||||
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
||||
this.ckStatus = false
|
||||
@@ -855,8 +849,8 @@ class UserInfo {
|
||||
result = JSON.parse(result);
|
||||
//console.log(result);
|
||||
if (result.resultCode == "0") {
|
||||
msg += `当前G豆数量[${result.data}]\n`
|
||||
console.log(`当前G豆数量[${result.data}]`);
|
||||
this.GDouNum = `G豆 [${result.data}]`
|
||||
$.log(`当前G豆数量[${result.data}]`)
|
||||
} else {
|
||||
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
||||
console.log(JSON.stringify(result));
|
||||
@@ -930,8 +924,7 @@ class UserInfo {
|
||||
result = JSON.parse(result);
|
||||
//console.log(result);
|
||||
if (result.resultCode == "0") {
|
||||
msg += `已经连续签到${result.data}天\n`
|
||||
console.log(`已经连续签到${result.data}天`);
|
||||
$.log(`已经连续签到${result.data}天`)
|
||||
} else {
|
||||
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
||||
console.log(JSON.stringify(result));
|
||||
@@ -954,7 +947,7 @@ class UserInfo {
|
||||
result = JSON.parse(result);
|
||||
//console.log(result);
|
||||
if (result.resultCode == "0") {
|
||||
console.log(`签到[${result.resultMsg}]`);
|
||||
$.log(`签到[${result.resultMsg}]`)
|
||||
} else {
|
||||
console.log(`❌${options.fn}状态[${result.resultMsg}]`);
|
||||
console.log(JSON.stringify(result));
|
||||
@@ -1149,7 +1142,8 @@ async function start() {
|
||||
if (userList.length > 0) {
|
||||
await start();
|
||||
}
|
||||
await SendMsg(msg)
|
||||
$.msg($.name, "广汽传祺任务 Over", "--------------------")
|
||||
await SendMsg($.logs.join("\n"))
|
||||
})()
|
||||
.catch((e) => console.log(e))
|
||||
.finally(() => $.done());
|
||||
|
||||
Reference in New Issue
Block a user