Advertisement
Guest User

Untitled

a guest
Oct 24th, 2019
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. var config = {
  2. clientSeed: { label: "Client seed", type: "text", value: "123" },
  3. stopiflost: { value: 0, type: 'text', label: 'Protect Balance' },
  4. }
  5.  
  6. baseBet: { value: 50000, type: 'balance', label: 'Original bet' },
  7. payout: { value: 1.01, type: 'multiplier' },
  8. stop: { value: 1e8, type: 'balance', label: 'Stop if your betting a certain amount >' },
  9. loss: {
  10. value: 'increase', type: 'radio', label: 'When you loose',
  11. options: {
  12. base: { type: 'noop', label: 'Return to Original bet' },
  13. increase: { value: 0, type: 'multiplier', label: 'Bet Increase Rate' },
  14. }
  15. },
  16. win: {
  17. value: 'base', type: 'radio', label: 'If You Win',
  18. options: {
  19. base: { type: 'noop', label: 'Return to Original bet' },
  20. increase: { value: 0, type: 'multiplier', label: 'Bet Increase Rate' },
  21. }
  22. }
  23. };
  24. log('Shreds BTC Script Running');
  25. var currentBet = config.baseBet.value;
  26. // Remember to bet on your first one!
  27. engine.bet(roundBit(currentBet), config.payout.value);
  28. engine.on('GAME_STARTING', onGameStarted);
  29. engine.on('GAME_ENDED', onGameEnded);
  30. function onGameStarted() {
  31. engine.bet(roundBit(currentBet), config.payout.value);
  32. }
  33. function onGameEnded() {
  34. var lastGame = engine.history.first()
  35. // Banaboms
  36. if (!lastGame.wager) {
  37. return;
  38. }
  39. // You won!
  40. if (lastGame.cashedAt) {
  41. if (config.win.value === 'base') {
  42. currentBet = config.baseBet.value;
  43. } else {
  44. console.assert(config.win.value === 'increase');
  45. currentBet *= config.win.options.increase.value;
  46. }
  47. log('Next Bet will be', currentBet/100, 'bits')
  48. } else {
  49. // damn, looks like we lost :(
  50. if (config.loss.value === 'base') {
  51. currentBet = config.baseBet.value;
  52. } else {
  53. console.assert(config.loss.value === 'increase');
  54. currentBet *= config.loss.options.increase.value;
  55. }
  56. log('next bet will be', currentBet/100, 'bits')
  57. }
  58. if (currentBet > config.stop.value) {
  59. log('Was about to bet', currentBet, 'which triggers the stop');
  60. engine.removeListener('GAME_STARTING', onGameStarted);
  61. engine.removeListener('GAME_ENDED', onGameEnded);
  62. }
  63. }
  64. function roundBit(bet) {
  65. return Math.round(bet / 100) * 100;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement