Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. //Sample #6 : Very Optimized-Only Count & Rate In/Decrease
  2. const min = 10;
  3. const max = 30;
  4. const minimum = 300;
  5. const amount = 300;
  6. const rate = 3;
  7. const profitper = 500;
  8. const arrayamount = 3;
  9. const base = 50;
  10. const rateincreasement = 0.05;
  11. const ratedecreasement = 0.005;
  12.  
  13. let currentrate = rate;
  14. let c = 0;
  15. let history = new Array(0);
  16. let target = 0;
  17. let totalloss = 0;
  18. let lossstreak = 0;
  19. let currentBet = 1;
  20. let lastlost = false;
  21. let maxtotalloss = 0;
  22.  
  23. function sleep(ms) {
  24. return new Promise(resolve => setTimeout(resolve, ms));
  25. }
  26.  
  27. const main = async () => {
  28. await this.log("starting script");
  29. while (true) {
  30. c++;
  31. if (target > 0) {
  32. console.log(`#${c} : ${target}x`)
  33. if (lastlost) {
  34. totalloss += currentBet;
  35. if (totalloss > maxtotalloss) {
  36. maxtotalloss = totalloss;
  37. console.log(maxtotalloss);
  38. }
  39. currentBet = (1/(target-1)) * (totalloss + profitper);
  40. lossstreak++;
  41. } else {
  42. totalloss = 0;
  43. currentBet = base;
  44. lossstreak = 0;
  45. }
  46. if (currentBet < 1) {
  47. currentBet = 1
  48. }
  49. const {multiplier} = await this.bet(Math.round(currentBet) * 100, target);
  50. history.unshift(multiplier);
  51. if (multiplier < target) {
  52. lastlost = true;
  53. currentrate += rateincreasement;
  54. } else {
  55. currentrate = rate;
  56. lastlost = false;
  57. this.log(` #${c} ${Math.max(Math.round(currentBet),1) * (target - 1)}`);
  58. }
  59. target = 0;
  60. } else {
  61. if (currentrate > rate) {
  62. currentrate -= ratedecreasement
  63. if (currentrate < rate) {
  64. currentrate = rate
  65. }
  66. }
  67. if (c%2==0) {
  68. const {multiplier} = await this.bet(100,1.01);
  69. history.unshift(multiplier);
  70. } else {
  71. const {multiplier} = await this.skip();
  72. history.unshift(multiplier);
  73. }
  74. }
  75. if (c < amount) {
  76. continue;
  77. }
  78. if (history.length > amount) {
  79. history.pop()
  80. }
  81. let filtered = new Array(0);
  82. let sum = 0;
  83. for (let i = 0; filtered.length < arrayamount; i++) {
  84. if (i >= history.length) {
  85. filtered.push(history.slice(0,i));
  86. break;
  87. }
  88. sum += 99 / history[i];
  89. if (i >= minimum) {
  90. let average = sum / (i + 1)
  91. if (((99/1.99) < average) && (average <= ((99/1.98) + 0.00001))) {
  92. filtered.push(history.slice(0,i));
  93. }
  94. }
  95. }
  96. for (let i = 0; i < Math.abs(max - min) * 100; i++) {
  97. let avgstreak = 0;
  98. let count = 0;
  99. let avgstreakc = 0;
  100. for (let j = 0; j < filtered.length; j++) {
  101. for (let p = 0; p < filtered[j].length ; p++) {
  102. if (filtered[j][p] < (i / 100) + min) {
  103. avgstreak++;
  104. } else {
  105. avgstreakc++;
  106. }
  107. if (j == (filtered.length-1)) {
  108. if (filtered[filtered.length-1][p] >= (i / 100) + min) {
  109. count++;
  110. }
  111. }
  112. }
  113. }
  114. avgstreak /= avgstreakc;
  115. count /= filtered[filtered.length-1].length;
  116. count *= 100;
  117. let probstreak = (100/(99/((i / 100) + min))) - 1;
  118. if (avgstreak == Infinity) {
  119. avgstreak = probstreak
  120. }
  121. let prob = ((99/((i / 100) + min)) * ((avgstreak / probstreak) + ((99/((i / 100) + min)) / count))) / 2;
  122. if (prob == Infinity) {
  123. console.log("\n\n\n\n\n\n\n\n\n\nInfinity")
  124. console.log(avgstreak)
  125. console.log(count)
  126. console.log("\n\n\n\n\n\n\n\n\n\n")
  127. }
  128. if ((prob / (99/((i / 100) + min))) >= currentrate) {
  129. target = Math.round(((i / 100) + min) * 100) / 100
  130. }
  131. }
  132. }
  133. }
  134.  
  135. while (true) {
  136. try {
  137. this.log("Starting Script.")
  138. await main();
  139. } catch (error) {
  140. this.log("Connection Closed. Restart After 1 Second.")
  141. await sleep(1000);
  142. continue;
  143. }
  144. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement