Skip to content

Instantly share code, notes, and snippets.

@dsetzer
dsetzer / apexograph-revamp-v2.0.js
Created August 1, 2019 06:56
Complete rewrite of apexograph for bustabit
var config = {
baseBet: { type: 'balance', label: 'Added Base Bet', value: 10000 }, // Extra amount added to base bet.
betBalance: { type: 'multiplier', label: 'Max Bettable Bal', value: 0.05 },// Max portion of bal to bet with.
maxPayout: { type: 'multiplier', label: 'Payout Max Clamp', value: 3 }, // Upper bound limit on payout.
minPayout: { type: 'multiplier', label: 'Payout Min Clamp', value: 1.5 }, // Lower bound limit on payout.
debug: { type: 'checkbox', label: 'Verbose Log Output', value: false }, // Outputs additional information.
};
const debug = config.debug.value;
let hmrsv = 3, results = [], loses = [], vectorApex = 0, nextBet = 0;
engine.getState().history.forEach(h => results.push(h.bust));
@dsetzer
dsetzer / apexograph-revamp-v2.1.js
Created August 1, 2019 06:44
Complete rewrite of apexograph v2 with added trailing stop (v2.1).
var config = {
baseBet: { type: 'balance', label: 'Added Base Bet', value: 10000 }, // Extra amount added to base bet.
betBalance: { type: 'multiplier', label: 'Max Bettable Bal', value: 0.03 },// Max portion of bal to bet with.
maxPayout: { type: 'multiplier', label: 'Payout Max Clamp', value: 3 }, // Upper bound limit on payout.
minPayout: { type: 'multiplier', label: 'Payout Min Clamp', value: 1.5 }, // Lower bound limit on payout.
debug: { type: 'checkbox', label: 'Verbose Log Output', value: false }, // Outputs additional information.
};
const debug = config.debug.value, startBalance = userInfo.balance;
let hmrsv = 3, results = [], loses = [], vectorApex = 0, nextBet = 0;
let trailDist = 0.6 * startBalance, trailBalance = (startBalance - trailDist);
@dsetzer
dsetzer / bet-utils.js
Last active November 16, 2023 03:04
A few martingale oriented inverse utility functions.
/**
* Calculates the base bet from the current wager, multiplier, and streak.
*
* @param {number} wager - The current wager.
* @param {number} multi - The multiplier.
* @param {number} streak - The streak.
* @returns {number} - The calculated base bet.
*/
const getBaseBetFromCurrent = (wager, multi, streak) => (wager / (multi ** streak));
@dsetzer
dsetzer / bustadice-bab-demo.js
Last active March 27, 2024 13:45
Bustabit script wrapper for use on bustadice. (proof of concept / demo! extremely minimal bustabit script API functionality)
var config = {
baseBet: { type: 'balance', label: 'Base Bet', value: 100 },
payout: { type: 'multiplier', label: 'Payout', value: 2 }
};
const dcheck = () => { try{ engine.getState() }catch(e){ return true } return false }
const emitter = {
on(name, func){this._s[name] = this._s[name] || []; this._s[name].push(func)},_s:{},
emit(name, ...args){if(!this._s[name]){return; } this._s[name].forEach(f=>f(...args))}
}
const dice = dcheck();
@dsetzer
dsetzer / diceCheck.js
Last active August 18, 2019 04:10
Method for detecting which game the script is run on.
const dice = (()=>{try{engine.getState()}catch(e){return!0}return!1})();
if (dice) console.log('This is bustadice');
if (!dice) console.log('This is bustabit');
@dsetzer
dsetzer / Sandbox_script2_13.js
Created June 4, 2019 08:51
Sandbox_script ver2.13 by Ruzli #7111, If you liked my sandbox and want say big thanks, or want support my team, you can make donation to our team here - [1GUU7UZLAWUAA58bx9zuJiTM7eLGUoK6wi ] also join my discord server: https://discord.gg/5R2YvY
var config = {
//******************COMMON****************** */
PASTE_CASE: { label: "Paste", type: "text", value: "Paste raw text [see F12]" },
cb_globals: {
label: "Sandbox", type: "radio", value: "sandbox_mode", options: {
sandbox_mode: { label: "Sandbox Mode (if you set it to true will trigger below configuration to be used)", type: "noop", value: "" },
SETUP: { label: "Configuration Launch Case", type: "number", value: 0 },
merged: { label: "Run both in sandbox and configuration launch", type: "noop", value: "" },
}
@dsetzer
dsetzer / v2climb-bustabit.js
Last active November 17, 2021 22:37
climb v2 script for bustadice and bustabit
var config = { c: { label: 'Base Bet', type: 'balance', value: 500 } };
let c = config.c.value, t = 1.1, b = 1.006, m = 1.005, a = c, d = t, h = 100;
engine.on('GAME_ENDED', () => { let r = engine.history.first(); (r.cashedAt) ? (c = a, t = d) : (t += m, c *= b) });
engine.on('GAME_STARTING', () => { engine.bet(Math.round(c / h) * h, t)});
/* Climb V2 (bustabit) */
@dsetzer
dsetzer / flat-v1.3.js
Last active November 15, 2019 22:14
bustadice script
var config = {
b: { type: 'balance', label: 'Base Bet', value: 50 },
t: { type: 'multiplier', label: 'Base Payout', value: 5 },
m: { type: 'multiplier', label: 'Bet Multi', value: 1.2 },
p: { type: 'number', label: 'Add Bets', value: 1 },
s: { type: 'number', label: 'Bet Speed', value: 100 }
};
const b = config.b.value, t = config.t.value, m = config.m.value;
const p = config.p.value, d = config.s.value;
const s = (t) => { return new Promise((r) => { setTimeout(r, t); }); }
//------ settings ---------
const target = ''; // User to follow. Bet amount and target is adjusted/taken from this players bets.
const baseBet = 100; // Initial bet to place when target player places a bet.
const betMulti = 2; // Multiplies bet by this after each loss.
const autoCashout = 20;// Automatically cashout here if target player has cashed yet.
const maxBet = 1e8; // Clamps the bet size maximum at this amount (doesn't stop the script, limits bet size only)
const minBalance = 0 // Prevents betting if next bet will drop balance below this amount.
const betDelay = 4;
//-------------------------
let locked = false;
var checkInterval = 10;
Window.prototype.targetLimiter = function (checkInterval) {
setImmediate(() => {
window.setInterval(() => {
if (window.document.getElementsByName('target')[0].value < 1.5) {
window.document.getElementsByName('target')[0].value = 1.5;
}
}, checkInterval);
});
}