|
|
@@ -49,8 +49,6 @@ async function Main() {
|
|
|
checkHandleRequest();
|
|
|
} else {
|
|
|
updateRequestHeaders();
|
|
|
- await doTryCheckin();
|
|
|
- // await doTestBet();
|
|
|
}
|
|
|
magicJS.notification.msg('');
|
|
|
if (gRetBody) {
|
|
|
@@ -158,131 +156,6 @@ async function doNetworkTest() {
|
|
|
return result == 'OK';
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-async function doTestBet() {
|
|
|
- let drawIssue = magicJS.data.read('168_PksPlanDrawIssueCustom', null);
|
|
|
- if (!drawIssue) {
|
|
|
- drawIssue = magicJS.data.read('168_PksPlanPreDrawIssue', null);
|
|
|
- }
|
|
|
- let planStr = magicJS.data.read('168_PksPlanCustom', null);
|
|
|
- if (!drawIssue || !planStr) {
|
|
|
- return;
|
|
|
- }
|
|
|
- drawIssue = String(drawIssue);
|
|
|
- planStr = String(planStr);
|
|
|
- if (planStr.length == 0) {
|
|
|
- return;
|
|
|
- }
|
|
|
- let betRet = await doDragonBet(drawIssue, 1, planStr, 1);
|
|
|
- if (!betRet) {
|
|
|
- let loginRet = await tryReLogin();
|
|
|
- if (!loginRet) {
|
|
|
- return;
|
|
|
- }
|
|
|
- betRet = await doDragonBet(drawIssue, 1, planStr, 1);
|
|
|
- }
|
|
|
- return betRet;
|
|
|
-}
|
|
|
-
|
|
|
-async function doDragonBet(drawIssue, ranking, planStr, betAmount) {
|
|
|
- let rowTextArr = [
|
|
|
- '',
|
|
|
- '冠军',
|
|
|
- '亚军',
|
|
|
- '第三名',
|
|
|
- '第四名',
|
|
|
- '第五名',
|
|
|
- '第六名',
|
|
|
- '第七名',
|
|
|
- '第八名',
|
|
|
- '第九名',
|
|
|
- '第十名',
|
|
|
- ];
|
|
|
- let lotteryType = 'SGFT';
|
|
|
- let numArr = planStr.split(',');
|
|
|
- let bets = [];
|
|
|
- for (let i = 0; i < numArr.length; i++) {
|
|
|
- let numStr = String(parseInt(numArr[i].trim()));
|
|
|
- let element = {
|
|
|
- amount: betAmount,
|
|
|
- contentText: numStr,
|
|
|
- contents: numStr,
|
|
|
- drawNumber: String(drawIssue),
|
|
|
- game: `B${ranking}`,
|
|
|
- groupText: "1 ~ 10名",
|
|
|
- ignore: "false",
|
|
|
- lottery: lotteryType,
|
|
|
- odds: 9.91,
|
|
|
- rowText: rowTextArr[ranking],
|
|
|
- };
|
|
|
- bets.push(element);
|
|
|
- }
|
|
|
- const reqData = {
|
|
|
- bets: bets,
|
|
|
- };
|
|
|
- const url = `https://${gCaiLeHost}/rest/member/dragon/bet`;
|
|
|
- let result = await clyRequest('post', url, reqData);
|
|
|
- return result;
|
|
|
-}
|
|
|
-
|
|
|
-async function doTryCheckin() {
|
|
|
- let promoRet = await loadSigninPromoDetail();
|
|
|
- if (!promoRet) {
|
|
|
- let loginRet = await tryReLogin();
|
|
|
- if (!loginRet) {
|
|
|
- return;
|
|
|
- }
|
|
|
- promoRet = await loadSigninPromoDetail();
|
|
|
- }
|
|
|
- if (!promoRet || promoRet.statusCode != 200) {
|
|
|
- return;
|
|
|
- }
|
|
|
- let detail = promoRet.result;
|
|
|
- let loginDayCount = detail.loginDayCount;
|
|
|
- let currentDayCount = detail.currentDayCount;
|
|
|
- if (detail.depositCompleted) {
|
|
|
- magicJS.notification.appendNotifyInfo(`⚠️今日已存储(${currentDayCount}/${loginDayCount})`);
|
|
|
- } else {
|
|
|
- magicJS.notification.appendNotifyInfo(`❌今日未存储(${currentDayCount}/${loginDayCount})`);
|
|
|
- }
|
|
|
- if (detail.signinPromoToday) {
|
|
|
- //已签到
|
|
|
- magicJS.logger.info(`今日已签到(${currentDayCount}/${loginDayCount})`);
|
|
|
- magicJS.notification.appendNotifyInfo(`⚠️今日已签到(${currentDayCount}/${loginDayCount})`);
|
|
|
- return;
|
|
|
- }
|
|
|
- let activeId = detail.activeId;
|
|
|
- let checkinRet = await signinPromoCheckin(activeId);
|
|
|
- if (!checkinRet) {
|
|
|
- magicJS.notification.appendNotifyInfo(`❌签到异常(${currentDayCount}/${loginDayCount}),请重试`);
|
|
|
- return;
|
|
|
- }
|
|
|
- if (checkinRet.statusCode != 200) {
|
|
|
- magicJS.notification.appendNotifyInfo(`❌签到失败(${currentDayCount}/${loginDayCount}),请重试`);
|
|
|
- return;
|
|
|
- }
|
|
|
- let vFinalResult = checkinRet.result;
|
|
|
- magicJS.logger.info(`今日签到成功(${currentDayCount}/${loginDayCount})`);
|
|
|
- magicJS.notification.appendNotifyInfo(`🎉今日签到成功(${currentDayCount}/${loginDayCount})`);
|
|
|
-}
|
|
|
-
|
|
|
-async function loadSigninPromoDetail() {
|
|
|
- const url = `https://${gCaiLeHost}/rest/member/loadSigninPromoDetail`;
|
|
|
- const reqData = null;
|
|
|
- let result = await clyRequest('get', url, reqData);
|
|
|
- return result;
|
|
|
-}
|
|
|
-
|
|
|
-async function signinPromoCheckin(activeId) {
|
|
|
- const url = `https://${gCaiLeHost}/rest/member/signinPromoCheckin`;
|
|
|
- const reqData = {
|
|
|
- activeId: activeId,
|
|
|
- };
|
|
|
- let result = await clyRequest('get', url, reqData);
|
|
|
- return result;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
async function tryReLogin() {
|
|
|
let recognizeRet = await tryGenerateCaptchaAndRecognize(3);
|
|
|
if (!recognizeRet) {
|