ThaoVy Posted January 7, 2024 Posted January 7, 2024 I have a Lua script that runs very well. Can anyone help me convert this script to Crash? base = balance * 0.00000100 base2 = base chance = 50 nextbet = base targetprofit = balance * 1.05 ppc = 1.005 tg = base mt = 1 bethigh = false balmax = balance * 1.001 function dobet() if math.random(1, 3) % 2 == 0 then bethigh = true else bethigh = false end chance = math.random(45, 55) print("Multi: " .. mt) if balance >= targetprofit then stop() print("") print("") print (">>> Profit reached: " .. string.format("%.8f", profit)) print("") print("") end if win then if profit >= tg then tg = profit * ppc nextbet = base2 else if profit >= 0 then mt = 1 else mt = -1 end nextbet = profit * mt * 0.15 + base end else if profit >= 0 then mt = 1 else mt =- 1 end nextbet = previousbet * (chance/25) if nextbet >= profit then base = previousbet * 0.1 + base end end if balance >= balmax then balmax = balance * 1.001 nextbet = base2 print("balmax: "..balmax) end end
Sam888 Posted January 12, 2024 Posted January 12, 2024 در تاریخ 1/10/2024 در ساعت 21:53، Ffzcbbtyzoyb گفت: این اسکریپت Lua روی کدام بازی اجرا می شود.. در تاریخ 1/7/2024 ساعت 5:44 ق.ظ، ThaoVy گفت: من یک اسکریپت Lua دارم که خیلی خوب اجرا می شود. آیا کسی می تواند به من کمک کند تا این اسکریپت را به Crash تبدیل کنم؟ پایه = تعادل * 0.00000100 base2 = شانس پایه = 50 شرط بعدی = سود هدف پایه = تعادل * 1.05 ppc = 1.005 tg = پایه mt = 1 bethigh = balmax کاذب = تعادل * 1.001 تابع dobet() اگر math.random(1, 3) % 2 == 0 سپس bethigh = true other bethigh = پایان نادرست شانس = math.random (45، 55) چاپ ("چند:" .. mt) if balance >= targetprofit سپس stop() print("") print("") print (">>> سود رسید: " .. string.format("%.8f", profit)) print("") print ("") پایان اگر برنده شد، پس اگر سود >= tg، سپس tg = سود * ppc بعدی = base2 اگر سود >= 0 سپس mt = 1 mt دیگر mt = -1 end next bet = سود * mt * 0.15 + پایان پایه دیگر اگر سود >= 0 پس mt = 1 mt دیگر =- 1 پایان بعدی = شرط قبلی * (شانس/25) اگر nextbet >= سود، پایه = شرط قبلی * 0.1 + پایان پایان پایه اگر تعادل >= balmax سپس balmax = تعادل * 1.001 nextbet = base2 print("balmax: "..balmax) پایان پایان I'm sorry
Skele Posted January 12, 2024 Posted January 12, 2024 i am working on it give me a few minutes. Here you go i made sure it loaded but that was all the validation i did really. So make sure the logic is still correct and good luck. var config = { betTitle:{ label: 'Bets', type: 'title' }, baseBet: { label: 'Base Bet', value: currency.amount * 0.00000100 , type: 'number' }, payoutTitle: { label: 'Payout Section (There is a high and a low value, when set a random value will be chosen between these numbers)', type: 'title' }, chanceLow: { label: 'percentage change to set payout low', value: 45, type: 'number' }, chanceHigh: { label: 'percentage change to set payout high', value: 55, type: 'number' }, stoppingConditions: { label: 'Stopping Conditions', type: 'title' }, targetProfit: { label: 'Target Profit', type: 'number', value: currency.amount * 1.05 } }; var base = config.baseBet.value; var base2 = base; var chance = 50; var nextbet = base; var targetprofit = config.targetProfit.value; var ppc = 1.005; var tg = base; var mt = 1; var bethigh = false; var balmax = currency.amount * 1.001; var previousbet = nextbet; var startingBalance = currency.amount; var runningBalance = currency.amount; function main() { game.onBet = function(){ // this random function will return a number between 1 and 3 inclusively so (1,2,3) if that is not the desired behavior you should modify the inputs. if(GetRandomInt(1, 3) % 2 == 0) { bethigh = true; } else { bethigh = false; } chance = GetRandomInt(config.chanceLow.value, config.chanceHigh.value); log.info("Multi: " + mt); if((runningBalance - startingBalance) >= config.targetProfit.value) { game.stop(); log.info(""); log.info(""); log.info(">>> Profit reached: " + profit.toFixed(8)); log.info(""); log.info(""); } game.bet(nextbet, (99.00/chance)).then(function(payout) { // also making the assumption here that profit is supposed to be the profit just from the last bet. So a loss should be -betamount and a win would be betamount * payout - betamout // if this is not the case and you wanted a running netProfit you will have to add that in yourself to track it as the balance value is only ever accurate when the script initially starts. its like a snap shot. let profit = currentBet * config.payout.value - currentBet; // Didn't see this declared anywhere just used below so i am initializing it before the nextbet is modified previousbet = nextbet; runningBalance -= previousbet; if(payout > 1) { runningBalance += previousbet * payout; if(profit >= tg) { tg = profit * ppc; nextbet = base2; } else { if(profit >= 0) { mt = 1; } else { mt = -1; } nextbet = profit * mt * 0.15 + base; } } else { if(profit >= 0) { mt = 1; } else { mt =- 1; } nextbet = previousbet * (chance/25); if( nextbet >= profit) { base = previousbet * 0.1 + base } } if(runningBalance >= balmax) { balmax = runningBalance * 1.001 nextbet = base2 log.info("balmax: " + balmax) } }) } } function GetRandomInt(min, max) { var retValue = Math.floor(Math.random() * (max - min)) + min; return retValue; } function GetRandomFloat(min, max) { var retValue = Math.parseFloat((Math.floor(Math.random() * (max - min)) + min).toFixed(4)); return retValue; }
Clownfacee Posted January 31, 2024 Posted January 31, 2024 On 1/12/2024 at 9:13 PM, Skele said: i am working on it give me a few minutes. Here you go i made sure it loaded but that was all the validation i did really. So make sure the logic is still correct and good luck. var config = { betTitle:{ label: 'Bets', type: 'title' }, baseBet: { label: 'Base Bet', value: currency.amount * 0.00000100 , type: 'number' }, payoutTitle: { label: 'Payout Section (There is a high and a low value, when set a random value will be chosen between these numbers)', type: 'title' }, chanceLow: { label: 'percentage change to set payout low', value: 45, type: 'number' }, chanceHigh: { label: 'percentage change to set payout high', value: 55, type: 'number' }, stoppingConditions: { label: 'Stopping Conditions', type: 'title' }, targetProfit: { label: 'Target Profit', type: 'number', value: currency.amount * 1.05 } }; var base = config.baseBet.value; var base2 = base; var chance = 50; var nextbet = base; var targetprofit = config.targetProfit.value; var ppc = 1.005; var tg = base; var mt = 1; var bethigh = false; var balmax = currency.amount * 1.001; var previousbet = nextbet; var startingBalance = currency.amount; var runningBalance = currency.amount; function main() { game.onBet = function(){ // this random function will return a number between 1 and 3 inclusively so (1,2,3) if that is not the desired behavior you should modify the inputs. if(GetRandomInt(1, 3) % 2 == 0) { bethigh = true; } else { bethigh = false; } chance = GetRandomInt(config.chanceLow.value, config.chanceHigh.value); log.info("Multi: " + mt); if((runningBalance - startingBalance) >= config.targetProfit.value) { game.stop(); log.info(""); log.info(""); log.info(">>> Profit reached: " + profit.toFixed(8)); log.info(""); log.info(""); } game.bet(nextbet, (99.00/chance)).then(function(payout) { // also making the assumption here that profit is supposed to be the profit just from the last bet. So a loss should be -betamount and a win would be betamount * payout - betamout // if this is not the case and you wanted a running netProfit you will have to add that in yourself to track it as the balance value is only ever accurate when the script initially starts. its like a snap shot. let profit = currentBet * config.payout.value - currentBet; // Didn't see this declared anywhere just used below so i am initializing it before the nextbet is modified previousbet = nextbet; runningBalance -= previousbet; if(payout > 1) { runningBalance += previousbet * payout; if(profit >= tg) { tg = profit * ppc; nextbet = base2; } else { if(profit >= 0) { mt = 1; } else { mt = -1; } nextbet = profit * mt * 0.15 + base; } } else { if(profit >= 0) { mt = 1; } else { mt =- 1; } nextbet = previousbet * (chance/25); if( nextbet >= profit) { base = previousbet * 0.1 + base } } if(runningBalance >= balmax) { balmax = runningBalance * 1.001 nextbet = base2 log.info("balmax: " + balmax) } }) } } function GetRandomInt(min, max) { var retValue = Math.floor(Math.random() * (max - min)) + min; return retValue; } function GetRandomFloat(min, max) { var retValue = Math.parseFloat((Math.floor(Math.random() * (max - min)) + min).toFixed(4)); return retValue; }
Campsbfogpac Posted March 23, 2024 Posted March 23, 2024 var config = { betTitle:{ label:"Bets", type:"title" }, baseBet:{ label: "Base Bet", value: currency.amount * 0.00000100, type: "number" }, payoutTitle:{ label: "Payout Section (There is a high and a low value, when set a random value will be chosen between these numbers)", type: "title" }, chanceLow: { label: "percentage change to set payout low", value: 45, type: "number" }, chanceHigh: { label: "percentage change to set payout high", value: 55, type: "number" }, stoppingConditions: { label: "Stopping Conditions", type: "title" }, targetProfit: { label: "Target Profit", type: "number", value: currency.amount * 1.05 } }; var base = config.baseBet.value; var base2 = base; var chance = 50; var nextbet = base; var targetprofit = config.targetProfit.value; var ppc = 1.005; var tg = base; var mt = 1; var bethigh = false; var balmax = currency.amount * 1.001; var previousbet = nextbet; var startingBalance = currency.amount; var runningBalance = currency.amount; var payoutValue = 99.00 / chance; function main(){ game.onBet = function(){ // this random function will return a number between 1 and 3 inclusively so (1,2,3) if that is not the desired behavior you should modify the inputs. if(GetRandomInt(1, 3) % 2 === 0){ bethigh = true; } else { bethigh = false; } chance = GetRandomInt(config.chanceLow.value, config.chanceHigh.value); payoutValue = 99.00 / chance; log.info("Multi: " + mt); if((runningBalance - startingBalance) >= targetprofit){ game.stop(); log.info(""); log.info(""); log.info(">>> Profit reached: " + profit.toFixed(8)); log.info(""); log.info(""); } log.info(nextbet); game.bet(nextbet, payoutValue).then(function(payout){ var profit = nextbet * payoutValue - nextbet; previousbet = nextbet; runningBalance -= previousbet; if(payout > 1){ runningBalance += previousbet * payoutValue; if(profit >= tg){ tg = profit * ppc; nextbet = base2; } else { if(profit >= 0){ mt = 1; } else { mt = -1; } nextbet = profit * mt * 0.15 + base; } } else { if(profit >= 0){ mt = 1; } else { mt =- 1; } nextbet = previousbet * (chance / 25); if( nextbet >= profit){ base = previousbet * 0.1 + base; } } if(runningBalance >= balmax){ balmax = runningBalance * 1.001; nextbet = base2; log.info("balmax: " + balmax); } }); }; } function GetRandomInt(min, max) { var retValue = Math.floor(Math.random() * (max - min)) + min; return retValue; } I fixed it.
ThaoVy Posted March 26, 2024 Author Posted March 26, 2024 Vào ngày 23/03/2024 lúc 7:50 PM, Campsbfogpac nói: var config = { betTitle:{ label:"Bets", type:"title" }, baseBet:{ label: "Base Bet", value: currency.amount * 0.00000100, type: "number" }, payoutTitle:{ label: "Payout Section (There is a high and a low value, when set a random value will be chosen between these numbers)", type: "title" }, chanceLow: { label: "percentage change to set payout low", value: 45, type: "number" }, chanceHigh: { label: "percentage change to set payout high", value: 55, type: "number" }, stoppingConditions: { label: "Stopping Conditions", type: "title" }, targetProfit: { label: "Target Profit", type: "number", value: currency.amount * 1.05 } }; var base = config.baseBet.value; var base2 = base; var chance = 50; var nextbet = base; var targetprofit = config.targetProfit.value; var ppc = 1.005; var tg = base; var mt = 1; var bethigh = false; var balmax = currency.amount * 1.001; var previousbet = nextbet; var startingBalance = currency.amount; var runningBalance = currency.amount; var payoutValue = 99.00 / chance; function main(){ game.onBet = function(){ // this random function will return a number between 1 and 3 inclusively so (1,2,3) if that is not the desired behavior you should modify the inputs. if(GetRandomInt(1, 3) % 2 === 0){ bethigh = true; } else { bethigh = false; } chance = GetRandomInt(config.chanceLow.value, config.chanceHigh.value); payoutValue = 99.00 / chance; log.info("Multi: " + mt); if ((RunningBalance - startBalance) > = targetprofit) { game.stop (); log.info (""); log.info (""); log.info ("> > > Lợi nhuận đạt được:" + Profit.toFixed (8)); log.info (""); log.info (""); } log.info (nextbet); game.bet (nextbet, payoutValue) .then (function (payout) { var lợi nhuận = nextbet * payoutValue - nextbet; trước đó = nextbet; runBalance - = trước đó; if (thanh toán > 1) { runBalance + = trước đó * payoutValue; if (lợi nhuận > = tg) { tg = lợi nhuận * ppc; nextbet = base2; } khác { if (lợi nhuận > = 0) { mt = 1; } khác { mt = -1; } cơ sở nextbet = lợi nhuận * mt * 0,15 +; } } khác { if (lợi nhuận > = 0) { mt = 1; } khác { mt = - 1; } nextbet = prebet * (cơ hội / 25); if (tiếp theo > = lãi) { cơ sở = cơ sở trước * 0,1 + cơ sở; } } if (runningBalance > = balmax) { balmax = runBalance * 1.001; nextbet = base2; log.info ("balmax:" + balmax); } }); };} chức năng GetRandomInt (tối thiểu, tối đa) {var retValue = Math.floor (Math.random () * (max - min)) + min;trả lại retValue;} Tôi đã sửa nó. Thank you very much. You have been very enthusiastic in your support to redo this code. I tested and adjusted the interest rate to its original 5% and it worked very well. var config = { betTitle:{ label:"Bets", type:"title" }, baseBet:{ label: "Base Bet", value: currency.amount * 0.000100, type: "number" }, payoutTitle:{ label: "Payout Section (There is a high and a low value, when set a random value will be chosen between these numbers)", type: "title" }, chanceLow: { label: "percentage change to set payout low", value: 45, type: "number" }, chanceHigh: { label: "percentage change to set payout high", value: 55, type: "number" }, stoppingConditions: { label: "Stopping Conditions", type: "title" }, targetProfit: { label: "Target Profit", type: "number", value: currency.amount * 0.05 } }; var base = config.baseBet.value; var base2 = base; var chance = 50; var nextbet = base; var targetprofit = config.targetProfit.value; var ppc = 1.005; var tg = base; var mt = 1; var bethigh = false; var balmax = currency.amount * 1.0001; var previousbet = nextbet; var startingBalance = currency.amount; var runningBalance = currency.amount; var payoutValue = 99.00 / chance; function main(){ game.onBet = function(){ // this random function will return a number between 1 and 3 inclusively so (1,2,3) if that is not the desired behavior you should modify the inputs. if(GetRandomInt(1, 3) % 2 === 0){ bethigh = true; } else { bethigh = false; } chance = GetRandomInt(config.chanceLow.value, config.chanceHigh.value); payoutValue = 99.00 / chance; log.info("Multi: " + mt); if((runningBalance - startingBalance) >= targetprofit){ game.stop(); log.info(""); log.info(""); log.info(">>> Profit reached: " + profit.toFixed(8)); log.info(""); log.info(""); } log.info(nextbet); game.bet(nextbet, payoutValue).then(function(payout){ var profit = nextbet * payoutValue - nextbet; previousbet = nextbet; runningBalance -= previousbet; if(payout > 1){ runningBalance += previousbet * payoutValue; if(profit >= tg){ tg = profit * ppc; nextbet = base2; } else { if(profit >= 0){ mt = 1; } else { mt = -1; } nextbet = profit * mt * 0.15 + base; } } else { if(profit >= 0){ mt = 1; } else { mt =- 1; } nextbet = previousbet * (chance / 25); if( nextbet >= profit){ base = previousbet * 0.1 + base; } } if(runningBalance >= balmax){ balmax = runningBalance * 1.001; nextbet = base2; log.info("balmax: " + balmax); } }); }; } function GetRandomInt(min, max) { var retValue = Math.floor(Math.random() * (max - min)) + min; return retValue; } I hope you stop when you have 5-10% of your capital left to avoid losing everything^^
fabio_crd Posted April 14, 2024 Posted April 14, 2024 Alguém consegue corrigir o erro do martingale desse script, após um numero máximo de perdas o payout reduz mas n consigo colocar o martingale pra calcular o valor certo para obter lucros? var config = { bet: { label: "bet", value: 0.01, type: "number" }, payout: { label: "payout", value: 2, type: "number" }, maxLosses: { label: "maxLosses", value: 5, type: "number" }, }; var losses = 0; var initialBet = config.bet.value; var totalLoss = 0; var totalProfit = 0; function main() { game.onBet = function() { game.bet(config.bet.value, config.payout.value).then(function(payout) { if (payout > 1) { var profit = config.bet.value * (payout - 1); totalProfit += profit; log.success("Ganhamos, pagamento " + payout + "X! Lucro total: " + totalProfit); losses = 0; totalLoss = 0; config.bet.value = initialBet; config.payout.value = 2; } else { var loss = config.bet.value; totalLoss += loss; log.error("Perdemos, pagamento " + payout + "X! Perda total: " + totalLoss); losses++; if (losses <= config.maxLosses.value) { config.bet.value *= 2; // Dobrar a aposta } if (losses == config.maxLosses.value) { config.payout.value = 1.35; // Reduzir o payout config.bet.value = totalLoss / (config.payout.value - 1); // Ajustar a aposta para garantir o lucro } } }); }; }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.