Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. const baseMultiplier = 1.08;
  2. const lossMultiplier = 1.25;
  3. const difference = 15625;
  4. const maxStreak = 7;
  5. const divisionToBackup = 1;
  6. const loseFirst = 1;
  7.  
  8. //===================
  9.  
  10. const ON = true;
  11. const OFF = false;
  12. const SKIP_UNDER = ON; //turn ON=ON, turn OFF=OFF
  13. const IN_A_ROW = OFF; //dont wait until its 3 skips under 1.25, any 1.25 would break the loop
  14. const WHEN_TO_SKIP = 3; //Start skipping after 3 loss
  15. const SKIPS_AFTER_LOSS = 3; //Skip 3 after 1(when_to_skip) loss
  16. const SKIP_MULTIPLIER = 1.25; //Skip X bets under 1.25
  17.  
  18. //===================
  19.  
  20.  
  21. let losesCount = 0;
  22. let lossStreak = 0;
  23. let currentBet = 100;
  24. let currentMultiplier = 0;
  25. this.log('====== skullacy\'s BustaDice Bot ======');
  26. let self = this;
  27.  
  28. while (true) {
  29. await calculateBet(this.balance);
  30. const { multiplier } = await this.bet(currentBet, currentMultiplier);
  31.  
  32. if ((lossStreak === 0 && multiplier < baseMultiplier) || (lossStreak > 0 && multiplier < lossMultiplier)) { // loss
  33. lossStreak++;
  34. } else { // win
  35. lossStreak = 0;
  36. }
  37. }
  38.  
  39. async function calculateBet(balance) {
  40. if (lossStreak >= maxStreak) {
  41. self.log('reset because of 6 lose in a row');
  42. lossStreak = 0;
  43. }
  44.  
  45. if (lossStreak > 1) {
  46. await refreshSeed();
  47. }
  48. if (SKIP_UNDER && lossStreak == WHEN_TO_SKIP) {
  49. let x_loss_count = 0;
  50. while(x_loss_count < SKIPS_AFTER_LOSS){
  51. const { multiplier } = await self.skip();
  52. if (multiplier > SKIP_MULTIPLIER) { // loss
  53. ++x_loss_count;
  54. }
  55. else if(IN_A_ROW){
  56. x_loss_count = 0;
  57. }
  58. }
  59. }
  60. if (lossStreak === 0) {
  61. currentBet = 100;
  62. currentMultiplier = baseMultiplier;
  63. } else if (lossStreak === 1) {
  64. currentBet *= 4;
  65. currentMultiplier = lossMultiplier;
  66. } else {
  67. currentBet *= 5;
  68. currentMultiplier = lossMultiplier;
  69. }
  70. }
  71.  
  72. async function refreshSeed() {
  73. const clientSeed = await generateClientSeed();
  74.  
  75. // request a new server seed using a random client seed
  76. const { server_seed_hash } = await self.newSeedPair();
  77. // set the client seed
  78. await self.setClientSeed(clientSeed);
  79. }
  80.  
  81. async function generateClientSeed() {
  82. let text = "";
  83. const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  84.  
  85. for (let i = 0; i < 16; i++)
  86. text += possible.charAt(Math.floor(Math.random() * possible.length));
  87.  
  88. return text;
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement