From 9f5eeec36d8312eebc5c708d8d6ad659a453211c Mon Sep 17 00:00:00 2001 From: shanmite <1971513084@qq.com> Date: Mon, 7 Jun 2021 16:46:45 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 44 +++++++++++++++++++++++++++----------------- env.example.js | 17 +++++++++-------- main.js | 2 +- script/pkg/pkg.ps1 | 2 +- 4 files changed, 38 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index da0ca27..fc23d4e 100644 --- a/README.md +++ b/README.md @@ -65,28 +65,34 @@ Chrome浏览器: .forEach(it => copy(it) || console.log(it)) ``` -也可以采用**其他方式获取**所需的Cookie -只需含有 `DedeUserID=...;SESSDATA=...;bili_jct=...` 三项即可 -(分号分割, 不要换行, 顺序随意) +也可以采用**其他方式获取**所需的Cookie -↓↓ +只需含有 `DedeUserID=...;SESSDATA=...;bili_jct=...` 三项即可 + +(分号分割, 不要换行, 顺序随意) + +↓↓ ### 本地运行 具体操作详见[env.example.js](env.example.js)文件内注释 #### 可执行文件 -[可执行文件下载](https://github.com/shanmite/LotteryAutoScript/releases) +[下载](https://github.com/shanmite/LotteryAutoScript/releases) + +[cnpmjs镜像下载](https://github.com.cnpmjs.org/shanmite/LotteryAutoScript/releases) + +[Fastgit镜像下载](https://hub.fastgit.org/shanmite/LotteryAutoScript/releases) #### Windows -step1: 下载代码到本地 +step1: 下载代码到本地 [点此下载](https://github.com/shanmite/LotteryAutoScript/archive/refs/heads/main.zip)或如图示下载↓ ![点我加载下载操作图示](doc/pic/download.png) -下载的压缩包解压后修改env.example.js文件,详见step3 +下载的压缩包解压后修改env.example.js文件,详见step3 -step2: 下载并安装Node.js +step2: 下载并安装Node.js [点此进入nodejs下载页面](http://nodejs.cn/download) @@ -94,33 +100,37 @@ step2: 下载并安装Node.js step3:修改env.example.js文件及创建运行文件(打开扩展名显示) -1.step1下载的压缩包解压后将其中的`env.example.js`文件重命名为`env.js` +1.step1下载的压缩包解压后将其中的`env.example.js`文件重命名为`env.js` -2.右键`env.js`文件选择编辑或用记事本打开 +2.右键`env.js`文件选择编辑或用记事本打开 -3.填入相关参数 +3.填入相关参数 -4.运行 -注: `npm i`意味安装依赖, 只需运行一次, 为防止依赖有变化遂每次都执行 +4.运行 + +注: `npm i`意味安装依赖, 只需运行一次, 为防止依赖有变化遂每次都执行 + +命令一: 启动抽奖 -命令一: 启动抽奖 ```bash npm i && npm run start ``` -命令二: 检查中奖 +命令二: 检查中奖 + ```bash npm i && npm run check ``` -命令三: 清理动态 +命令三: 清理动态 + ```bash npm i && npm run clear ``` `script`目录下有启动脚本, 点击即可运行 -注: **本地运行时可在设置中增大扫描页数** +注: **本地运行时可在设置中增大扫描页数** > [windows系统定时运行](./doc/win_schedule.md) diff --git a/env.example.js b/env.example.js index 76c05a0..db8ffd6 100644 --- a/env.example.js +++ b/env.example.js @@ -4,15 +4,16 @@ */ /** - * ## 账号相关参数 - * `COOKIE` 是必填项 - * `NUMBER` 表示是第几个账号 - * `PAT` 与 `GITHUB_REPOSITORY` 如果之前在Github Action上运行过脚本, 可填写已下载转发过的动态dyid, 之后可移除 + * ## 账号相关参数 + * - `COOKIE` 是必填项 + * - `NUMBER` 表示是第几个账号 + * - `PAT` 与 `GITHUB_REPOSITORY` 如果之前在Github Action上运行过脚本, 可填写已下载转发过的动态dyid, 之后可移除 + * + * ## 多账号 + * 1. 将 ENABLE_MULTIPLE_ACCOUNT 的值改为true + * 2. 将账号信息依次填写于 multiple_account_parm 中, 参考例子类推 + * - `WAIT` 表示下一个账号运行等待时间(毫秒) * - * ## 多账号 - * 将 ENABLE_MULTIPLE_ACCOUNT 的值改为true - * 将账号信息依次填写于 MULTIPLE_ACCOUNT 中, 参考例子类推 - * `WAIT` 表示下一个账号运行等待时间(毫秒) * **按顺序依次执行, 防止访问频繁封禁IP** */ const account_parm = { diff --git a/main.js b/main.js index cacfdda..0a329dc 100644 --- a/main.js +++ b/main.js @@ -57,7 +57,7 @@ async function main() { break; default: console.log(`Usage: lottery-in-bili [OPTIONS]`) - console.log(`错误OPTIONS: ${mode}`); + console.log(`错误OPTIONS: ${mode} 正确OPTIONS: start,check,clear`); } } } else { diff --git a/script/pkg/pkg.ps1 b/script/pkg/pkg.ps1 index 2594156..e81c0ba 100644 --- a/script/pkg/pkg.ps1 +++ b/script/pkg/pkg.ps1 @@ -19,7 +19,7 @@ Move-Item -Path "env.example.js" -Destination $ENV_FILE -Force foreach($X64 in $MAP.Keys) { $BIN = $MAP[$X64] - if (!(Test-Path $X64 -PathType Container)) { + if (!(Test-Path $X64 -PathType Container)) { New-Item -ItemType Directory -Force -Path $X64 } Move-Item -Path $BIN -Destination $X64 -Force