Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. // The bot will bet a random number between `smallRangeBet` and `bigRangeBet` on a random cashout point.
  2. var smallRangeBet = 900, // (10 bits) Min bet when not in recovery mode (can't bet less than 1 bit)
  3. bigRangeBet = 2000, // (18 bits) Max bet when not in recovery mode (can't be higher than your bankroll)
  4. maxBet = 2000, // (900 bits, set to 0 to disable) The bot won't bet higher than this amount
  5. maxCashout = 100; // (100x) this is the maximum cashout point the script can go
  6.  
  7. var Simulation = false; // (true/false) Setting this to true will make the bot to simulate a betting run.
  8.  
  9. // --- Edit over this line --- \\
  10.  
  11. var totalLost = 0;
  12. var lastBet = 0, bet = 0, profit = 0, wins = 0, loss = 0, firstgame = true, cashout;
  13. var chilling = false;
  14. engine.on('game_starting', function(info) {
  15. console.log((Simulation?"(SIMULATION) ": "")+"Current Profit: "+(profit/100).toFixed(2)+" bits ("+wins+" Wins | "+loss+" Loses)");
  16. if(chilling) chilling = false;
  17. if(firstgame) firstgame = false;
  18. bet = Math.round(randomInt(smallRangeBet*100,bigRangeBet*100)/100)*100;
  19. //var rand = randomInt(1,100);
  20. for(var i=1;i<maxCashout+1;i+=0.01){
  21. var rand = randomInt(1,100);
  22. var curProb = (9900/(101*((i*100)-1)))*100;
  23. if(rand==1 && i == 1){
  24. console.log(" /!\\ 1% protection... Not betting!");
  25. chilling = true;
  26. break;
  27. }
  28. if(!chilling && rand>curProb){
  29. cashout = i.toFixed(2);
  30. cashout = Math.round(cashout*100);
  31. if(totalLost>0){
  32. var onLossIncrement = Math.round((totalLost * (randomInt(30, 90)/100)/100))*100;
  33. bet += onLossIncrement;
  34. console.log((Simulation?"(SIMULATION) ": "")+"(Recovery mode) adding "+(onLossIncrement/100)+" bits to the bet amount");
  35. }
  36. if(bet > maxBet*100 && maxBet != 0){
  37. console.log(" /!\\ Bet amount higher than the maxBet. For your safty, setting the bet to: "+maxBet+" bits");
  38. bet = maxBet * 100;
  39. }
  40. if(!Simulation){
  41. engine.placeBet(bet, cashout, function(){
  42. console.log("Betting "+(bet/100)+" bits on x"+(cashout/100));
  43. lastBet = bet;
  44. });
  45. }else{
  46. console.log("(SIMULATION) Betting "+(bet/100)+" bits on x"+(cashout/100));
  47. lastBet = bet;
  48. }
  49. break;
  50. }
  51. }
  52. });
  53.  
  54. engine.on('cashed_out', function(data) {
  55. if(data.username==engine.getUsername()){
  56. console.log("(Win) Cashed out at x"+(data.stopped_at/100));
  57. wins++;
  58. profit += ((lastBet*(data.stopped_at/100))-lastBet);
  59. if(totalLost>0){
  60. totalLost -= ((bet*(data.stopped_at/100))-lastBet);
  61. if(totalLost<0) totalLost = 0;
  62. }
  63. }
  64. });
  65.  
  66. engine.on('game_crash', function(data) {
  67. if(!chilling && data.game_crash < cashout && !firstgame){
  68. console.log((Simulation?"(SIMULATION) ": "")+"(Lost)");
  69. loss++;
  70. profit -= lastBet;
  71. totalLost += lastBet;
  72. }
  73. if(!chilling && data.game_crash >= cashout && Simulation && !firstgame){
  74. console.log("(SIMULATION) (Win) Cashed out at x"+(cashout/100));
  75. wins++;
  76. profit += ((lastBet*(cashout/100))-lastBet);
  77. if(totalLost>0){
  78. totalLost -= ((bet*(cashout/100))-lastBet);
  79. if(totalLost<0) totalLost = 0;
  80. }
  81. }
  82. if(firstgame) firstgame = false;
  83. });
  84.  
  85. function randomInt(min,max){
  86. return Math.floor(Math.random()*(max-min+1)+min);
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement