|
|
@@ -162,6 +162,9 @@ async function doLotteryTracking() {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ let preDrawIssue = lotteryRet.preDrawIssue;
|
|
|
+ let preDrawCode = lotteryRet.preDrawCode;
|
|
|
+ let preDrawCodeArr = preDrawCode.split(/[,|,|\s+]/);
|
|
|
let drawTime = lotteryRet.drawTime;
|
|
|
let tipsMsg = ``;
|
|
|
let rowTextArr = [
|
|
|
@@ -178,6 +181,7 @@ async function doLotteryTracking() {
|
|
|
'第十名',
|
|
|
];
|
|
|
let maxBetAmount = getPlanLotteryMaxBetAmount();
|
|
|
+ let prizeTips = ``;
|
|
|
for (let i = 1; i <= 10; i++) {
|
|
|
const ranking = i;
|
|
|
const planStr = getTrackingPlan(ranking);
|
|
|
@@ -186,6 +190,14 @@ async function doLotteryTracking() {
|
|
|
}
|
|
|
let trackingTotalCount = getTrackingCount(ranking);
|
|
|
let curTrackingCount = getTrackingChangeCount(ranking);
|
|
|
+ if (checkHitPrize2(preDrawCodeArr, planStr, ranking - 1)) {
|
|
|
+ // 追号中
|
|
|
+ setTrackingPlan(ranking, '');
|
|
|
+ setTrackingChangeCount(ranking, 1);
|
|
|
+ magicJS.logger.info(`${rowTextArr[ranking]} 追号中`);
|
|
|
+ prizeTips += `${rowTextArr[ranking].padEnd(6, ' ')} 期数:${curTrackingCount - 1}/${trackingTotalCount} 追号${planStr.padEnd(4, ' ')}中\n`;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
if (curTrackingCount > trackingTotalCount) {
|
|
|
continue;
|
|
|
}
|
|
|
@@ -194,17 +206,22 @@ async function doLotteryTracking() {
|
|
|
betAmount = maxBetAmount;
|
|
|
}
|
|
|
let betRet = await tryDragonBetCommon(drawIssue, ranking, planStr, betAmount, maxBetAmount);
|
|
|
- tipsMsg += `${rowTextArr[ranking]} 期数:${curTrackingCount}/${trackingTotalCount} 追号:${planStr.padEnd(6, ' ')} 单注:${betAmount}\n`;
|
|
|
+ tipsMsg += `${rowTextArr[ranking].padEnd(6, ' ')} 期数:${curTrackingCount}/${trackingTotalCount} 追号:${planStr.padEnd(4, ' ')} 单注:${betAmount}\n`;
|
|
|
if (curTrackingCount + 1 > trackingTotalCount) {
|
|
|
+ // 追号完成
|
|
|
setTrackingPlan(ranking, '');
|
|
|
setTrackingChangeCount(ranking, 1);
|
|
|
+ magicJS.logger.info(`${rowTextArr[ranking]} 追号完成`);
|
|
|
} else {
|
|
|
setTrackingChangeCount(ranking, curTrackingCount + 1);
|
|
|
}
|
|
|
}
|
|
|
- tipsMsg += `期号:${drawIssue} \n开奖时间:${drawTime}\n`;
|
|
|
+ tipsMsg = `期号:${drawIssue} 追号如下:\n${tipsMsg}\n`;
|
|
|
magicJS.notification.appendNotifyInfo(tipsMsg);
|
|
|
-
|
|
|
+ if (prizeTips.length > 0) {
|
|
|
+ prizeTips = `期号:${preDrawIssue} 中奖如下:\n${prizeTips}\n`;
|
|
|
+ magicJS.notification.post(magicJS.scriptName, `🎉${prizeTips}`);
|
|
|
+ }
|
|
|
magicJS.data.write('168_PksTrackingDrawIssue', strDrawIssue);
|
|
|
}
|
|
|
|
|
|
@@ -233,6 +250,22 @@ async function tryDragonBetCommon(drawIssue, ranking, planStr, betAmount, maxBet
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+function checkHitPrize(drawCodeStr, planStr, posNum = 0) {
|
|
|
+ if (drawCodeStr.length == 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let drawCodeArr = drawCodeStr.split(/[,|,|\s+]/);
|
|
|
+ return checkHitPrize2(drawCodeArr, planStr, posNum);
|
|
|
+}
|
|
|
+
|
|
|
+function checkHitPrize2(drawCodeArr, planStr, posNum = 0) {
|
|
|
+ let championCode = String(parseInt(drawCodeArr[posNum]));
|
|
|
+ if (planStr.indexOf(championCode) > -1) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+
|
|
|
function checkBetResult(data) {
|
|
|
let result = data.result;
|
|
|
let account = result.account;
|
|
|
@@ -307,7 +340,7 @@ async function doDragonBet(drawIssue, ranking, planStr, betAmount) {
|
|
|
'第十名',
|
|
|
];
|
|
|
let lotteryType = 'SGFT';
|
|
|
- let numArr = planStr.split(',');
|
|
|
+ let numArr = planStr.split(/[,|,|\s+]/);
|
|
|
let bets = [];
|
|
|
for (let i = 0; i < numArr.length; i++) {
|
|
|
let numStr = String(parseInt(numArr[i].trim()));
|