|
@@ -92,6 +92,8 @@ const gBuyPlanHeaders = {
|
|
|
'X-Requested-With': `XMLHttpRequest`
|
|
'X-Requested-With': `XMLHttpRequest`
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+let gCaiLeLotteryType = 'SGFT';
|
|
|
let gCaiLeUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Mident/1.0`;
|
|
let gCaiLeUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Mident/1.0`;
|
|
|
let gCaiLeHost = magicJS.data.read('DIII_CaiLeYuan_Host', `lqt6oh7-ydl.o2xs6pexip.com`);
|
|
let gCaiLeHost = magicJS.data.read('DIII_CaiLeYuan_Host', `lqt6oh7-ydl.o2xs6pexip.com`);
|
|
|
let gCaiLeToken = `d16e47c3aa4fa856032da779e7467790fac7f93c`;
|
|
let gCaiLeToken = `d16e47c3aa4fa856032da779e7467790fac7f93c`;
|
|
@@ -174,6 +176,8 @@ async function Main() {
|
|
|
|
|
|
|
|
if (isPlanBuyTime()) {
|
|
if (isPlanBuyTime()) {
|
|
|
let comPlanResult = await checkTimeSlotPlanBuy();
|
|
let comPlanResult = await checkTimeSlotPlanBuy();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let comPlanResult = await checkLastRecordPlanBuy();
|
|
|
}
|
|
}
|
|
|
if (isExpertsRecommendEnabled()) {
|
|
if (isExpertsRecommendEnabled()) {
|
|
|
// await magicJS.utils.sleep(100);
|
|
// await magicJS.utils.sleep(100);
|
|
@@ -226,7 +230,16 @@ function getResponsePlainData() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function handleLotteryPksInfo() {
|
|
function handleLotteryPksInfo() {
|
|
|
-
|
|
|
|
|
|
|
+ let rspData = getResponsePlainData();
|
|
|
|
|
+ if (!rspData) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const path = $request.path;
|
|
|
|
|
+ let urlParams = magicJS.parseQueryStr(path);
|
|
|
|
|
+ let pksInfoToken = urlParams.token;
|
|
|
|
|
+ if (pksInfoToken) {
|
|
|
|
|
+ magicJS.data.write('168_PksInfoToken', pksInfoToken);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function handleLotteryPksPlanList() {
|
|
function handleLotteryPksPlanList() {
|
|
@@ -244,6 +257,12 @@ function handleHeaders() {
|
|
|
magicJS.data.write('168_PksExpertsPlanAPIHost', headers['Host']);
|
|
magicJS.data.write('168_PksExpertsPlanAPIHost', headers['Host']);
|
|
|
magicJS.data.write('168_PksExpertsPlanToken', headers['token']);
|
|
magicJS.data.write('168_PksExpertsPlanToken', headers['token']);
|
|
|
magicJS.logger.info(`168_PksExpertsPlanAPIHost已刷新`);
|
|
magicJS.logger.info(`168_PksExpertsPlanAPIHost已刷新`);
|
|
|
|
|
+
|
|
|
|
|
+ let urlParams = magicJS.parseQueryStr(path);
|
|
|
|
|
+ let pksInfoToken = urlParams.token;
|
|
|
|
|
+ if (pksInfoToken) {
|
|
|
|
|
+ magicJS.data.write('168_PksInfoToken', pksInfoToken);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -380,6 +399,14 @@ function getAllowBetProbability(planType) {
|
|
|
return Number(value);
|
|
return Number(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function getExpertPlanMaxBetAmount() {
|
|
|
|
|
+ let amount = magicJS.data.read('168_PksExpertMaxBetAmount', null);
|
|
|
|
|
+ if (amount == null) {
|
|
|
|
|
+ return 64;
|
|
|
|
|
+ }
|
|
|
|
|
+ return Number(amount);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function getHtmlContent(url, headers) {
|
|
async function getHtmlContent(url, headers) {
|
|
|
let options = {
|
|
let options = {
|
|
|
url: `${url}`,
|
|
url: `${url}`,
|
|
@@ -533,6 +560,43 @@ async function checkTimeSlotPlanBuy() {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+async function checkLastRecordPlanBuy() {
|
|
|
|
|
+ let ranking = 1;
|
|
|
|
|
+ let lastBetRecord = magicJS.data.read(`DIII_CaiLeYuan_Lottery_${gCaiLeLotteryType}#${ranking}`);
|
|
|
|
|
+ if (!lastBetRecord || lastBetRecord.drawIssue == void 0) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let pksInfoToken = magicJS.data.write('168_PksInfoToken', `tpM9v7lYiy0ctYv9AOlaztoyUcH9y/YR2Gt2jQT8dBd1edkFSV8Vuu%2BQ00/kNgeeksf`);
|
|
|
|
|
+ let lotteryRet = await getLotteryPksInfo(gLotteryCode, pksInfoToken);
|
|
|
|
|
+ if (!lotteryRet) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (lotteryRet.errorCode != 0) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let finalDrawResult = lotteryRet.result;
|
|
|
|
|
+ if (finalDrawResult && lastBetRecord) {
|
|
|
|
|
+ if (lastBetRecord.drawIssue == finalDrawResult.preDrawIssue) {
|
|
|
|
|
+ if (checkHitPrize(finalDrawResult.preDrawCode, lastBetRecord.planStr, 0)) {
|
|
|
|
|
+ magicJS.data.write(`DIII_CaiLeYuan_Lottery_${gCaiLeLotteryType}#1`, `{}`);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let drawIssue = finalDrawResult.drawIssue;
|
|
|
|
|
+ let drawTime = finalDrawResult.drawTime;
|
|
|
|
|
+ let turnOneCost = lastBetRecord.betAmount * 2;
|
|
|
|
|
+ let tipsMsg = `推荐号码:${lastBetRecord.planStr} 单注:${turnOneCost} \n期号:${drawIssue} 开奖时间:${drawTime}`;
|
|
|
|
|
+ if (isPlanCEnabled() && isPlanLotteryAutoBet()) {
|
|
|
|
|
+ let maxBetAmount = getPlanLotteryMaxBetAmount();
|
|
|
|
|
+ let betRet = await tryDragonBetPoor(finalDrawResult.drawIssue, ranking, lastBetRecord.planStr, turnOneCost, maxBetAmount);
|
|
|
|
|
+ }
|
|
|
|
|
+ magicJS.logger.info(tipsMsg);
|
|
|
|
|
+ magicJS.notification.appendNotifyInfo(tipsMsg);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ magicJS.data.write(`DIII_CaiLeYuan_Lottery_${gCaiLeLotteryType}#1`, `{}`);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function checkLongDragonNotify(pksPlanListData, pksPlanItemData) {
|
|
async function checkLongDragonNotify(pksPlanListData, pksPlanItemData) {
|
|
|
// 挑选出来恶龙
|
|
// 挑选出来恶龙
|
|
|
let failItemC = null;
|
|
let failItemC = null;
|
|
@@ -801,6 +865,7 @@ async function checkPlanCBuyNotify(pksPlanItemData, pksPlanListData) {
|
|
|
let tipsMsg = `[C]推荐号码:${planC} 单注:${turnOneCost} \n期号:${preDrawIssue} 开奖时间:${preDrawTime} 剩余时间:${countTime}s`;
|
|
let tipsMsg = `[C]推荐号码:${planC} 单注:${turnOneCost} \n期号:${preDrawIssue} 开奖时间:${preDrawTime} 剩余时间:${countTime}s`;
|
|
|
magicJS.logger.info(tipsMsg);
|
|
magicJS.logger.info(tipsMsg);
|
|
|
|
|
|
|
|
|
|
+ let ranking = 1;
|
|
|
if (preDrawCode.length > 0) {
|
|
if (preDrawCode.length > 0) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -814,7 +879,7 @@ async function checkPlanCBuyNotify(pksPlanItemData, pksPlanListData) {
|
|
|
}
|
|
}
|
|
|
if (probability >= proAllowValue) {
|
|
if (probability >= proAllowValue) {
|
|
|
let maxBetAmount = getPlanLotteryMaxBetAmount();
|
|
let maxBetAmount = getPlanLotteryMaxBetAmount();
|
|
|
- let betRet = await tryDragonBetPoor(preDrawIssue, 1, planC, turnOneCost, maxBetAmount);
|
|
|
|
|
|
|
+ let betRet = await tryDragonBetPoor(preDrawIssue, ranking, planC, turnOneCost, maxBetAmount);
|
|
|
tipsMsg += `\n最终单注:${turnOneCost} 预估中奖率:${probability.toFixed(2)}`;
|
|
tipsMsg += `\n最终单注:${turnOneCost} 预估中奖率:${probability.toFixed(2)}`;
|
|
|
tipsMsg += analyseLogMsg;
|
|
tipsMsg += analyseLogMsg;
|
|
|
setPlanBetOnce('C');
|
|
setPlanBetOnce('C');
|
|
@@ -1169,7 +1234,7 @@ async function checkExpertPlanBuy() {
|
|
|
|
|
|
|
|
let turnOneCost = getExpertsFixCost(planDetail);
|
|
let turnOneCost = getExpertsFixCost(planDetail);
|
|
|
let recommendCode = latestItem.recommendCode;
|
|
let recommendCode = latestItem.recommendCode;
|
|
|
- let maxBetAmount = getPlanLotteryMaxBetAmount();
|
|
|
|
|
|
|
+ let maxBetAmount = getExpertPlanMaxBetAmount();
|
|
|
|
|
|
|
|
let tipsMsg = `专家[${latestItem.userName}]推荐${latestItem.recommendTypeDesc}:${recommendCode} 准确率:${latestItem.winningProbability} 期数:${latestItem.rank} 期号:${preDrawIssue}`;
|
|
let tipsMsg = `专家[${latestItem.userName}]推荐${latestItem.recommendTypeDesc}:${recommendCode} 准确率:${latestItem.winningProbability} 期数:${latestItem.rank} 期号:${preDrawIssue}`;
|
|
|
magicJS.logger.info(tipsMsg);
|
|
magicJS.logger.info(tipsMsg);
|
|
@@ -1196,8 +1261,8 @@ function getExpertsFixCost(planDetail) {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (continuousWrongCount > 0) {
|
|
|
|
|
- turnOneCost = turnOneCost * (1 + Math.pow(2, continuousWrongCount * 3 - 1));
|
|
|
|
|
|
|
+ if (continuousWrongCount > 0 && wrongCostTurn + latestItem.rank < 9) {
|
|
|
|
|
+ turnOneCost = turnOneCost + continuousWrongCount * Math.pow(2, 2 + continuousWrongCount);
|
|
|
}
|
|
}
|
|
|
let continuousRightCount = 0;
|
|
let continuousRightCount = 0;
|
|
|
let rightCostTurn = 0;
|
|
let rightCostTurn = 0;
|
|
@@ -1331,7 +1396,7 @@ async function getExpertsRecommendDetail(userId, lotCode, groupCode = 1, ranking
|
|
|
return result.result.data;
|
|
return result.result.data;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-async function getLotteryPksInfo(lotCode, token = `tpM9v7lYiy0ctYv9AOlaztoyUcH9y/YR2Gt2jQT8dBd1edkFSV8Vuu%2BQ00/kNgeeksf`) {
|
|
|
|
|
|
|
+async function getLotteryPksInfo(lotCode, token) {
|
|
|
const reqData = {
|
|
const reqData = {
|
|
|
iOSVersion: '2.1.64',
|
|
iOSVersion: '2.1.64',
|
|
|
lotCode: lotCode,
|
|
lotCode: lotCode,
|
|
@@ -1488,6 +1553,13 @@ async function tryDragonBetPoor(drawIssue, ranking, planStr, betAmount, maxBetAm
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
result = await doDragonBet(drawIssue, ranking, planStr, betAmount);
|
|
result = await doDragonBet(drawIssue, ranking, planStr, betAmount);
|
|
|
|
|
+ let betRecord = {
|
|
|
|
|
+ ranking: ranking,
|
|
|
|
|
+ drawIssue: drawIssue,
|
|
|
|
|
+ planStr: planStr,
|
|
|
|
|
+ betAmount: betAmount,
|
|
|
|
|
+ };
|
|
|
|
|
+ magicJS.data.write(`DIII_CaiLeYuan_Lottery_${gCaiLeLotteryType}#${ranking}`, JSON.stringify(betRecord));
|
|
|
}
|
|
}
|
|
|
if (result && result.statusCode == 200) {
|
|
if (result && result.statusCode == 200) {
|
|
|
if (checkBetResult(result)) {
|
|
if (checkBetResult(result)) {
|
|
@@ -1563,7 +1635,7 @@ async function doDragonBet(drawIssue, ranking, planStr, betAmount) {
|
|
|
'第九名',
|
|
'第九名',
|
|
|
'第十名',
|
|
'第十名',
|
|
|
];
|
|
];
|
|
|
- let lotteryType = 'SGFT';
|
|
|
|
|
|
|
+ let lotteryType = gCaiLeLotteryType;
|
|
|
let numArr = planStr.split(',');
|
|
let numArr = planStr.split(',');
|
|
|
let bets = [];
|
|
let bets = [];
|
|
|
for (let i = 0; i < numArr.length; i++) {
|
|
for (let i = 0; i < numArr.length; i++) {
|
|
@@ -1587,6 +1659,7 @@ async function doDragonBet(drawIssue, ranking, planStr, betAmount) {
|
|
|
};
|
|
};
|
|
|
const url = `https://${gCaiLeHost}/rest/member/dragon/bet`;
|
|
const url = `https://${gCaiLeHost}/rest/member/dragon/bet`;
|
|
|
let result = await clyRequest('post', url, reqData);
|
|
let result = await clyRequest('post', url, reqData);
|
|
|
|
|
+
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|