Skip to content

Instantly share code, notes, and snippets.

@ruzli
Last active October 5, 2018 01:45
Show Gist options
  • Save ruzli/8ef69435ce93d6c709f8a62840e19d41 to your computer and use it in GitHub Desktop.
Save ruzli/8ef69435ce93d6c709f8a62840e19d41 to your computer and use it in GitHub Desktop.
const streakToWait = 12
let rolls = 0
let lossCount = 0
while (lossCount <= streakToWait) {
rolls++
const { multiplier } = await this.bet(100, 1.01)
if (multiplier < 2){lossCount++} else {lossCount = 0}
if (lossCount == streakToWait){
this.log(`${rolls} rolls has pasted to catch streak. Good luck!`)
gong()
await this.stop()
}
}
async function betSize(lossCount) {
if (lossCount == streakToWait){
this.log(`${rolls} rolls has pasted to catch streak. Good luck!`)
gong()
await this.stop()
}
return 100
}
function gong() {
const audio = new Audio("https://bustadice.com/5bb187b7ef764e76fb519939f77288c1.mp3")
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