Skip to content

Instantly share code, notes, and snippets.

@ruzli
Last active June 25, 2020 06:16
Show Gist options
  • Save ruzli/c5cfc54df99f1e3bb6c299258cf874cd to your computer and use it in GitHub Desktop.
Save ruzli/c5cfc54df99f1e3bb6c299258cf874cd to your computer and use it in GitHub Desktop.
10x original good version
var config = {
baseBet: { label: "Base bet", type: "balance", value: 200 },
target: { label: "Target", type: "multiplier", value: 10 },
multiplyBy: { label: "Multiply by", type: "multiplier", value: 3 },
addupmultiply: { label: "Add-up/Multiply", type: "checkbox", value: false },
multiplyByExtra: { label: "Multiply by Extra", type: "multiplier", value: 3 },
skipsAmount: { label: "Skips Amount", type: "number", value: 12 },
maxLoses: { label: "Max Loses", type: "number", value: 9 },
maxLosesExtra: { label: "Max Loses Extra", type: "number", value: 10 },
minProfit: { label: "Min Profit", type: "balance", value: -28000000 },
maxProfit: { label: "Max Profit", type: "balance", value: 40000000 },
changeSeedAfterWins: { label: "Change Seed After Wins", type: "number", value: 2 }
}
var baseBet = config.baseBet.value
var target = config.target.value
var skipsAmount = config.skipsAmount.value
var maxLoses = config.maxLoses.value
var maxLosesExtra = config.maxLosesExtra.value
var multiplyBy = config.multiplyBy.value
var multiplyByExtra = config.multiplyByExtra.value
var changeSeedAfterWins = config.changeSeedAfterWins.value
var minProfit = config.minProfit.value
var maxProfit = config.maxProfit.value
var currentBet = baseBet
let rolls = 0
var skips = 0
let loses = 0
let extraloses = 0
let extralosesCounter = 0
let wins = 0
let PROFIT = 0
while(true){
rolls++
this.clearLog()
this.log(`Current Profit: ${PROFIT / 100} bits`)
this.log(`Skips ${skips}/${skipsAmount}`)
if (skips < skipsAmount){
//var { multiplier } = await this.bet(100, 1.01)
var { multiplier } = await this.bet(100, config.target.value)
if (multiplier < target){
skips++
} else {
skips = 0
}
}
if (skips >= skipsAmount){
if (PROFIT > maxProfit || (PROFIT - currentBet) < minProfit) {
this.log(`Maximal lose or win reached`)
this.stop()
}
const { multiplier } = await this.bet(roundBit(currentBet), target)
if (multiplier >= target){
/* WIN */
wins++
loses = 0
skips = 0
PROFIT += (currentBet * (target - 1))
extraloses = 0
extralosesCounter = 0
if (config.addupmultiply.value){
currentBet = baseBet
}
} else {
/* LOSE */
PROFIT -= currentBet
loses++
extralosesCounter++
if (extralosesCounter >= maxLosesExtra){
extraloses++
extralosesCounter = 0
}
if (config.addupmultiply.value){
currentBet += multiplyBy * 100
}
}
if (config.addupmultiply.value == false){
currentBet = getBet(loses)
}
}
if (wins >= changeSeedAfterWins){
wins = 0
await generateSeed(this)
}
}
function getBet(loses){
let curBet = baseBet
if (loses > maxLoses + maxLosesExtra){
curBet = baseBet * (multiplyByExtra ** (extraloses-1))
} else if (loses > maxLoses) {
curBet = baseBet * multiplyBy
}
return curBet
}
/* Generate new seed pair for server hash and client seed. */
async function generateSeed(context) {
if (config.changeSeedAfterWins.value > 0){
try {
const { server_seed_hash } = await context.newSeedPair()
await context.setClientSeed(server_seed_hash)
} catch (error) {
console.log(`Seed was already reset`)
}
}
};
function roundBit(bet) {
return Math.max(100, Math.round((bet) / 100) * 100)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment