Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var config = {
- clientSeed: { label: "Client seed", type: "text", value: "123" },
- stopiflost: { value: 0, type: 'text', label: 'Protect Balance' },
- }
- baseBet: { value: 50000, type: 'balance', label: 'Original bet' },
- payout: { value: 1.01, type: 'multiplier' },
- stop: { value: 1e8, type: 'balance', label: 'Stop if your betting a certain amount >' },
- loss: {
- value: 'increase', type: 'radio', label: 'When you loose',
- options: {
- base: { type: 'noop', label: 'Return to Original bet' },
- increase: { value: 0, type: 'multiplier', label: 'Bet Increase Rate' },
- }
- },
- win: {
- value: 'base', type: 'radio', label: 'If You Win',
- options: {
- base: { type: 'noop', label: 'Return to Original bet' },
- increase: { value: 0, type: 'multiplier', label: 'Bet Increase Rate' },
- }
- }
- };
- log('Shreds BTC Script Running');
- var currentBet = config.baseBet.value;
- // Remember to bet on your first one!
- engine.bet(roundBit(currentBet), config.payout.value);
- engine.on('GAME_STARTING', onGameStarted);
- engine.on('GAME_ENDED', onGameEnded);
- function onGameStarted() {
- engine.bet(roundBit(currentBet), config.payout.value);
- }
- function onGameEnded() {
- var lastGame = engine.history.first()
- // Banaboms
- if (!lastGame.wager) {
- return;
- }
- // You won!
- if (lastGame.cashedAt) {
- if (config.win.value === 'base') {
- currentBet = config.baseBet.value;
- } else {
- console.assert(config.win.value === 'increase');
- currentBet *= config.win.options.increase.value;
- }
- log('Next Bet will be', currentBet/100, 'bits')
- } else {
- // damn, looks like we lost :(
- if (config.loss.value === 'base') {
- currentBet = config.baseBet.value;
- } else {
- console.assert(config.loss.value === 'increase');
- currentBet *= config.loss.options.increase.value;
- }
- log('next bet will be', currentBet/100, 'bits')
- }
- if (currentBet > config.stop.value) {
- log('Was about to bet', currentBet, 'which triggers the stop');
- engine.removeListener('GAME_STARTING', onGameStarted);
- engine.removeListener('GAME_ENDED', onGameEnded);
- }
- }
- function roundBit(bet) {
- return Math.round(bet / 100) * 100;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement