Skip to content

Instantly share code, notes, and snippets.

@dsetzer
Last active August 18, 2019 04:11
Show Gist options
  • Save dsetzer/3a2451dacd95ccd4bbcce3793ef90eeb to your computer and use it in GitHub Desktop.
Save dsetzer/3a2451dacd95ccd4bbcce3793ef90eeb to your computer and use it in GitHub Desktop.
bustadice honeycomb pattern script (is harmless)
var baseBet = 6 * 100;
var basePayout = 1.1;
var currentPayout = 1.1;
var betLossMult = 20;
var betWinMult = 1;
var payoutLossMult = 0.981;
var payoutWinMult = 1.33;
// note to self: 1.08=x12.51 1.07=x14.29 1.06=x16.67 1.05=x20 1.04=x25 1.03=x33.34
var payoutMin = 1.05;
var payoutMax = 3;
var sinceWin = 0;
var sinceLoss = 0;
var currentBet = baseBet;
var startBal = this.balance;
console.log('Script is running..');
let running = true;
while(running){
const { multiplier } = await this.bet(roundBit(currentBet), currentPayout);
if (multiplier >= currentPayout) {
if(sinceWin > 0){
currentBet = baseBet;
currentPayout = basePayout;
}else{
currentBet *= betWinMult;
currentPayout += payoutWinMult;
if(currentPayout > payoutMax){
currentPayout = basePayout;
}
}
sinceWin = 0;
sinceLoss++;
console.log('We won, so next bet will be', currentBet / 100, 'bits');
} else {
if(sinceLoss > 0){
currentPayout = basePayout;
}else{
currentPayout *= payoutLossMult;
if(currentPayout < payoutMin){
currentPayout = payoutMin;
}
console.log(`Current payout ${currentPayout}`);
}
currentBet *= getBetMultiple(currentPayout);
sinceWin++;
sinceLoss = 0;
console.log('We lost, so next bet will be', currentBet / 100, 'bits');
}
if (currentBet > (startBal * 100)) {
console.log('Was about to bet', currentBet, 'which triggers the stop');
currentBet = baseBet;
currentPayout = basePayout;
}
await sleep(500);
}
function roundBit(bet) {
return Math.round(bet / 100) * 100;
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function getBetMultiple(target) {
((`${target}`).includes('.') || target < 100) ? target = Math.round(target * 100): null;
let digits = (`${target }`).length - 1;
return (((Math.ceil((1 / (1 - (Math.ceil(((100 / 101) * (99 / (((target * 1) / 100) * 100 - 1))) * (Math.pow(10,digits)))) / (Math.pow(10,digits)))) * (Math.pow(100, (digits - 1)))) / (Math.pow(100, (digits - 1)))).toFixed(digits)) / 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment