From e6540ec5c6b4a83b071d482839e4698b4c17efc4 Mon Sep 17 00:00:00 2001 From: smallfawn <101914820+smallfawn@users.noreply.github.com> Date: Mon, 20 Nov 2023 22:57:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=BF=E6=B1=BD=E4=BC=A0=E7=A5=BA=E6=96=B0?= =?UTF-8?q?=E7=89=88=EF=BC=9A=E4=BC=98=E5=8C=96=E6=8A=BD=E5=A5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gacmotor.js | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/gacmotor.js b/gacmotor.js index 16a4742..ba9072c 100644 --- a/gacmotor.js +++ b/gacmotor.js @@ -5,7 +5,7 @@ * @tips 本脚本适用于广汽传祺5.0.0以上的版本 * 变量名: gacmotorToken https://next.gacmotor.com/app 域名下 headers 中 appToken & deviceCode & registrationID 多账@ * gacmotorPost=false 默认关闭发表文章功能 true为开启(此功能存在风控检测,谨慎开启) - * gacmotorLuckyDram=1 抽奖次数 不写默认抽奖一次(首次免费) 以后每次花费2G豆抽奖 + * gacmotorLuckyDram=1 抽奖次数[1-10] 不写默认抽奖一次(首次免费) 以后每次花费2G豆抽奖 每天上限10次 */ const $ = new Env("广汽传祺"); @@ -105,17 +105,33 @@ class UserInfo { console.log(`---------- 第[${this.index}]个账号执行开始 ----------`); await this._userInfo(); if (this.ckStatus == true) { + if (process.env["gacmotorLuckyDram"] == undefined) { console.log(`默认抽奖次数1`); await this._luckyDraw() } else if (process.env["gacmotorLuckyDram"] && Number(process.env["gacmotorLuckyDram"]) !== NaN) { - console.log(`已设置抽奖次数 执行${process.env["gacmotorLuckyDram"]}次抽奖`); - for (let index = 0; index < Number(process.env["gacmotorLuckyDram"]); index++) { - $.wait(1000) - await this._luckyDraw() - $.wait(2000) + if (process.env["gacmotorLuckyDram"] == 0) { + console.log(`抽奖次数为0 不执行抽奖`); + } else { + if (Number(process.env["gacmotorLuckyDram"]) > 10) { + console.log(`每天最高抽10次哦`); + for (let index = 0; index < 10; index++) { + $.wait(1000) + await this._luckyDraw() + $.wait(2000) + } + } else { + console.log(`已设置抽奖次数 执行${process.env["gacmotorLuckyDram"]}次抽奖`); + for (let index = 0; index < Number(process.env["gacmotorLuckyDram"]); index++) { + $.wait(1000) + await this._luckyDraw() + $.wait(2000) + } + } + } + } await this._getGDou() await this._signInStatus()