Skip to content

Instantly share code, notes, and snippets.

/**
* BustabitAudio class
*/
(function () {
window.BustabitAudio = function () {
this.audio = {
won: new Audio("https://www.soundjay.com/misc/small-bell-ring-01a.mp3"),
lost: new Audio("http://www.freesfx.co.uk/rx2/mp3s/5/16873_1461333020.mp3")
};
this.audio.won.volume = 0.5;
var config = {
};
/*
~~~~~~ Krampus v11 final ~~~~~~
~~ gamblebot for Bustabit.com
~ a fork of CorpseKey v8-prealpha
~~ by MathWins aka Gambletron5000 aka Neti
CHANGABLE SETTING(s) NOT TESTED, BEWARE CHANGING
@dsetzer
dsetzer / result_dumper.js
Created April 26, 2020 04:17
Converts bustabit script simulator into a roll generator. Just set the ending hash and number of games.
var results = [];
engine.on('GAME_ENDED', function() {
results.push(engine.history.first().bust);
dumpResults(results);
})
var dumpResults = (function() {
'use strict';
var timeWindow = 100;
var timeout;
@dsetzer
dsetzer / oscars-v2-universal.js
Last active May 7, 2020 17:30
Proof of concept Oscar's Grind script fully functional universal compatibility playable on both bustabit & bustadice as well as simulators no modification needed.
var config = {
i: { type: 'noop', label: 'Oscar\'s Grind V2 Universal'},
a: { type: 'balance', label: 'Unit Size', value: 1000 },
c: { type: 'number', label: 'Bet Speed', value: 100 }
};
Object.entries(config).forEach(c=>window[c[0]]=c[1].value);
var dice = (()=>{try{engine==true;return !1;}catch(e){return !0;}})();
var sleep = t => new Promise(r => setTimeout(r, t)), b=1.98, d=a, e=0;
var round = b => Math.max(100, Math.round(b / 100) * 100);
var next = r => {r<b?e-=d:(e+=d,e<a&&(d=e+d+a>a?a-e:d+a),e>=a&&(e=0,d=a))};
@dsetzer
dsetzer / speed-test.js
Last active March 18, 2020 01:06
Testing async throughput in bustadice
let betCount = 0;
let totalOut = 0;
let totalIn = 0;
let queueSize = 200
let queue = new Array(queueSize);
let running = true;
const doResult = async function (context, result) {
totalIn++;
context.log(`Current Bets IN/OUT ${totalIn}/${totalOut} | Total Bets ${betCount}`);
}
@dsetzer
dsetzer / climb3-v1.5-dice.js
Last active August 17, 2020 06:03
Upgrade from climb-v2 script with more customization, compounding, and halving feature for bustadice.
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 },
betSpeed: { label: 'Bet Speed', type: 'multiplier', value: 100 }
};
Object.entries(config).forEach((c) => window[c[0]] = c[1].value);
@dsetzer
dsetzer / bab-sniper-v1.js
Last active March 9, 2024 23:08
some bustabit automatic sniper scripts I made a long time ago
var config = {};
var StartingBet = 50000; //(INTEGER) Initial bet in satoshis. (100 * 100 = 100 bits = 10,000 satoshi)
var AutoCashout = 2000; //(INTEGER) Will Cashout at 20x if the highest bet didn't cashed out yet.
var IncreaseOnLoss = 1.5; //(FLOAT) Will increase +1.30x of the last bet if lost.
var simulate = true;
var simWager = 0;
var simCashed = 0;
var simBalance = 5000 * 100;
@dsetzer
dsetzer / flat-v1.2-bab.js
Last active January 17, 2020 19:43
original flat bet script for bustabit upgraded with ui settings
var config = {
baseBet: { type: 'balance', label: 'Base Bet', value: 50 },
basePayout: { type: 'multiplier', label: 'Base Payout', value: 5 },
baseMulti: { type: 'multiplier', label: 'Bet Multi', value: 1.2 },
postBet: { type: 'number', label: 'Post Bet', value: 1 },
};
let currentBet = config.baseBet.value;
let startBal = userInfo.balance;
let prevBal = userInfo.balance;
@dsetzer
dsetzer / geomartingale-v1-bab.js
Last active November 17, 2021 22:35
Improved martingale script for bustabit and bustadice.
var config = {
baseBet: { type: 'balance', label: 'Base Bet', value: 2000 },
payout: { type: 'multiplier', label: 'Payout', value: 1.5 },
betAdj: { type: 'number', label: 'Multi Adj', value: 0.8 },
betPrc: { type: 'text', label: 'Precision', value: '1e4' }
};
Object.entries(config).forEach(c=>window[c[0]]=c[1].value);
let curBet = baseBet, curProb = 0, reqProb = 1;
let numGames = 0, numHits = 0, avgGames = 20 * payout;
engine.on('GAME_STARTING', ()=>{
@dsetzer
dsetzer / cmh-v1-bab.js
Created December 27, 2019 16:44
Bustadice and Bustabit script for CMH
var config = {
baseBet: { type: 'balance', label: 'Base Bet', value: 100 },
minPayout: { type: 'multiplier', label: 'Min Payout', value: 1.3 },
maxPayout: { type: 'multiplier', label: 'Max Payout', value: 4.5 },
incPayout: { type: 'number', label: 'Inc Payout', value: 1.5 }
};
Object.entries(config).forEach(c=>window[c[0]]=c[1].value);
let currBet = baseBet, currPayout = minPayout;
engine.on('GAME_ENDED', ()=>{
let lastGame = engine.history.first();