shawenguan 1 năm trước cách đây
mục cha
commit
9954d10610
1 tập tin đã thay đổi với 27 bổ sung8 xóa
  1. 27 8
      Scripts/168/diiiLotteryTracking.js

+ 27 - 8
Scripts/168/diiiLotteryTracking.js

@@ -186,21 +186,40 @@ async function doLotteryTracking() {
         if (betAmount > maxBetAmount) {
             betAmount = maxBetAmount;
         }
-        let betRet = await doDragonBet(drawIssue, ranking, planStr, betAmount);
+        let betRet = await tryDragonBetCommon(drawIssue, ranking, planStr, betAmount, maxBetAmount);
         tipsMsg += `${rowTextArr[ranking]} 追号:${planStr.padEnd(6, ' ')} 单注:${betAmount}\n`;
-        if (!betRet) {
-            let loginRet = await tryReLogin();
-            if (!loginRet) {
-                return;
-            }
-            betRet = await doDragonBet(drawIssue, ranking, planStr, betAmount);
-        }
         setTrackingChangeCount(curTrackingCount + 1);
         if (curTrackingCount + 1 > trackingTotalCount) {
             getTrackingPlan(ranking, '');
         }
     }
     tipsMsg += `期号:${drawIssue} 开奖时间:${drawTime}\n`;
+    magicJS.notification.appendNotifyInfo(tipsMsg);
+}
+
+
+async function tryDragonBetCommon(drawIssue, ranking, planStr, betAmount, maxBetAmount = 96) {
+    if (betAmount < 1) {
+        betAmount = 1;
+    } else if (betAmount > maxBetAmount) {
+        betAmount = maxBetAmount;
+    }
+    let result = await doDragonBet(drawIssue, ranking, planStr, betAmount);
+    if (!result) {
+        let loginRet = await tryReLogin();
+        if (!loginRet) {
+            return;
+        }
+        result = await doDragonBet(drawIssue, ranking, planStr, betAmount);
+    }
+    if (result && result.statusCode == 200) {
+        if (checkBetResult(result)) {
+            magicJS.notification.post(magicJS.scriptName, `🎉下注成功 号码:${planStr} 单注:${betAmount}`);
+        } else {
+            magicJS.notification.post(magicJS.scriptName, `⚠️下注失败 号码:${planStr} 单注:${betAmount}`);
+        }
+    }
+    return result;
 }
 
 async function getLotteryPksInfo(lotCode) {