ruzli
8/14/2018 - 12:04 PM

Awaiting to streaks and then stop

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)
  }