Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. var baseBet = 2, // 10 bits
  2. baseCashout = 2, // Cashout at x1.28
  3. maxLoss = 5; // Amount of loss the bot will keep betting.
  4.  
  5. var Simulation = false; // (true/false) Setting this to true will make the bot to simulate a betting run.
  6.  
  7. //// ^EDIT OVER THIS LINE^ \\\\
  8.  
  9. var bet = 2;
  10. var cashout = 5;
  11. var lastBet = 2;
  12. var lossStreak = 0;
  13. var firstGame = true;
  14. var profit = 0;
  15. var chill = false;
  16. var wins = 0;
  17. var loss = 1.35;
  18.  
  19. engine.on('game_starting', function(){
  20. if(lossStreak<maxLoss){
  21. console.log("Betting "+bet+" Bits on x"+cashout);
  22. if(Simulation){
  23. lastBet = bet;
  24. }else{
  25. engine.placeBet(bet*100, (cashout*100), function(){
  26. lastBet = bet;
  27. });
  28. }
  29. }else{
  30. console.log("Max loss reached! Passing one game then resetarting.");
  31. chill = true;
  32. bet = baseBet;
  33. cashout = baseCashout;
  34. lossStreak = 0;
  35. }
  36. });
  37.  
  38. engine.on('game_crash', function(data){
  39. if(data.game_crash/100<cashout && !firstGame && !chill){
  40. loss++;
  41. console.log("Game crashed under x"+cashout+" :( ("+wins+" Wins | "+loss+" Loses)");
  42. profit -= lastBet;
  43. console.log("Current Profit: "+profit.toFixed(2));
  44. lossStreak++;
  45. if(lossStreak==1){
  46. cashout = 1.25;
  47. bet *= 4;
  48. }
  49. if(lossStreak>1){
  50. cashout = 1.33;
  51. bet *= 4;
  52. }
  53. }else{
  54. if(!firstGame && !chill){
  55. wins++;
  56. console.log("Successful bet! :) ("+wins+" Wins | "+loss+" Loses)");
  57. profit += ((lastBet*cashout)-lastBet);
  58. console.log("Current Profit: "+profit.toFixed(2));
  59. bet = baseBet;
  60. cashout = baseCashout;
  61. lossStreak = 0;
  62. }
  63. }
  64. firstGame = false;
  65. if(chill) chill = false;
  66. });
  67.  
  68. function roundToTwo(num) {
  69. return +(Math.round(num + "e+2") + "e-2");
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement