真是的 Posted April 2, 2020 Share Posted April 2, 2020 警告!此腳本有可能清空你的錢包,如果你無法承擔損失、請勿使用此腳本。 此腳本固定賭 2 倍,並自動決定下注金額、下注時機 (懶人福音)。 你只能輸入獎池總金額 (防止腳本下注超過限制) 或者改變風險 (增加或減少)。 var ruleData = [ "01,1:36,2:36,3:36,4:11,5:11,6:8,7:5,8:4,9:4,10:3", "001,1:34,2:34,3:34,4:9,5:7,6:7,7:0", "0001,1:33,2:30,3:9,4:6,5:1", "00001,1:33,2:30,3:8,4:2", "000001,1:33,2:30,3:7", "0000001,1:33,2:30", "00000001,1:33,2:30", "000000001,1:33,2:30", "0000000001,1:33,2:30", "00000000001,1:33,2:30", "000000000001,1:33,2:30", "0000000000001,1:33,2:30", "00000000000001,1:33,2:30", "000000000000001,1:33,2:30", "0000000000000001,1:33,2:30", "00000000000000001,1:33,2:14", "000000000000000001,1:33,2:14", "0000000000000000001,1:33,2:14", "00000000000000000001,1:33,2:14", "000000000000000000001,1:33,2:14", "011,1:23,2:18,3:18,4:12,5:7,6:1,7:0", "0111,1:23,2:18,3:18,4:7", "01111,1:16,2:13,3:9,4:0", "011111,1:14,2:13,3:4", "0111111,1:13,2:9,3:4", "01111111,1:12,2:9", "011111111,1:12,2:9", "0111111111,1:11,2:0", "01111111111,1:11", "011111111111,1:11", "0111111111111,1:8", "01111111111111,1:8", "011111111111111,1:6", "0111111111111111,1:6", "01111111111111111,1:5", "011111111111111111,1:5", "0111111111111111111,1:2", "01111111111111111111,1:0", "011111111111111111111,1:0", "0011,1:23,2:13,3:7,4:3,5:2", "00111,1:23,2:10,3:5,4:1", "001111,1:14,2:10,3:4", "0011111,1:14,2:6,3:3", "00111111,1:13,2:4,3:0", "001111111,1:12,2:4", "0011111111,1:11,2:3", "00111111111,1:11,2:3", "001111111111,1:11,2:3", "0011111111111,1:11", "00111111111111,1:7", "001111111111111,1:7", "0011111111111111,1:6", "00111111111111111,1:6", "001111111111111111,1:5", "0011111111111111111,1:5", "00011,1:17,2:11,3:8,4:2", "000011,1:17,2:10,3:8", "0000011,1:17,2:7,3:3", "00000011,1:17,2:7,3:3", "000000011,1:17,2:3,3:3", "0000000011,1:17,2:3", "00000000011,1:17,2:0", "000000000011,1:17", "0000000000011,1:9", "00000000000011,1:9", "000000000000011,1:9", "0000000000000011,1:8", "00000000000000011,1:8", "000000000000000011,1:8", "0000000000000000011,1:8", "00000000000000000011,1:8", "000000000000000000011,1:8", "0000000000000000000011,1:8", "000111,1:23,2:10,3:2", "00001111,1:14,2:4", "0000011111,1:10", "000000111111,1:10", "00000001111111,1:6", "0000000011111111,1:5", "000000000111111111,1:5", "00000000001111111111,1:1" ]; function setRuleToTitle() { for (var a = 0; a < ruleData.length; a++) { config["rule" + a] = { label: "(" + (a) + ") " + ruleData[a].replace(/\,/g, ", ").replace(/:/g, "="), type: "title" }; } } var config = { title: { label: currency.amount + " ( " + currency.minAmount + "~" + currency.maxAmount + " )", type: 'title' }, title1: { label: "固定賭 2 倍,什麼時候下、下注金額、輸了乘幾倍都會自動計算", type: "title" }, title2: { label: "※ 填寫現在獎池金額、確保不會超過獎池限制。如果你的資金很少、不可能超過獎池,可以寫 0。獎池金額是變動的、請經常更新此欄位。", type: "title" }, title3: { label: "※ 填寫追加次數、改變容許的連輸次數以控制風險,標準為 1。增加次數、下注金額減少、撐過連輸次數變多、風險減少。減少次數、下注金額增多、撐過連輸次數減少、風險增加。", type: "title" }, pool: { label: '獎池', value: 0, type: 'number' }, extra: { label: '追加次數', value: 2, type: 'number' }, } var currentPayout = 2; var rebetRatio = 1 / (currentPayout - 1) + 1; var currentBet = 0; var historyStr = ""; var rules, candidate; var currentRule = null; var currentRepeat = 0; var currentLaps = 0; var poolLimit = 0; var overLaps = new Array(); var loseCount = 0; var count = 0; var profitMin = 0; var profitMax = 0; var profit = 0; var loseMax = 0; var totalLaps = 0; var joinLaps = 0; function main() { if (config.pool.value > 0) { poolLimit = config.pool.value * 0.0075 / currentPayout; } createHistory(engine.getHistory()); createRules(); checkResult(); log.info("最大撐到 " + (getAllowableLaps()) + " 局"); engine.on('GAME_STARTING', function() { totalLaps += 1; if (candidate != null && candidate.length > 0) { joinLaps += 1; var maxCandidate = candidate[0]; for (var a = 0; a < candidate.length; a++) { if (candidate[a][3] > maxCandidate[3]) { maxCandidate = candidate[a]; } } log.info(" "); log.success(stringReverse(historyStr.substr(0, 20))); log.info("規則 (" + maxCandidate[0] + ") x" + maxCandidate[1] + "," + (loseCount + 1) + "/" + maxCandidate[2] + "/" + getAllowableLaps() + " 局,下注 " + round(maxCandidate[3])); currentRule = maxCandidate; currentBet = maxCandidate[3]; if (currentBet <= 0) { engine.stop(); return; } engine.bet(currentBet, currentPayout) .catch(function(err) { log.error(err); out(); if (loseCount >= currentRule[2] - config.extra.value) { engine.stop(); return; } }); } }); engine.on('GAME_ENDED', function() { var history = engine.getHistory(); var lastGame = history[0]; createHistory(history); if (lastGame.wager) { lastGame.profit = (lastGame.wager * lastGame.cashedAt / 100) - lastGame.wager; if (lastGame.cashedAt) { count = 0; currentRule = null; loseCount = 0; log.success('We won ' + (lastGame.crash / 100) + " x, " + lastGame.profit); } else { count++; loseCount += 1; if (loseCount > currentRule[2] - config.extra.value) { overLaps[overLaps.length] = currentRule; } log.error('We lost ' + (lastGame.crash / 100) + " x, " + lastGame.profit); } profit += lastGame.profit; profitMax = Math.max(profitMax, profit); profitMin = Math.min(profitMin, profit); loseMax = Math.max(loseMax, count); out(); } checkResult(); }); } function getAltBetAmount(laps) { firstBet = currency.amount * (1 - rebetRatio) / (1 - Math.pow(rebetRatio, laps)); if (firstBet < currency.minAmount) { log.error("剩餘金額 " + currency.amount + " 不足以撐過 " + laps + " 局。"); log.error("getAltBetAmount laps 不能大於 " + getAllowableLaps() + " 次。"); return -2; } lastBet = Math.pow(rebetRatio, laps - 1) * firstBet; if (lastBet > getLimit()) { firstBet = getLimit() / Math.pow(rebetRatio, laps - 1); lastBet = Math.pow(rebetRatio, laps - 1) * firstBet; } return firstBet < currency.minAmount ? -1 : firstBet; } function checkResult() { candidate = new Array(); var safeLaps = getAllowableLaps(); for (var a = 0; a < rules.length; a++) { var rule = rules[a]; var pattren = stringReverse(rule[0]); var endIndex = -1; var startIndex = historyStr.indexOf(pattren, endIndex); if (currentRule != null && currentRule[0] == a) { candidate[candidate.length] = [a, currentRepeat, currentLaps, currentBet * rebetRatio]; continue; } if (startIndex != 0) { continue; } endIndex = startIndex + pattren.length; var secondIndex = historyStr.indexOf(pattren, endIndex); while (secondIndex == endIndex) { endIndex = secondIndex + pattren.length; secondIndex = historyStr.indexOf(pattren, endIndex); } var repeat = (endIndex - startIndex) / pattren.length; var last = rule[rule.length - 1]; if (repeat > last[0]) { if (safeLaps >= last[1]) { currentRepeat = last[0]; currentLaps = last[1]; candidate[candidate.length] = [a, currentRepeat, currentLaps, getAltBetAmount(currentLaps)]; log.info(candidate[candidate.length - 1]); } } else { for (var b = rule.length - 1; b > 0; b--) { if (repeat >= rule[b][0]) { if (safeLaps >= rule[b][1]) { currentRepeat = rule[b][0]; currentLaps = rule[b][1]; candidate[candidate.length] = [a, currentRepeat, currentLaps, getAltBetAmount(currentLaps)]; } break; } else { } } } } } function getLimit() { var limit = currency.maxAmount; if (config.pool.value > 0) { limit = Math.min(currency.maxAmount, poolLimit); } return limit; } function getAllowableLaps() { return Math.floor(1 - getBaseLog(rebetRatio, currency.minAmount / Math.min(currency.amount / currentPayout, getLimit()))); } function createRules() { rules = new Array(); for (var a = 0; a < ruleData.length; a++) { var index1 = ruleData[a].indexOf(","); var index2 = index1 > 0 ? ruleData[a].indexOf(":", index1 + 2) : -1; if (index2 >= 3) { var index3 = rules.length; var rr = rules[index3] = ruleData[a].split(","); for (var b = 1; b < rr.length; b++) { var rrr = rr[b] = rr[b].split(":"); if (rrr.length == 2) { rrr[0] = parseInt(rrr[0]); rrr[1] = Math.max(0, parseInt(rrr[1]) + config.extra.value); } } } } } function createHistory(history) { if (historyStr.length < 20) { for (record of history) { historyStr = historyStr + (record.crash / 100 >= currentPayout ? 1 : 0); } } else { historyStr = (history[0].crash / 100 >= currentPayout ? 1 : 0) + historyStr; while (historyStr.length > 100) { historyStr = historyStr.substr(0, 100); } } } function getBaseLog(x, y) { return Math.log(y) / Math.log(x); } function stringReverse(str) { return str.split("").reverse().join(""); } function round(num) { return Math.round(num * 100000000) / 100000000; } function out() { log.success('profit = ' + round(profit) + " ( " + round(profitMin) + " ~ " + round(profitMax) + " )"); var str = ""; if (loseCount) { str = '輸 ' + loseCount + " 回、"; } log.info("參與 " + joinLaps + "、放棄 " + (totalLaps - joinLaps) + "、共 " + totalLaps + "、" + str + "最大連輸 " + loseMax); if (overLaps.length > 0) { log.error("警告!突破歷史記錄"); for (var a = 0; a < overLaps.length; a++) { log.error(overLaps[a]); } } } 使用方法: 先選好你要使用的幣別。 [運行] 這個腳本。 [獎池] 欄位填寫該幣別獎池總金額,可防止自動下注金額超過獎池限制。如果你的本金小、不可能超過獎池限制,可以填 0。 [追加次數] 欄位預設為 1,數字減少風險變大、數字增加風險變小。風險大小關係到下注金額大小、也影響獲利大小。 調整好以上兩個欄位後再點 [運行腳本]。 Link to comment Share on other sites More sharing options...
真是的 Posted April 3, 2020 Author Share Posted April 3, 2020 資料更新 var ruleData = [ "01,1:20,2:17,3:15,4:11,5:11,6:8,7:5,8:4,9:4,10:3", "001,1:20,2:14,3:13,4:9,5:7,6:7,7:0", "0001,1:20,2:13,3:9,4:6,5:1", "00001,1:20,2:11,3:8,4:2", "000001,1:20,2:11,3:7", "0000001,1:20,2:11", "00000001,1:20,2:8", "000000001,1:20,2:2", "0000000001,1:20,2:2", "00000000001,1:10,2:0", "000000000001,1:10", "0000000000001,1:10", "00000000000001,1:9", "000000000000001,1:9", "0000000000000001,1:5", "00000000000000001,1:4", "000000000000000001,1:4", "0000000000000000001,1:1", "00000000000000000001,1:1", "000000000000000000001,1:1", "011,1:18,2:18,3:18,4:12,5:7,6:1,7:0", "0111,1:18,2:18,3:18,4:7", "01111,1:16,2:13,3:9,4:0", "011111,1:14,2:13,3:4", "0111111,1:13,2:9,3:4", "01111111,1:12,2:9", "011111111,1:12,2:9", "0111111111,1:11,2:0", "01111111111,1:11", "011111111111,1:11", "0111111111111,1:8", "01111111111111,1:8", "011111111111111,1:6", "0111111111111111,1:6", "01111111111111111,1:5", "011111111111111111,1:5", "0111111111111111111,1:2", "01111111111111111111,1:0", "011111111111111111111,1:0", "0011,1:17,2:13,3:7,4:3,5:2", "00111,1:17,2:10,3:5,4:1", "001111,1:14,2:10,3:4", "0011111,1:14,2:6,3:3", "00111111,1:13,2:4,3:0", "001111111,1:12,2:4", "0011111111,1:11,2:3", "00111111111,1:11,2:3", "001111111111,1:11,2:3", "0011111111111,1:11", "00111111111111,1:7", "001111111111111,1:7", "0011111111111111,1:6", "00111111111111111,1:6", "001111111111111111,1:5", "0011111111111111111,1:5", "00011,1:15,2:11,3:8,4:2", "000011,1:15,2:10,3:8", "0000011,1:15,2:7,3:3", "00000011,1:15,2:7,3:3", "000000011,1:15,2:3,3:3", "0000000011,1:15,2:3", "00000000011,1:9", "000000000011,1:9", "0000000000011,1:9", "00000000000011,1:9", "000000000000011,1:9", "0000000000000011,1:8", "00000000000000011,1:8", "000000000000000011,1:8", "0000000000000000011,1:2", "00000000000000000011,1:0", "000000000000000000011,1:0", "0000000000000000000011,1:0", "000111,1:17,2:10,3:2", "00001111,1:14,2:4", "0000011111,1:10", "000000111111,1:10", "00000001111111,1:6", "0000000011111111,1:5", "000000000111111111,1:5", "00000000001111111111,1:1" ]; function setRuleToTitle() { for (var a = 0; a < ruleData.length; a++) { config["rule" + a] = { label: "(" + (a) + ") " + ruleData[a].replace(/\,/g, ", ").replace(/:/g, "="), type: "title" }; } } var config = { title: { label: currency.amount + " ( " + currency.minAmount + "~" + currency.maxAmount + " )", type: 'title' }, title1: { label: "固定賭 2 倍,什麼時候下、下注金額、輸了乘幾倍都會自動計算", type: "title" }, title2: { label: "※ 填寫現在獎池金額、確保不會超過獎池限制。如果你的資金很少、不可能超過獎池,可以寫 0。獎池金額是變動的、請經常更新此欄位。", type: "title" }, title3: { label: "※ 填寫追加次數、改變容許的連輸次數以控制風險,標準為 1。增加次數、下注金額減少、撐過連輸次數變多、風險減少。減少次數、下注金額增多、撐過連輸次數減少、風險增加。", type: "title" }, pool: { label: '獎池', value: 0, type: 'number' }, extra: { label: '追加次數', value: 2, type: 'number' }, } var currentPayout = 2; var rebetRatio = 1 / (currentPayout - 1) + 1; var currentBet = 0; var historyStr = ""; var rules, candidate; var currentRule = null; var currentRepeat = 0; var currentLaps = 0; var poolLimit = 0; var overLaps = new Array(); var loseCount = 0; var count = 0; var profitMin = 0; var profitMax = 0; var profit = 0; var loseMax = 0; var totalLaps = 0; var joinLaps = 0; function main() { if (config.pool.value > 0) { poolLimit = config.pool.value * 0.0075 / currentPayout; } createHistory(engine.getHistory()); createRules(); checkResult(); log.info("最大撐到 " + (getAllowableLaps()) + " 局"); engine.on('GAME_STARTING', function() { totalLaps += 1; if (candidate != null && candidate.length > 0) { joinLaps += 1; var maxCandidate = candidate[0]; for (var a = 0; a < candidate.length; a++) { if (candidate[a][3] > maxCandidate[3]) { maxCandidate = candidate[a]; } } log.info(" "); log.success(stringReverse(historyStr.substr(0, 20))); log.info("規則 (" + maxCandidate[0] + ") x" + maxCandidate[1] + "," + (loseCount + 1) + "/" + maxCandidate[2] + "/" + getAllowableLaps() + " 局,下注 " + round(maxCandidate[3])); currentRule = maxCandidate; currentBet = maxCandidate[3]; if (currentBet <= 0) { engine.stop(); return; } engine.bet(currentBet, currentPayout) .catch(function(err) { log.error(err); out(); if (loseCount >= currentRule[2] - config.extra.value) { engine.stop(); return; } }); } }); engine.on('GAME_ENDED', function() { var history = engine.getHistory(); var lastGame = history[0]; createHistory(history); if (lastGame.wager) { lastGame.profit = (lastGame.wager * lastGame.cashedAt / 100) - lastGame.wager; if (lastGame.cashedAt) { count = 0; currentRule = null; loseCount = 0; log.success('We won ' + (lastGame.crash / 100) + " x, " + lastGame.profit); } else { count++; loseCount += 1; if (loseCount > currentRule[2] - config.extra.value) { overLaps[overLaps.length] = currentRule; } log.error('We lost ' + (lastGame.crash / 100) + " x, " + lastGame.profit); } profit += lastGame.profit; profitMax = Math.max(profitMax, profit); profitMin = Math.min(profitMin, profit); loseMax = Math.max(loseMax, count); out(); } checkResult(); }); } function getAltBetAmount(laps) { firstBet = currency.amount * (1 - rebetRatio) / (1 - Math.pow(rebetRatio, laps)); if (firstBet < currency.minAmount) { log.error("剩餘金額 " + currency.amount + " 不足以撐過 " + laps + " 局。"); log.error("getAltBetAmount laps 不能大於 " + getAllowableLaps() + " 次。"); return -2; } lastBet = Math.pow(rebetRatio, laps - 1) * firstBet; if (lastBet > getLimit()) { firstBet = getLimit() / Math.pow(rebetRatio, laps - 1); lastBet = Math.pow(rebetRatio, laps - 1) * firstBet; } return firstBet < currency.minAmount ? -1 : firstBet; } function checkResult() { candidate = new Array(); var safeLaps = getAllowableLaps(); for (var a = 0; a < rules.length; a++) { var rule = rules[a]; var pattren = stringReverse(rule[0]); var endIndex = -1; var startIndex = historyStr.indexOf(pattren, endIndex); if (currentRule != null && currentRule[0] == a) { candidate[candidate.length] = [a, currentRepeat, currentLaps, currentBet * rebetRatio]; continue; } if (startIndex != 0) { continue; } endIndex = startIndex + pattren.length; var secondIndex = historyStr.indexOf(pattren, endIndex); while (secondIndex == endIndex) { endIndex = secondIndex + pattren.length; secondIndex = historyStr.indexOf(pattren, endIndex); } var repeat = (endIndex - startIndex) / pattren.length; var last = rule[rule.length - 1]; if (repeat > last[0]) { if (safeLaps >= last[1]) { currentRepeat = last[0]; currentLaps = last[1]; candidate[candidate.length] = [a, currentRepeat, currentLaps, getAltBetAmount(currentLaps)]; log.info(candidate[candidate.length - 1]); } } else { for (var b = rule.length - 1; b > 0; b--) { if (repeat >= rule[b][0]) { if (safeLaps >= rule[b][1]) { currentRepeat = rule[b][0]; currentLaps = rule[b][1]; candidate[candidate.length] = [a, currentRepeat, currentLaps, getAltBetAmount(currentLaps)]; } break; } else { } } } } } function getLimit() { var limit = currency.maxAmount; if (config.pool.value > 0) { limit = Math.min(currency.maxAmount, poolLimit); } return limit; } function getAllowableLaps() { return Math.floor(1 - getBaseLog(rebetRatio, currency.minAmount / Math.min(currency.amount / currentPayout, getLimit()))); } function createRules() { rules = new Array(); for (var a = 0; a < ruleData.length; a++) { var index1 = ruleData[a].indexOf(","); var index2 = index1 > 0 ? ruleData[a].indexOf(":", index1 + 2) : -1; if (index2 >= 3) { var index3 = rules.length; var rr = rules[index3] = ruleData[a].split(","); for (var b = 1; b < rr.length; b++) { var rrr = rr[b] = rr[b].split(":"); if (rrr.length == 2) { rrr[0] = parseInt(rrr[0]); rrr[1] = Math.max(0, parseInt(rrr[1]) + config.extra.value); } } } } } function createHistory(history) { if (historyStr.length < 20) { for (record of history) { historyStr = historyStr + (record.crash / 100 >= currentPayout ? 1 : 0); } } else { historyStr = (history[0].crash / 100 >= currentPayout ? 1 : 0) + historyStr; while (historyStr.length > 100) { historyStr = historyStr.substr(0, 100); } } } function getBaseLog(x, y) { return Math.log(y) / Math.log(x); } function stringReverse(str) { return str.split("").reverse().join(""); } function round(num) { return Math.round(num * 100000000) / 100000000; } function out() { log.success('profit = ' + round(profit) + " ( " + round(profitMin) + " ~ " + round(profitMax) + " )"); var str = ""; if (loseCount) { str = '輸 ' + loseCount + " 回、"; } log.info("參與 " + joinLaps + "、放棄 " + (totalLaps - joinLaps) + "、共 " + totalLaps + "、" + str + "最大連輸 " + loseMax); if (overLaps.length > 0) { log.error("警告!突破歷史記錄"); for (var a = 0; a < overLaps.length; a++) { log.error(overLaps[a]); } } } Link to comment Share on other sites More sharing options...
真是的 Posted April 6, 2020 Author Share Posted April 6, 2020 腳本更新、增加下注機會 //自動 2倍 var ruleData = [ "01,1:20,2:17,3:15,4:11,5:11,6:8,7:5,8:4,9:4,10:3", "001,1:20,2:14,3:13,4:9,5:7,6:7,7:0", "0001,1:20,2:13,3:9,4:6,5:1", "00001,1:20,2:11,3:8,4:2", "000001,1:20,2:11,3:7", "0000001,1:20,2:11", "00000001,1:20,2:8", "000000001,1:20,2:2", "0000000001,1:20,2:2", "00000000001,1:10,2:0", "000000000001,1:10", "0000000000001,1:10", "00000000000001,1:9", "000000000000001,1:9", "0000000000000001,1:5", "00000000000000001,1:4", "000000000000000001,1:4", "0000000000000000001,1:1", "00000000000000000001,1:1", "000000000000000000001,1:1", "011,1:18,2:18,3:18,4:12,5:7,6:1,7:0", "0111,1:18,2:18,3:18,4:7", "01111,1:16,2:13,3:9,4:0", "011111,1:14,2:13,3:4", "0111111,1:13,2:9,3:4", "01111111,1:12,2:9", "011111111,1:12,2:9", "0111111111,1:11,2:0", "01111111111,1:11", "011111111111,1:11", "0111111111111,1:8", "01111111111111,1:8", "011111111111111,1:6", "0111111111111111,1:6", "01111111111111111,1:5", "011111111111111111,1:5", "0111111111111111111,1:2", "01111111111111111111,1:0", "011111111111111111111,1:0", "0011,1:17,2:13,3:7,4:3,5:2", "00111,1:17,2:10,3:5,4:1", "001111,1:14,2:10,3:4", "0011111,1:14,2:6,3:3", "00111111,1:13,2:4,3:0", "001111111,1:12,2:4", "0011111111,1:11,2:3", "00111111111,1:11,2:3", "001111111111,1:11,2:3", "0011111111111,1:11", "00111111111111,1:7", "001111111111111,1:7", "0011111111111111,1:6", "00111111111111111,1:6", "001111111111111111,1:5", "0011111111111111111,1:5", "00011,1:15,2:11,3:8,4:2", "000011,1:15,2:10,3:8", "0000011,1:15,2:7,3:3", "00000011,1:15,2:7,3:3", "000000011,1:15,2:3,3:3", "0000000011,1:15,2:3", "00000000011,1:9", "000000000011,1:9", "0000000000011,1:9", "00000000000011,1:9", "000000000000011,1:9", "0000000000000011,1:8", "00000000000000011,1:8", "000000000000000011,1:8", "0000000000000000011,1:2", "00000000000000000011,1:0", "000000000000000000011,1:0", "0000000000000000000011,1:0", "000111,1:17,2:10,3:2", "00001111,1:14,2:4", "0000011111,1:10", "000000111111,1:10", "00000001111111,1:6", "0000000011111111,1:5", "000000000111111111,1:5", "00000000001111111111,1:1" ]; function setRuleToTitle() { for (var a = 0; a < ruleData.length; a++) { config["rule" + a] = { label: "(" + (a) + ") " + ruleData[a].replace(/\,/g, ", ").replace(/:/g, "="), type: "title" }; } } var config = { title: { label: currency.amount + " ( " + currency.minAmount + "~" + currency.maxAmount + " )", type: 'title' }, title1: { label: "固定賭 2 倍,什麼時候下、下注金額、輸了乘幾倍都會自動計算", type: "title" }, title2: { label: "※ 填寫現在獎池金額、確保不會超過獎池限制。如果你的資金很少、不可能超過獎池,可以寫 0。獎池金額是變動的、請經常更新此欄位。", type: "title" }, title3: { label: "※ 填寫追加次數、改變容許的連輸次數以控制風險,標準為 1。增加次數、下注金額減少、撐過連輸次數變多、風險減少。減少次數、下注金額增多、撐過連輸次數減少、風險增加。", type: "title" }, pool: { label: '獎池', value: 0, type: 'number' }, extra: { label: '追加次數', value: 2, type: 'number' }, } var currentPayout = 2; var rebetRatio = 1 / (currentPayout - 1) + 1; var currentBet = 0; var historyStr = ""; var rules, candidate; var currentRule = null; var currentRepeat = 0; var currentLaps = 0; var poolLimit = 0; var overLaps = new Array(); var loseCount = 0; var count = 0; var profitMin = 0; var profitMax = 0; var profit = 0; var loseMax = 0; var totalLaps = 0; var joinLaps = 0; function main() { if (config.pool.value > 0) { poolLimit = config.pool.value * 0.0075 / currentPayout; } createHistory(engine.getHistory()); createRules(); checkResult(); log.info("最大撐到 " + (getAllowableLaps()) + " 局"); engine.on('GAME_STARTING', function() { totalLaps += 1; if (candidate != null && candidate.length > 0) { joinLaps += 1; var maxCandidate = candidate[0]; for (var a = 0; a < candidate.length; a++) { if (candidate[a][3] > maxCandidate[3]) { maxCandidate = candidate[a]; } } log.info(" "); log.success(stringReverse(historyStr.substr(0, 20))); var historyLaps = maxCandidate[2]; if (maxCandidate[4] > 0) { historyLaps += "-" + maxCandidate[4]; } log.info("規則 (" + maxCandidate[0] + ") x" + maxCandidate[1] + "," + (loseCount + 1) + "/" + historyLaps + "/" + getAllowableLaps() + " 局,下注 " + round(maxCandidate[3])); currentRule = maxCandidate; currentBet = maxCandidate[3]; if (currentBet <= 0) { engine.stop(); return; } engine.bet(currentBet, currentPayout) .catch(function(err) { log.error(err); out(); if (loseCount >= currentRule[2] - config.extra.value) { engine.stop(); return; } }); } }); engine.on('GAME_ENDED', function() { var history = engine.getHistory(); var lastGame = history[0]; createHistory(history); if (lastGame.wager) { lastGame.profit = (lastGame.wager * lastGame.cashedAt / 100) - lastGame.wager; if (lastGame.cashedAt) { count = 0; currentRule = null; loseCount = 0; log.success('開 ' + (lastGame.crash / 100) + ", 贏了 " + lastGame.profit); } else { count++; loseCount += 1; if (loseCount > currentRule[2] - config.extra.value) { overLaps[overLaps.length] = currentRule; } log.error('開 ' + (lastGame.crash / 100) + ", 輸了 " + lastGame.profit); } profit += lastGame.profit; profitMax = Math.max(profitMax, profit); profitMin = Math.min(profitMin, profit); loseMax = Math.max(loseMax, count); out(); } checkResult(); }); } function getAltBetAmount(laps) { firstBet = currency.amount * (1 - rebetRatio) / (1 - Math.pow(rebetRatio, laps)); if (firstBet < currency.minAmount) { log.error("剩餘金額 " + currency.amount + " 不足以撐過 " + laps + " 局。"); log.error("getAltBetAmount laps 不能大於 " + getAllowableLaps() + " 次。"); return -2; } lastBet = Math.pow(rebetRatio, laps - 1) * firstBet; if (lastBet > getLimit()) { firstBet = getLimit() / Math.pow(rebetRatio, laps - 1); lastBet = Math.pow(rebetRatio, laps - 1) * firstBet; } return firstBet < currency.minAmount ? -1 : firstBet; } function checkResult() { candidate = new Array(); var safeLaps = getAllowableLaps(); for (var a = 0; a < rules.length; a++) { if (currentRule != null && currentRule[0] == a) { currentRule[3] *= rebetRatio; candidate[candidate.length] = currentRule; continue; } var rule = rules[a]; var pattren = stringReverse(rule[0]); var endIndex = -1; var startIndex = historyStr.indexOf(pattren, endIndex); var leftZero = 0; if (startIndex != -1 && historyStr.indexOf("1") == startIndex) { leftZero = startIndex; } else { continue; } endIndex = startIndex + pattren.length; var secondIndex = historyStr.indexOf(pattren, endIndex); while (secondIndex == endIndex) { endIndex = secondIndex + pattren.length; secondIndex = historyStr.indexOf(pattren, endIndex); } var repeat = (endIndex - startIndex) / pattren.length; var last = rule[rule.length - 1]; var matchRule = null; if (repeat > last[0]) { if (safeLaps >= last[1] - leftZero) { matchRule = last; } } else { for (var b = rule.length - 1; b > 0; b--) { if (repeat >= rule[b][0]) { if (safeLaps >= rule[b][1] - leftZero) { matchRule = rule[b]; } break; } else { } } } if (matchRule != null) { currentRepeat = matchRule[0]; currentLaps = matchRule[1]; candidate[candidate.length] = [a, currentRepeat, currentLaps, getAltBetAmount(currentLaps - leftZero), leftZero]; } } } function getLimit() { var limit = currency.maxAmount; if (config.pool.value > 0) { limit = Math.min(currency.maxAmount, poolLimit); } return limit; } function getAllowableLaps() { return Math.floor(1 - getBaseLog(rebetRatio, currency.minAmount / Math.min(currency.amount / currentPayout, getLimit()))); } function createRules() { rules = new Array(); for (var a = 0; a < ruleData.length; a++) { var index1 = ruleData[a].indexOf(","); var index2 = index1 > 0 ? ruleData[a].indexOf(":", index1 + 2) : -1; if (index2 >= 3) { var index3 = rules.length; var rr = rules[index3] = ruleData[a].split(","); for (var b = 1; b < rr.length; b++) { var rrr = rr[b] = rr[b].split(":"); if (rrr.length == 2) { rrr[0] = parseInt(rrr[0]); rrr[1] = Math.max(0, parseInt(rrr[1]) + config.extra.value); } } } } } function createHistory(history) { if (historyStr.length < 20) { for (record of history) { historyStr = historyStr + (record.crash / 100 >= currentPayout ? 1 : 0); } } else { historyStr = (history[0].crash / 100 >= currentPayout ? 1 : 0) + historyStr; while (historyStr.length > 200) { historyStr = historyStr.substr(0, 200); } } } function getBaseLog(x, y) { return Math.log(y) / Math.log(x); } function stringReverse(str) { return str.split("").reverse().join(""); } function round(num) { return Math.round(num * 100000000) / 100000000; } function out() { log.success('profit = ' + round(profit) + " ( " + round(profitMin) + " ~ " + round(profitMax) + " )"); var str = ""; if (loseCount) { str = '輸 ' + loseCount + " 回、"; } log.info("參 " + joinLaps + "、棄 " + (totalLaps - joinLaps) + "、共 " + totalLaps + "、" + str + "最大連輸 " + loseMax); if (overLaps.length > 0) { log.error("警告!突破歷史記錄"); for (var a = 0; a < overLaps.length; a++) { log.error(overLaps[a]); } } } Link to comment Share on other sites More sharing options...
真是的 Posted April 14, 2020 Author Share Posted April 14, 2020 資料更新 //自動 2倍 var ruleData = [ "01,1:20,2:17,3:17,4:17,5:11,6:8,7:5,8:4,9:4,10:3", "001,1:20,2:14,3:13,4:9,5:7,6:7,7:0", "0001,1:20,2:13,3:9,4:6,5:1", "00001,1:20,2:11,3:8,4:2", "000001,1:20,2:11,3:7", "0000001,1:20,2:11", "00000001,1:20,2:8", "000000001,1:20,2:2", "0000000001,1:20,2:2", "00000000001,1:10,2:0", "000000000001,1:10", "0000000000001,1:10", "00000000000001,1:9", "000000000000001,1:9", "0000000000000001,1:5", "00000000000000001,1:4", "000000000000000001,1:4", "0000000000000000001,1:1", "00000000000000000001,1:1", "000000000000000000001,1:1", "011,1:18,2:18,3:18,4:12,5:7,6:1,7:0", "0111,1:18,2:18,3:18,4:7", "01111,1:16,2:13,3:9,4:0", "011111,1:14,2:13,3:4", "0111111,1:13,2:9,3:4", "01111111,1:12,2:9", "011111111,1:12,2:9", "0111111111,1:11,2:0", "01111111111,1:11", "011111111111,1:11", "0111111111111,1:8", "01111111111111,1:8", "011111111111111,1:6", "0111111111111111,1:6", "01111111111111111,1:5", "011111111111111111,1:5", "0111111111111111111,1:2", "01111111111111111111,1:0", "011111111111111111111,1:0", "0011,1:17,2:13,3:8,4:3,5:2", "00111,1:17,2:10,3:5,4:1", "001111,1:14,2:10,3:4", "0011111,1:14,2:6,3:3", "00111111,1:13,2:4,3:0", "001111111,1:12,2:4", "0011111111,1:11,2:3", "00111111111,1:11,2:3", "001111111111,1:11,2:3", "0011111111111,1:11", "00111111111111,1:7", "001111111111111,1:7", "0011111111111111,1:6", "00111111111111111,1:6", "001111111111111111,1:5", "0011111111111111111,1:5", "00011,1:15,2:11,3:8,4:2", "000011,1:15,2:10,3:8", "0000011,1:15,2:7,3:3", "00000011,1:15,2:7,3:3", "000000011,1:15,2:3,3:3", "0000000011,1:15,2:3", "00000000011,1:9", "000000000011,1:9", "0000000000011,1:9", "00000000000011,1:9", "000000000000011,1:9", "0000000000000011,1:8", "00000000000000011,1:8", "000000000000000011,1:8", "0000000000000000011,1:2", "00000000000000000011,1:0", "000000000000000000011,1:0", "0000000000000000000011,1:0", "000111,1:17,2:10,3:2", "00001111,1:14,2:4", "0000011111,1:10", "000000111111,1:10", "00000001111111,1:6", "0000000011111111,1:5", "000000000111111111,1:5", "00000000001111111111,1:1" ]; function setRuleToTitle() { for (var a = 0; a < ruleData.length; a++) { config["rule" + a] = { label: "(" + (a) + ") " + ruleData[a].replace(/\,/g, ", ").replace(/:/g, "="), type: "title" }; } } var config = { title: { label: currency.amount + " ( " + currency.minAmount + "~" + currency.maxAmount + " )", type: 'title' }, title1: { label: "固定賭 2 倍,什麼時候下、下注金額、輸了乘幾倍都會自動計算", type: "title" }, title2: { label: "※ 填寫現在獎池金額、確保不會超過獎池限制。如果你的資金很少、不可能超過獎池,可以寫 0。獎池金額是變動的、請經常更新此欄位。", type: "title" }, title3: { label: "※ 填寫追加次數、改變容許的連輸次數以控制風險,標準為 1。增加次數、下注金額減少、撐過連輸次數變多、風險減少。減少次數、下注金額增多、撐過連輸次數減少、風險增加。", type: "title" }, pool: { label: '獎池', value: 0, type: 'number' }, extra: { label: '追加次數', value: 2, type: 'number' }, } var currentPayout = 2; var rebetRatio = 1 / (currentPayout - 1) + 1; var currentBet = 0; var historyStr = ""; var rules, candidate; var currentRule = null; var currentRepeat = 0; var currentLaps = 0; var poolLimit = 0; var overLaps = new Array(); var loseCount = 0; var count = 0; var profitMin = 0; var profitMax = 0; var profit = 0; var loseMax = 0; var totalLaps = 0; var joinLaps = 0; function main() { if (config.pool.value > 0) { poolLimit = config.pool.value * 0.0075 / currentPayout; } createHistory(engine.getHistory()); createRules(); checkResult(); log.info("最大撐到 " + (getAllowableLaps()) + " 局"); engine.on('GAME_STARTING', function() { totalLaps += 1; if (candidate != null && candidate.length > 0) { joinLaps += 1; var maxCandidate = candidate[0]; for (var a = 0; a < candidate.length; a++) { if (candidate[a][3] > maxCandidate[3]) { maxCandidate = candidate[a]; } } log.info(" "); log.success(stringReverse(historyStr.substr(0, 20))); var historyLaps = maxCandidate[2]; if (maxCandidate[4] > 0) { historyLaps += "-" + maxCandidate[4]; } log.info("規則 (" + maxCandidate[0] + ") x" + maxCandidate[1] + "," + (loseCount + 1) + "/" + historyLaps + "/" + getAllowableLaps() + " 局,下注 " + round(maxCandidate[3])); currentRule = maxCandidate; currentBet = maxCandidate[3]; if (currentBet <= 0) { engine.stop(); return; } engine.bet(currentBet, currentPayout) .catch(function(err) { log.error(err); out(); if (loseCount >= currentRule[2] - config.extra.value) { engine.stop(); return; } }); } }); engine.on('GAME_ENDED', function() { var history = engine.getHistory(); var lastGame = history[0]; createHistory(history); if (lastGame.wager) { lastGame.profit = (lastGame.wager * lastGame.cashedAt / 100) - lastGame.wager; if (lastGame.cashedAt) { count = 0; currentRule = null; loseCount = 0; log.success('開 ' + (lastGame.crash / 100) + ", 贏了 " + lastGame.profit); } else { count++; loseCount += 1; if (loseCount > currentRule[2] - config.extra.value) { overLaps[overLaps.length] = currentRule; } log.error('開 ' + (lastGame.crash / 100) + ", 輸了 " + lastGame.profit); } profit += lastGame.profit; profitMax = Math.max(profitMax, profit); profitMin = Math.min(profitMin, profit); loseMax = Math.max(loseMax, count); out(); } checkResult(); }); } function getAltBetAmount(laps) { firstBet = currency.amount * (1 - rebetRatio) / (1 - Math.pow(rebetRatio, laps)); if (firstBet < currency.minAmount) { log.error("剩餘金額 " + currency.amount + " 不足以撐過 " + laps + " 局。"); log.error("getAltBetAmount laps 不能大於 " + getAllowableLaps() + " 次。"); return -2; } lastBet = Math.pow(rebetRatio, laps - 1) * firstBet; if (lastBet > getLimit()) { firstBet = getLimit() / Math.pow(rebetRatio, laps - 1); lastBet = Math.pow(rebetRatio, laps - 1) * firstBet; } return firstBet < currency.minAmount ? -1 : firstBet; } function checkResult() { candidate = new Array(); var safeLaps = getAllowableLaps(); for (var a = 0; a < rules.length; a++) { if (currentRule != null && currentRule[0] == a) { currentRule[3] *= rebetRatio; candidate[candidate.length] = currentRule; continue; } var rule = rules[a]; var pattren = stringReverse(rule[0]); var endIndex = -1; var startIndex = historyStr.indexOf(pattren, endIndex); var leftZero = 0; if (startIndex != -1 && historyStr.indexOf("1") == startIndex) { leftZero = startIndex; } else { continue; } endIndex = startIndex + pattren.length; var secondIndex = historyStr.indexOf(pattren, endIndex); while (secondIndex == endIndex) { endIndex = secondIndex + pattren.length; secondIndex = historyStr.indexOf(pattren, endIndex); } var repeat = (endIndex - startIndex) / pattren.length; var last = rule[rule.length - 1]; var matchRule = null; if (repeat > last[0]) { if (safeLaps >= last[1] - leftZero) { matchRule = last; } } else { for (var b = rule.length - 1; b > 0; b--) { if (repeat >= rule[b][0]) { if (safeLaps >= rule[b][1] - leftZero) { matchRule = rule[b]; } break; } else { } } } if (matchRule != null) { currentRepeat = matchRule[0]; currentLaps = matchRule[1]; candidate[candidate.length] = [a, currentRepeat, currentLaps, getAltBetAmount(currentLaps - leftZero), leftZero]; } } } function getLimit() { var limit = currency.maxAmount; if (config.pool.value > 0) { limit = Math.min(currency.maxAmount, poolLimit); } return limit; } function getAllowableLaps() { return Math.floor(1 - getBaseLog(rebetRatio, currency.minAmount / Math.min(currency.amount / currentPayout, getLimit()))); } function createRules() { rules = new Array(); for (var a = 0; a < ruleData.length; a++) { var index1 = ruleData[a].indexOf(","); var index2 = index1 > 0 ? ruleData[a].indexOf(":", index1 + 2) : -1; if (index2 >= 3) { var index3 = rules.length; var rr = rules[index3] = ruleData[a].split(","); for (var b = 1; b < rr.length; b++) { var rrr = rr[b] = rr[b].split(":"); if (rrr.length == 2) { rrr[0] = parseInt(rrr[0]); rrr[1] = Math.max(0, parseInt(rrr[1]) + config.extra.value); } } } } } function createHistory(history) { if (historyStr.length < 20) { for (record of history) { historyStr = historyStr + (record.crash / 100 >= currentPayout ? 1 : 0); } } else { historyStr = (history[0].crash / 100 >= currentPayout ? 1 : 0) + historyStr; while (historyStr.length > 200) { historyStr = historyStr.substr(0, 200); } } } function getBaseLog(x, y) { return Math.log(y) / Math.log(x); } function stringReverse(str) { return str.split("").reverse().join(""); } function round(num) { return Math.round(num * 100000000) / 100000000; } function out() { log.success('profit = ' + round(profit) + " ( " + round(profitMin) + " ~ " + round(profitMax) + " )"); var str = ""; if (loseCount) { str = '輸 ' + loseCount + " 回、"; } log.info("參 " + joinLaps + "、棄 " + (totalLaps - joinLaps) + "、共 " + totalLaps + "、" + str + "最大連輸 " + loseMax); if (overLaps.length > 0) { log.error("警告!突破歷史記錄"); for (var a = 0; a < overLaps.length; a++) { log.error(overLaps[a]); } } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.