Skip to content

Instantly share code, notes, and snippets.

@dsetzer
Created December 15, 2018 01:30
Show Gist options
  • Select an option

  • Save dsetzer/c791fdea150bd5df0fcbd2fb69d2dc95 to your computer and use it in GitHub Desktop.

Select an option

Save dsetzer/c791fdea150bd5df0fcbd2fb69d2dc95 to your computer and use it in GitHub Desktop.
const maxBankrollToBet = 0.1 // 0.1% Recommended (if you have 50k bits, bets up to 50 at a time)
const baseMultiplier = 138
const winMultInc = 7
const lossMultInc = 77
const betSpeed = 150
//-------------------------
let ourBet = 0
let ourMultiplier = 0
let currentBet = 0
let currentMultiplier = 0
let gameNum = 0
let gamesPlayed = 0
let gamesWon = 0
let gamesLost = 0
let bitsWon = 0
let currentProfits = 0
let playing = 0
let loseStreak = 0
let winStreak = 0
let startBal = this.balance
let lastWon = "Not Played"
let ourStatus = ""
console.clear()
console.log("~~~ Maximum percentage of bankroll to bet: " + maxBankrollToBet + "% ~~~")
console.log("~~~ Base multiplier: " + baseMultiplier / 100 + "x ~~~");
console.log("~~~ For every loss, increasing multiplier by: " + winMultInc / 100 + "x ~~~")
console.log("~~~ For every win, increasing multiplier by: " + lossMultInc / 100 + "x ~~~")
console.log("~~~~~~~~~~~~~~~~~~~~~~ SCRIPT STARTED ~~~~~~~~~~~~~~~~~~~~~~")
let running = true
while (running) {
playing = 0;
ourStatus = ""
startBal = this.balance
ourBet = 0
ourMultiplier = 0
currentBet = 0
currentMultiplier = 0
currentProfits = 0
ourMultiplier = baseMultiplier + ((winMultInc * winStreak) + ((lossMultInc * loseStreak)))
ourBet = startBal * (maxBankrollToBet / (200 - (loseStreak + winStreak)))
if (ourBet > 0) {
playing = 1
startBal = this.balance
if (ourBet > (startBal * (maxBankrollToBet / 100))) { ourBet = startBal * (maxBankrollToBet / 100); }
currentBet = Math.floor(ourBet / 100) * 100
currentMultiplier = Math.floor(ourMultiplier)
if (currentBet < 100) {
currentBet = 100
}
if (currentMultiplier < 101) {
currentMultiplier = 101
}
const { multiplier } = await this.bet(currentBet, currentMultiplier / 100)
this.log("We bet " + addCommas(currentBet / 100) + " bits @ " + currentMultiplier / 100 + "x ~ Won/Played: " + gamesWon + "/" + gamesPlayed + " ~ Total Profit: " + addCommas(Math.floor(bitsWon * 100) / 100) + " bits")
if (multiplier >= (currentMultiplier / 100)) {
lastWon = "yes"
winStreak++
loseStreak = 0
gamesWon++
currentProfits = ((currentBet * (currentMultiplier / 100)) - currentBet) / 100
bitsWon += currentProfits
bitsWon = Math.floor(bitsWon * 100) / 100
ourStatus = "We won " + addCommas(Math.floor(currentProfits * 100) / 100) + " bits!"
} else {
lastWon = "no"
loseStreak++
winStreak = 0
bitsWon -= currentBet / 100
bitsWon = Math.floor(bitsWon)
ourStatus = "We lost " + addCommas(currentBet / 100) + " bits!"
}
gamesPlayed++
} else {
ourStatus = "We are sitting out, either due to not betting, or a bug."
}
if (gameNum > 0) {
console.log(ourStatus)
}
console.log(ourStatus)
gameNum++
await sleep(betSpeed)
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
function addCommas(value) {
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment