|
@@ -215,6 +215,14 @@ function isPlanLotteryAutoBet() {
|
|
|
return JSON.parse(flag);
|
|
return JSON.parse(flag);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function isPlanLotteryAutoKillDrongon() {
|
|
|
|
|
+ let flag = magicJS.data.read('168_PksPlanLotteryKillDrongon', null);
|
|
|
|
|
+ if (flag == null) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return JSON.parse(flag) && isPlanLotteryAutoBet();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function getPlanLotteryMaxBetAmount() {
|
|
function getPlanLotteryMaxBetAmount() {
|
|
|
let amount = magicJS.data.read('168_PksPlanLotteryMaxBetAmount', null);
|
|
let amount = magicJS.data.read('168_PksPlanLotteryMaxBetAmount', null);
|
|
|
if (amount == null) {
|
|
if (amount == null) {
|
|
@@ -223,7 +231,13 @@ function getPlanLotteryMaxBetAmount() {
|
|
|
return Number(amount);
|
|
return Number(amount);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+function getPlanLotteryDrongonMaxAmount() {
|
|
|
|
|
+ let amount = magicJS.data.read('168_PksPlanLotteryDrongonMaxAmount', null);
|
|
|
|
|
+ if (amount == null) {
|
|
|
|
|
+ return 12;
|
|
|
|
|
+ }
|
|
|
|
|
+ return Number(amount);
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
async function getHtmlContent(url, headers) {
|
|
async function getHtmlContent(url, headers) {
|
|
|
let options = {
|
|
let options = {
|
|
@@ -292,9 +306,153 @@ async function checkLotteryResult() {
|
|
|
if(isPlanAEnabled()){
|
|
if(isPlanAEnabled()){
|
|
|
await checkPlanABuyNotify(pksPlanItemData, pksPlanListData);
|
|
await checkPlanABuyNotify(pksPlanItemData, pksPlanListData);
|
|
|
}
|
|
}
|
|
|
|
|
+ checkLongDragonNotify(pksPlanListData, pksPlanItemData);
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+async function checkLongDragonNotify(pksPlanListData, pksPlanItemData){
|
|
|
|
|
+ // 挑选出来恶龙
|
|
|
|
|
+ let failItemC = null;
|
|
|
|
|
+ let failItemB = null;
|
|
|
|
|
+ let failItemA = null;
|
|
|
|
|
+ for(let i=0; i < pksPlanListData.length; i++){
|
|
|
|
|
+ let element = pksPlanListData[i];
|
|
|
|
|
+ element.index = i;
|
|
|
|
|
+ if(!element.preDrawCode || element.preDrawCode.length == 0){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ let lotteryCostC = element.lotteryCostC;
|
|
|
|
|
+ let lotteryCostB = element.lotteryCostB;
|
|
|
|
|
+ let lotteryCostA = element.lotteryCostA;
|
|
|
|
|
+ let oneCostC = Math.floor(lotteryCostC/3);
|
|
|
|
|
+ let oneCostB = Math.floor(lotteryCostB/4);
|
|
|
|
|
+ let oneCostA = Math.floor(lotteryCostA/5);
|
|
|
|
|
+ //let buySeriesNum = Math.floor(Math.log2(oneCostC)) + 1;
|
|
|
|
|
+ let series10Cost = 521;
|
|
|
|
|
+ if(oneCostC >= series10Cost){
|
|
|
|
|
+ if(!checkHitPrize(element.preDrawCode, element.planC, 0)){
|
|
|
|
|
+ failItemC = element;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(oneCostB >= series10Cost){
|
|
|
|
|
+ if(!checkHitPrize(element.preDrawCode, element.planB, 0)){
|
|
|
|
|
+ failItemB = element;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(oneCostA >= series10Cost){
|
|
|
|
|
+ if(!checkHitPrize(element.preDrawCode, element.planA, 0)){
|
|
|
|
|
+ failItemA = element;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 检查是否后面屠杀成功
|
|
|
|
|
+ if(failItemC){
|
|
|
|
|
+ checkEvilDragonCSlayingNotify(failItemC, pksPlanListData);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(failItemB){
|
|
|
|
|
+ checkEvilDragonBSlayingNotify(failItemB, pksPlanListData);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(failItemA){
|
|
|
|
|
+ checkEvilDragonASlayingNotify(failItemA, pksPlanListData);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function checkEvilDragonCSlayingNotify(failItem, pksPlanListData){
|
|
|
|
|
+ let latestItem = pksPlanListData[0];
|
|
|
|
|
+ let unHitCount = 0;
|
|
|
|
|
+ for(let i=failItem.index-1; i >= 0; i--){
|
|
|
|
|
+ let element = pksPlanListData[i];
|
|
|
|
|
+ if(!checkHitPrize(element.preDrawCode, failItem.planC, 0)){
|
|
|
|
|
+ unHitCount += 1;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(failItem.index == unHitCount){
|
|
|
|
|
+ let turnCount = 10+unHitCount;
|
|
|
|
|
+ let maxTurnCount = getPlanLotteryDrongonMaxAmount();
|
|
|
|
|
+ let tipsMsg = `[C]推荐号码:${latestItem.planC} VS 长龙号码:${failItem.planC} 期数:${turnCount}`;
|
|
|
|
|
+ tipsMsg += `\n期号:${latestItem.preDrawIssue} 开奖时间:${latestItem.preDrawTime} 剩余时间:${latestItem.countTime}s`;
|
|
|
|
|
+ magicJS.logger.info(tipsMsg);
|
|
|
|
|
+ if (isPlanLotteryAutoKillDrongon()) {
|
|
|
|
|
+ let turnOneCost = Math.pow(2, turnCount - 1);
|
|
|
|
|
+ let maxBetAmount = getPlanLotteryMaxBetAmount();
|
|
|
|
|
+ if(turnCount <= maxTurnCount){
|
|
|
|
|
+ let betRet = await tryDragonBet(latestItem.preDrawIssue, failItem.planC, turnOneCost, maxBetAmount);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ magicJS.notification.appendNotifyInfo(tipsMsg);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function checkEvilDragonBSlayingNotify(failItem, pksPlanListData){
|
|
|
|
|
+ let latestItem = pksPlanListData[0];
|
|
|
|
|
+ let unHitCount = 0;
|
|
|
|
|
+ for(let i=failItem.index-1; i >= 0; i--){
|
|
|
|
|
+ let element = pksPlanListData[i];
|
|
|
|
|
+ if(!checkHitPrize(element.preDrawCode, failItem.planB, 0)){
|
|
|
|
|
+ unHitCount += 1;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(failItem.index == unHitCount){
|
|
|
|
|
+ let turnCount = 10+unHitCount;
|
|
|
|
|
+ let maxTurnCount = getPlanLotteryDrongonMaxAmount();
|
|
|
|
|
+ let tipsMsg = `[B]推荐号码:${latestItem.planB} VS 长龙号码:${failItem.planB} 期数:${turnCount}`;
|
|
|
|
|
+ tipsMsg += `\n期号:${latestItem.preDrawIssue} 开奖时间:${latestItem.preDrawTime} 剩余时间:${latestItem.countTime}s`;
|
|
|
|
|
+ magicJS.logger.info(tipsMsg);
|
|
|
|
|
+ if (isPlanLotteryAutoKillDrongon()) {
|
|
|
|
|
+ let turnOneCost = Math.pow(2, turnCount - 1);
|
|
|
|
|
+ let maxBetAmount = getPlanLotteryMaxBetAmount();
|
|
|
|
|
+ if(turnCount <= maxTurnCount){
|
|
|
|
|
+ let betRet = await tryDragonBet(latestItem.preDrawIssue, failItem.planB, turnOneCost, maxBetAmount);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ magicJS.notification.appendNotifyInfo(tipsMsg);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function checkEvilDragonASlayingNotify(failItem, pksPlanListData){
|
|
|
|
|
+ let latestItem = pksPlanListData[0];
|
|
|
|
|
+ let unHitCount = 0;
|
|
|
|
|
+ for(let i=failItem.index-1; i >= 0; i--){
|
|
|
|
|
+ let element = pksPlanListData[i];
|
|
|
|
|
+ if(!checkHitPrize(element.preDrawCode, failItem.planA, 0)){
|
|
|
|
|
+ unHitCount += 1;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(failItem.index == unHitCount){
|
|
|
|
|
+ let turnCount = 10+unHitCount;
|
|
|
|
|
+ let maxTurnCount = getPlanLotteryDrongonMaxAmount();
|
|
|
|
|
+ let tipsMsg = `[A]推荐号码:${latestItem.planA} VS 长龙号码:${failItem.planA} 期数:${turnCount}`;
|
|
|
|
|
+ tipsMsg += `\n期号:${latestItem.preDrawIssue} 开奖时间:${latestItem.preDrawTime} 剩余时间:${latestItem.countTime}s`;
|
|
|
|
|
+ magicJS.logger.info(tipsMsg);
|
|
|
|
|
+ if (isPlanLotteryAutoKillDrongon()) {
|
|
|
|
|
+ let turnOneCost = Math.pow(2, turnCount - 1);
|
|
|
|
|
+ let maxBetAmount = getPlanLotteryMaxBetAmount();
|
|
|
|
|
+ if(turnCount <= maxTurnCount){
|
|
|
|
|
+ let betRet = await tryDragonBet(latestItem.preDrawIssue, failItem.planA, turnOneCost, maxBetAmount);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ magicJS.notification.appendNotifyInfo(tipsMsg);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function checkHitPrize(drawCodeStr, planStr, posNum=0){
|
|
|
|
|
+ if(drawCodeStr.length == 0){
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ let drawCodeArr = drawCodeStr.split(',');
|
|
|
|
|
+ let championCode = drawCodeArr[posNum];
|
|
|
|
|
+ if(planStr.indexOf(championCode) > -1){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function checkPlanCBuyNotify(pksPlanItemData, pksPlanListData) {
|
|
async function checkPlanCBuyNotify(pksPlanItemData, pksPlanListData) {
|
|
|
let initCost = 1;
|
|
let initCost = 1;
|
|
|
let turnCount = magicJS.data.read('168_PksPlanDrawTurnCountC', 0);
|
|
let turnCount = magicJS.data.read('168_PksPlanDrawTurnCountC', 0);
|
|
@@ -336,7 +494,8 @@ async function checkPlanCBuyNotify(pksPlanItemData, pksPlanListData) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (isPlanLotteryAutoBet()) {
|
|
if (isPlanLotteryAutoBet()) {
|
|
|
- let betRet = await tryDragonBet(preDrawIssue, planC, turnOneCost);
|
|
|
|
|
|
|
+ let maxBetAmount = getPlanLotteryMaxBetAmount();
|
|
|
|
|
+ let betRet = await tryDragonBet(preDrawIssue, planC, turnOneCost, maxBetAmount);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
magicJS.notification.appendNotifyInfo(tipsMsg);
|
|
magicJS.notification.appendNotifyInfo(tipsMsg);
|
|
@@ -385,7 +544,8 @@ async function checkPlanBBuyNotify(pksPlanItemData, pksPlanListData) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (isPlanLotteryAutoBet()) {
|
|
if (isPlanLotteryAutoBet()) {
|
|
|
- let betRet = await tryDragonBet(preDrawIssue, planB, turnOneCost);
|
|
|
|
|
|
|
+ let maxBetAmount = getPlanLotteryMaxBetAmount();
|
|
|
|
|
+ let betRet = await tryDragonBet(preDrawIssue, planB, turnOneCost, maxBetAmount);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
magicJS.notification.appendNotifyInfo(tipsMsg);
|
|
magicJS.notification.appendNotifyInfo(tipsMsg);
|
|
@@ -434,7 +594,8 @@ async function checkPlanABuyNotify(pksPlanItemData, pksPlanListData) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (isPlanLotteryAutoBet()) {
|
|
if (isPlanLotteryAutoBet()) {
|
|
|
- let betRet = await tryDragonBet(preDrawIssue, planA, turnOneCost);
|
|
|
|
|
|
|
+ let maxBetAmount = getPlanLotteryMaxBetAmount();
|
|
|
|
|
+ let betRet = await tryDragonBet(preDrawIssue, planA, turnOneCost, maxBetAmount);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
magicJS.notification.appendNotifyInfo(tipsMsg);
|
|
magicJS.notification.appendNotifyInfo(tipsMsg);
|
|
@@ -568,7 +729,7 @@ function updateRequestHeaders() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-async function tryDragonBet(drawIssue, planStr, betAmount) {
|
|
|
|
|
|
|
+async function tryDragonBet(drawIssue, planStr, betAmount, maxBetAmount=96) {
|
|
|
let numArr = planStr.split(',');
|
|
let numArr = planStr.split(',');
|
|
|
let numCount = numArr.length;
|
|
let numCount = numArr.length;
|
|
|
if (numCount >= 5) {
|
|
if (numCount >= 5) {
|
|
@@ -580,8 +741,8 @@ async function tryDragonBet(drawIssue, planStr, betAmount) {
|
|
|
}
|
|
}
|
|
|
if (betAmount < 1) {
|
|
if (betAmount < 1) {
|
|
|
betAmount = 1;
|
|
betAmount = 1;
|
|
|
- } else if (betAmount > 96) {
|
|
|
|
|
- betAmount = 96;
|
|
|
|
|
|
|
+ } else if (betAmount > maxBetAmount) {
|
|
|
|
|
+ betAmount = maxBetAmount;
|
|
|
}
|
|
}
|
|
|
let result = await doDragonBet(drawIssue, planStr, betAmount);
|
|
let result = await doDragonBet(drawIssue, planStr, betAmount);
|
|
|
if (result && result.statusCode == 200) {
|
|
if (result && result.statusCode == 200) {
|