Last active
September 24, 2018 13:27
-
-
Save ruzli/4c184ff7afca41fba18fe7d8066e4603 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Simulated script */ | |
const baseBet = 200 // how many satoshis to bet initially | |
const target = 2.00 // target multiplier | |
const betMultiplier = 2 // what to multiply the bet size by when we lose a wager | |
let balance = 2000 /* Simulated Balance */ | |
const skipscounter = 9 | |
let lossCount = 0 | |
let skips = 0 | |
this.log(`Balance: ${balance}.`) | |
this.log("[WAGER][TARGET][OUTCOME][PROFIT]") | |
while (true){ | |
skips++ | |
if( balance < betSize(lossCount) / 100){ | |
await this.stop() | |
}else{ | |
this.log(`Balance: ${balance} Bet: ${betSize(lossCount) / 100}`)} | |
/* [WAGER][TARGET][OUTCOME][PROFIT] */ | |
if (skips >= skipscounter){ | |
const { multiplier } = await this.bet(100, 1.01) | |
skips = 0 | |
} else { | |
const { multiplier } = await this.skip() | |
} | |
if (multiplier < target){ /* [LOSS] */ | |
collectSound() | |
balance = balance - betSize(lossCount) / 100 | |
//this.log(`[LOST] ${betSize(lossCount) / 100} ${target}x ${multiplier}x -Ƀ ${betSize(lossCount) / 100}`) | |
this.log(`[LOST]`) | |
this.log(`${betSize(lossCount) / 100}`) /* For parse */ | |
lossCount++ | |
}else{ /* [WON] */ | |
gong() | |
balance = balance + betSize(lossCount) / 100 | |
//this.log(`[WINS] ${betSize(lossCount) / 100} ${target}x ${multiplier}x Ƀ ${betSize(lossCount)*target / 100}`) | |
this.log(`[WINS]`) | |
this.log(`${betSize(lossCount) * target / 100}`) /* For parse */ | |
lossCount = 0 | |
} | |
} | |
function betSize(lossCount) { | |
let bet = baseBet * lossCount * betMultiplier | |
if (bet <= 1){bet = baseBet} | |
return bet | |
} | |
function gong(){ | |
const audio = new Audio("https://bustadice.com/5bb187b7ef764e76fb519939f77288c1.mp3") | |
audio.play() | |
return new Promise(resolve => audio.onended = resolve) | |
} | |
function collectSound(){ | |
const audio = new Audio ("http://kz-developer.ru/sounds/chipsHandle6.wav") | |
audio.play() | |
return new Promise(resolve => audio.onended = resolve) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment