Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const baseBet = 100 // 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 continuousRecovery = true //if true then numberOfRecoveryTries isn't applied
- const numberOfRecoveryTries = 10
- const resetSeedEveryXgames = 10
- //---------------------------------------------------------------
- let resetCounter = 0
- let lossCount = 0
- this.log(`Starting martingale with a base bet of ${baseBet} satoshis.`)
- while (true) {
- resetCounter++
- if (resetCounter > resetSeedEveryXgames) {
- setNewSeed()
- resetCounter = 0
- }
- // make the bet and wait for the result
- const { multiplier } = await this.bet(betSize(lossCount), target)
- if (multiplier < target) { // loss
- lossCount++
- if (!continuousRecovery && lossCount >= numberOfRecoveryTries) {
- lossCount = 0
- this.log(`Tried too hard to recovery but failed. Resetting bet now.`)
- }else{
- this.log(`Lost bet. Multiplying bet size by ${betMultiplier} for new bet size of ${betSize(lossCount)} satoshis.`)
- }
- } else { // win
- lossCount = 0
- this.log(`Won bet. Setting bet size to ${baseBet} satoshis.`)
- }
- }
- function betSize(lossCount) {
- const bet = baseBet * Math.pow(betMultiplier, lossCount)
- return Math.round(bet / 100) * 100
- }
- function setNewSeed() {
- const { server_seed_hash } = await this.newSeedPair()
- await this.log("The new server seed has the hash: ", server_seed_hash)
- // set the client seed
- const clientSeed = randomSeed()
- await this.setClientSeed(clientSeed)
- await this.log("The client seed was set to: ", clientSeed)
- }
- function randomSeed() {
- const words = ['Alpha ','Bra3qtwvo ','Charlie ','Delta ','Echo ',
- 'Foxtrot ','Go3tewlf ','Hotel ','Indda ','Juliet ',
- 'Kiqagalo ','L24rqwima ','Mirhe ','November ','Oscar ',
- 'Papayww ','Quebec ','Romeo ','Sierra ','Tango ',
- 'Uniform ','Victor ','Whiskey ','X-ray ','pooper ','Zulu ']
- return words[Math.floor(words.length * Math.random())] + words[Math.floor(words.length * Math.random())] + words[Math.floor(words.length * Math.random())]
- }
Add Comment
Please, Sign In to add comment