shawenguan 2 lat temu
rodzic
commit
b313b62f51

+ 119 - 4
BoxJsSub/JoJo_BoxJs.json

@@ -22,6 +22,10 @@
           "script": "https://git.jojo21.cf/shawenguan/Quantumult-X/raw/master/Scripts/gandart/gandartOrder.js"
         },
         {
+          "name": "极速锁单",
+          "script": "https://git.jojo21.cf/shawenguan/Quantumult-X/raw/master/Scripts/gandart/gandartLock.js"
+        },
+        {
           "name": "极速合成(或置换)",
           "script": "https://git.jojo21.cf/shawenguan/Quantumult-X/raw/master/Scripts/gandart/gandartComposite.js"
         },
@@ -136,6 +140,117 @@
           "desc": "默认关闭锁定"
         },
         {
+          "id": "lkGandartPrivWalletListInUse",
+          "name": "付款钱包",
+          "val": "A,B,C",
+          "type": "checkboxes",
+          "desc": "付款钱包,如产品不支持当前所选钱包则不会下单",
+          "items": [
+            {
+              "key": "A",
+              "label": "钱包A"
+            },
+            {
+              "key": "B",
+              "label": "钱包B"
+            },
+            {
+              "key": "C",
+              "label": "钱包C"
+            }
+          ]
+        },
+        {
+          "id": "lkGandartCastingId",
+          "name": "产品铸造品类ID",
+          "val": "",
+          "type": "text",
+          "desc": "产品铸造品类ID"
+        },
+        {
+          "id": "lkGandartCollectionName",
+          "name": "产品名称",
+          "val": "",
+          "type": "text",
+          "desc": "产品名称"
+        },
+        {
+          "id": "lkGandartLimitPrice",
+          "name": "捡漏最高价格",
+          "val": 0,
+          "type": "text",
+          "desc": "捡漏最高价格"
+        },
+        {
+          "id": "lkGandartFloatPriceIntaval",
+          "name": "价格浮动限制",
+          "val": 10,
+          "type": "number",
+          "desc": "价格浮动限制"
+        },
+        {
+          "id": "lkGandartCollectionCateLst",
+          "name": "产品列表",
+          "val": "[]",
+          "autoGrow": true,
+          "type": "textarea",
+          "desc": "产品列表"
+        }
+      ]
+    },
+    {
+      "id": "lkGandartLocker",
+      "name": "光予锁单",
+      "author": "@jojo",
+      "repo": "https://git.jojo21.cf/shawenguan/Quantumult-X/raw/master/Scripts/gandart/gandartLock.js",
+      "script": "https://git.jojo21.cf/shawenguan/Quantumult-X/raw/master/Scripts/gandart/gandartLock.js",
+      "icons": [
+        "https://git.jojo21.cf/shawenguan/Quantumult-X/raw/master/Images/gandart.png",
+        "https://git.jojo21.cf/shawenguan/Quantumult-X/raw/master/Images/gandart.png"
+      ],
+      "keys": [
+        "lkGandartToken",
+        "lkGandartLockCastingId",
+        "lkGandartLockCollectionName",
+        "lkGandartLockViewSort"
+      ],
+      "settings": [
+        {
+          "id": "lkIsEnableLogGandartLockerCheckIn",
+          "name": "开启/关闭日志",
+          "val": true,
+          "type": "boolean",
+          "desc": "默认开启"
+        },
+        {
+          "id": "lkNotifyOnlyFailGandartLockerCheckIn",
+          "name": "只当执行失败才通知",
+          "val": false,
+          "type": "boolean",
+          "desc": "默认关闭"
+        },
+        {
+          "id": "lkIsEnableTgNotifyGandartLockerCheckIn",
+          "name": "开启/关闭通知",
+          "val": false,
+          "type": "boolean",
+          "desc": "默认关闭"
+        },
+        {
+          "id": "lkTgNotifyUrlGandartLockerCheckIn",
+          "name": "通知地址",
+          "val": "",
+          "type": "text",
+          "desc": "Tg的通知地址,如:https://api.telegram.org/bot-token/sendMessage?chat_id=-100140&parse_mode=Markdown&text="
+        },
+        {
+          "id": "lkIsGandartCollectionWatchLocked",
+          "name": "开启/关闭锁定监控产品",
+          "val": false,
+          "type": "boolean",
+          "desc": "默认关闭锁定"
+        },
+        {
           "id": "lkGandartCastingId",
           "name": "产品铸造品类ID",
           "val": "",
@@ -190,28 +305,28 @@
       ],
       "settings": [
         {
-          "id": "lkIsEnableLogGandartOrdererCheckIn",
+          "id": "lkIsEnableLogGandartCompositerCheckIn",
           "name": "开启/关闭日志",
           "val": true,
           "type": "boolean",
           "desc": "默认开启"
         },
         {
-          "id": "lkNotifyOnlyFailGandartOrdererCheckIn",
+          "id": "lkNotifyOnlyFailGandartCompositerCheckIn",
           "name": "只当执行失败才通知",
           "val": false,
           "type": "boolean",
           "desc": "默认关闭"
         },
         {
-          "id": "lkIsEnableTgNotifyGandartOrdererCheckIn",
+          "id": "lkIsEnableTgNotifyGandartCompositerCheckIn",
           "name": "开启/关闭通知",
           "val": false,
           "type": "boolean",
           "desc": "默认关闭"
         },
         {
-          "id": "lkTgNotifyUrlGandartOrdererCheckIn",
+          "id": "lkTgNotifyUrlGandartCompositerCheckIn",
           "name": "通知地址",
           "val": "",
           "type": "text",

+ 3 - 2
Scripts/gandart/gandartComposite.js

@@ -17,7 +17,7 @@ const config = {
     "CORECENTER_URL": "https://api.gandart.com/corecenter"
 };
 
-const lk = new ToolKit(`光予合成手`, `GandartCompostier`, `gandartComposite.js`);
+const lk = new ToolKit(`光予合成手`, `GandartCompositor`, `gandartComposite.js`);
 
 const GandartConstKey = {
     // -----通用助手相关的-----
@@ -49,6 +49,7 @@ const GandartConstKey = {
 };
 
 let gandartToken = lk.getVal(GandartConstKey.Token, '');
+let gandartUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1`;
 
 const GCommonGandartHeads = {
     'Accept': `application/json, text/plain, */*`,
@@ -57,7 +58,7 @@ const GCommonGandartHeads = {
     'Content-Type': `application/x-www-form-urlencoded;charset=UTF-8`,
     'Connection': `keep-alive`,
     'Host': `api2.gandart.com`,
-    'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1`,
+    'User-Agent': gandartUserAgent,
     'Referer': `https://www.gandart.com/`,
     'Accept-Language': `zh-CN,zh-Hans;q=0.9`,
     'token': gandartToken

+ 2 - 1
Scripts/gandart/gandartExchange.js

@@ -35,6 +35,7 @@ const GandartConstKey = {
 };
 
 let gandartToken = lk.getVal(GandartConstKey.Token, '');
+let gandartUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1`;
 
 const GCommonGandartHeads = {
     'Accept': `application/json, text/plain, */*`,
@@ -43,7 +44,7 @@ const GCommonGandartHeads = {
     'Content-Type': `application/x-www-form-urlencoded;charset=UTF-8`,
     'Connection': `keep-alive`,
     'Host': `api2.gandart.com`,
-    'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1`,
+    'User-Agent': gandartUserAgent,
     'Referer': `https://www.gandart.com/`,
     'Accept-Language': `zh-CN,zh-Hans;q=0.9`,
     'token': gandartToken

+ 4 - 4
Scripts/gandart/gandartHelper.js

@@ -35,6 +35,7 @@ const GandartConstKey = {
 };
 
 let gandartToken = lk.getVal(GandartConstKey.Token, '');
+let gandartUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1`;
 
 const GCommonGandartHeads = {
     'Accept': `application/json, text/plain, */*`,
@@ -43,7 +44,7 @@ const GCommonGandartHeads = {
     'Content-Type': `application/x-www-form-urlencoded;charset=UTF-8`,
     'Connection': `keep-alive`,
     'Host': `api2.gandart.com`,
-    'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1`,
+    'User-Agent': gandartUserAgent,
     'Referer': `https://www.gandart.com/`,
     'Accept-Language': `zh-CN,zh-Hans;q=0.9`,
     'token': gandartToken
@@ -446,7 +447,6 @@ function handleCollectionDetailsByCastingId() {
         if (data.success) {
             let obj = data.obj;
             let castingId = String(obj.castingId);
-            let floatInterval = lk.getVal(GandartConstKey.FloatPriceIntaval, 5);
             let lastCastingId = lk.getVal(GandartConstKey.CastingId);
             if (castingId != "") {
                 checkFixLimitPrice(castingId, obj, lastCastingId);
@@ -455,8 +455,8 @@ function handleCollectionDetailsByCastingId() {
                 lk.setVal(GandartConstKey.CollectionName, collectionName);
 
                 lk.write(`CollectionDetails#${castingId}`, JSON.stringify(obj));
-                lk.log(collectionName + " castingId=" + obj.castingId);
-                lk.appendNotifyInfo(`🎉成功获取[${collectionName}]信息`);
+                lk.log(collectionName + " castingId=" + castingId);
+                lk.appendNotifyInfo(`🎉成功获取[${collectionName}(${castingId})]信息`);
             } else {
                 let reqBody = lk.getRequestBody();
                 if (reqBody) {

Plik diff jest za duży
+ 281 - 0
Scripts/gandart/gandartLock.js


+ 33 - 5
Scripts/gandart/gandartOrder.js

@@ -32,10 +32,11 @@ const GandartConstKey = {
     CollectionCateLst: 'lkGandartCollectionCateLst',
     FloatPriceIntaval: 'lkGandartFloatPriceIntaval',
     IsCollectionWatchLocked: 'lkIsGandartCollectionWatchLocked',
+    PrivWalletListInUse: 'lkGandartPrivWalletListInUse',
 };
 
 let gandartToken = lk.getVal(GandartConstKey.Token, '');
-
+let gandartUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1`;
 const GCommonGandartHeads = {
     'Accept': `application/json, text/plain, */*`,
     'Origin': `https://www.gandart.com`,
@@ -43,12 +44,13 @@ const GCommonGandartHeads = {
     'Content-Type': `application/x-www-form-urlencoded;charset=UTF-8`,
     'Connection': `keep-alive`,
     'Host': `api2.gandart.com`,
-    'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1`,
+    'User-Agent': gandartUserAgent,
     'Referer': `https://www.gandart.com/`,
     'Accept-Language': `zh-CN,zh-Hans;q=0.9`,
     'token': gandartToken
 };
 
+let gandartWalletList = 'A,B,C';
 if (!lk.isExecComm) {
     if (!lk.isRequest()) {
         all();
@@ -97,6 +99,7 @@ async function all() {
             lk.prependNotifyInfo('⚠️请设置光予监控价格');
             hasNeedSendNotify = true;
         } else {
+            gandartWalletList = getCurWalletListInUse();
             let itemLst = await refreshLstOnSale(castingId, price);
             if (itemLst && itemLst.length > 0) {
                 hasNeedSendNotify = await checkToBuyAll(itemLst);
@@ -111,6 +114,15 @@ async function all() {
     lk.done();
 }
 
+function getCurWalletListInUse() {
+    let str = lk.getVal(GandartConstKey.PrivWalletListInUse);
+    let ret = 'A,B,C';
+    if (!lk.isEmpty(str)) {
+        ret = str;
+    }
+    return ret;
+}
+
 async function refreshLstOnSale(castingId, price, pageSize = 15, page = 1) {
     return new Promise((resolve, _reject) => {
         try {
@@ -180,13 +192,29 @@ async function refreshLstOnSale(castingId, price, pageSize = 15, page = 1) {
     });
 }
 
+
+function checkIsInPrivWalletList(item) {
+    let walletList = item.walletList;
+    for (let w of walletList) {
+        if (gandartWalletList.indexOf(w) > -1) {
+            return true;
+        }
+    }
+    return false;
+}
+
 async function checkToBuyAll(itemLst) {
     let ret = false;
     let count = Math.min(1, itemLst.length);
     for (let i = 0; i < count; i++) {
-        let succItem = await checkToBuyCollection(itemLst[i]);
-        if (succItem) {
-            ret = true;
+        const info = itemLst[i];
+        if (checkIsInPrivWalletList(info)) {
+            let succItem = await checkToBuyCollection(info);
+            if (succItem) {
+                ret = true;
+            }
+        } else {
+            lk.log(`[${info.collectionName}#${info.viewSort}]排除在个人使用钱包(${gandartWalletList})范围内`);
         }
     }
     return ret;

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików