This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
baseBet: { type: 'balance', label: 'Base Bet', value: 100 }, | |
payout: { type: 'multiplier', label: 'Payout', value: 2 }, | |
betIncr: { type: 'balance', label: 'Bet Incr', value: 100 }, | |
reqProf: { type: 'balance', label: 'Profit', value: 100 } | |
}; | |
Object.entries(config).forEach(c=>window[c[0]]=eval(c[1].value)); | |
let currBet = baseBet, profit = 0; | |
engine.on('GAME_STARTING', () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = {c:{type:'text',label:'Bet Speed',value:100},m:{type:'balance',label:'Base Bet',value:6e2}};await | |
(async(a,b,c,d,e,f,g)=>{var h=async(i,w,x)=>((w=(g?{b:g.value,p:g.target}:{b:a,p:b}),x=(g?(g.multiplier<b?d(w):c(w)):null), | |
f=w.b,b=w.p),(g=await this.bet(Math.round(f/1e2)*1e2,b)));for(;;)await h().then(i=>new Promise(r=>setTimeout(r,e))); | |
})(config.m.value,2.01,(w)=>{w.b=config.m.value,w.p=2.01;},(l)=>{l.p+=1.01;if(l.p>6.05){l.p=2.01,l.b*=(6.05/1.01);}},config.c.value); | |
/* Copyright © 2019 Daniel Setzer */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
baseBet: { type: 'balance', label: 'Base Bet', value: 100 } | |
}; | |
// Add config values to global scope | |
Object.entries(config).forEach(c=>window[c[0]]=c[1].value); | |
// Before: | |
//await this.log(config.baseBet.value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
baseBet: { label: 'Base Bet', type: 'balance', value: 1000 }, | |
minPayout: { label: 'Target Min', type: 'multiplier', value: 1.08 }, | |
maxPayout: { label: 'Target Max', type: 'multiplier', value: 50.00 }, | |
divPayout: { label: 'Target Div', type: 'multiplier', value: 0.80 }, | |
compRate: { label: 'Compound %', type: 'multiplier', value: 0.02 }, | |
compStep: { label: 'Compound At', type: 'multiplier', value: 1.10 }, | |
}; | |
let baseBet = config.baseBet.value, basePayout = config.minPayout.value, rate = config.compRate.value; | |
let currentBet = baseBet, currPayout = basePayout, baseMulti = 1.005, betMulti = 1.006, result = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
baseBet: { type: 'balance', label: 'Base Bet', value: 100 }, | |
payout: { type: 'multiplier', label: 'Payout', value: 2 }, | |
maxBet: { type: 'balance', label: 'Max Bet', value: 100000 } | |
}; | |
// Note: if the bustadice script contains a config or options like above, | |
// then it will need to be separated and placed at the very top still and | |
// the rest of the script is placed in the designated area below. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------------------------ Preset Format ------------------------ | |
var settings = [ | |
100, // Base Bet | |
2.00, // Payout | |
(w)=>{ // onWin Callback | |
w.b = w.b / 2; | |
w.p = w.p; | |
}, | |
(l)=>{ // onLose Callback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Array remove by shifting elements | |
Array.prototype.remove = function(index) { | |
var stop = this.length - 1; | |
while (index < stop) this[index] = this[++index]; | |
this.pop(); | |
} | |
// Array filter remove by shifting elements | |
Array.prototype.filterRemove = function(fn) { | |
for (var i = 0, j = 0; i < this.length; ++i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PlayStats { | |
constructor(context, usingBetSkips){ | |
this.context = context; | |
this._context = {context...}; | |
this._usingBetSkips = usingBetSkips || false; | |
this._bet = async (value, target) => { | |
return new Promise((resolve, reject)=>{ | |
this._context.bet(value, target).catch(reject).then((r)=>{ | |
if(this._usingBetSkips && r.value === 100 && r.target === 1.01){ | |
this.gameStats.skip.total += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RunningStats { | |
constructor() { | |
this.count = 0 | |
this._mean = 0 | |
this._dSquared = 0 | |
} | |
update(newValue) { | |
this.count++ | |
const meanDifferential = (newValue - this._mean) / this.count | |
const newMean = this._mean + meanDifferential |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
baseBet: { type: 'balance', label: 'Base Bet', value: 200}, | |
payout: { type: 'multiplier', label: 'Payout', value: 2.00}, | |
actions: { type: 'text', label: 'Action Limit', value: "20"}, | |
betSpd: { type: 'text', label: 'Bet Speed', value: "2000"}, | |
debug: { type: 'checkbox', label: 'Debug Log', value: false} | |
}; | |
const baseBet = config.baseBet.value, payout = config.payout.value; | |
const actionLimit = parseInt(config.actions.value), debug = config.debug.value; | |
const betSpeed = Math.ceil(config.betSpd.value/actionLimit); |