From e8d799730b3dbfea851e63dded1baac10e593161 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Thu, 17 Dec 2020 14:50:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=91=87=E9=92=B1=E6=A0=91=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=94=B9=E6=88=90=E9=BB=98=E8=AE=A4=E4=B8=8D=E5=8D=96=E5=87=BA?= =?UTF-8?q?=E9=87=91=E6=9E=9C=E5=BE=97=E9=87=91=E5=B8=81(=E9=87=91?= =?UTF-8?q?=E5=B8=81=E6=9C=89=E6=97=B6=E6=95=88=EF=BC=8C=E4=BC=9A=E8=BF=87?= =?UTF-8?q?=E6=9C=9F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- githubAction.md | 2 +- jd_moneyTree.js | 11 ++++++----- lxk0301.boxjs.json | 7 +++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/githubAction.md b/githubAction.md index 6f9409fe..8d27ea71 100644 --- a/githubAction.md +++ b/githubAction.md @@ -114,7 +114,7 @@ | `DREAM_FACTORY_SHARE_CODES`| 京喜工厂互助码 | 非必须 | 填写规则请看 [jdDreamFactoryShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdDreamFactoryShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) | | `TG_PROXY_HOST` | Telegram 代理的 IP | 非必须 | 代理类型为 http。例子:http代理 http://127.0.0.1:1080 则填写 127.0.0.1 | | `TG_PROXY_PORT` | Telegram 代理的端口 | 非必须 | 例子:http代理 http://127.0.0.1:1080 则填写 1080 | -| `MONEY_TREE_SELL_FRUIT` | 摇钱树是否卖出金果 | 非必须 | 控制摇钱树脚本是否自动卖出金果兑换成金币,`true`卖出,`false`不卖出,默认`true` | +| `MONEY_TREE_SELL_FRUIT` | 摇钱树是否卖出金果 | 非必须 | 控制摇钱树脚本是否自动卖出金果兑换成金币,`true`卖出,`false`不卖出,默认`false` | | `FACTORAY_WANTPRODUCT_NAME` | 东东工厂心仪商品 | 非必须 | 提供心仪商品名称(请尽量填写完整和别的商品有区分度),达到条件后兑换,如不提供则会兑换当前所选商品 | | `WATCH_ACCEPTBODY` | 京东看一看(jd_watch.js)脚本 | 非必须 | 抓包`functionId=discAcceptTask`(需40个,每个之间使用@符号隔开) | | `WATCH_DOBODY` | 京东看一看(jd_watch.js)脚本 | 非必须 | 抓包`functionId=discDoTask`(需40个,每个之间使用@符号隔开) | diff --git a/jd_moneyTree.js b/jd_moneyTree.js index 4ad187f2..584810b9 100644 --- a/jd_moneyTree.js +++ b/jd_moneyTree.js @@ -35,6 +35,7 @@ if ($.isNode()) { } let jdNotify = true;//是否开启静默运行,默认true开启 +let sellFruit = false;//是否卖出金果得到金币,默认'false'不卖 const JD_API_HOST = 'https://ms.jr.jd.com/gw/generic/uc/h5/m'; let userInfo = null, taskInfo = [], message = '', subTitle = '', fruitTotal = 0; !(async () => { @@ -262,11 +263,11 @@ function sell() { } params.riskDeviceParam = JSON.stringify(params.riskDeviceParam);//这一步,不可省略,否则提交会报错(和login接口一样) console.log(`目前金果数量${fruitTotal}`) - if ($.isNode()) { - if (process.env.MONEY_TREE_SELL_FRUIT && process.env.MONEY_TREE_SELL_FRUIT === 'false') { - rs() - return - } + sellFruit = $.isNode() ? (process.env.MONEY_TREE_SELL_FRUIT ? process.env.MONEY_TREE_SELL_FRUIT : `${sellFruit}`) : ($.getdata('MONEY_TREE_SELL_FRUIT') ? $.getdata('MONEY_TREE_SELL_FRUIT') : `${sellFruit}`); + if (sellFruit && sellFruit === 'false') { + console.log(`\n设置的不卖出金果\n`) + rs() + return } if (fruitTotal > 380) { request('sell', params).then((sellRes) => { diff --git a/lxk0301.boxjs.json b/lxk0301.boxjs.json index b19d008e..e14a4f05 100644 --- a/lxk0301.boxjs.json +++ b/lxk0301.boxjs.json @@ -574,6 +574,13 @@ "val": true, "type": "boolean", "desc": "运行京东摇钱树脚本时不发出系统弹窗通知" + }, + { + "id": "MONEY_TREE_SELL_FRUIT", + "name": "是否卖出金果获得金币", + "val": false, + "type": "boolean", + "desc": "是否卖出金果获得金币,金币具有有效期,默认不卖出" } ], "author": "@lxk0301",