Advertisement
Guest User

fix

a guest
Jun 25th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. const baseBet = 1;
  2.  
  3. const multiplier = 1.12;
  4.  
  5. let gameCounter = 0;
  6. let currentBet;
  7. let shouldRun = true;
  8.  
  9. engine.on('game_starting', function(info) {
  10. console.info('Game number: '+ gameCounter +' Starting in ' + info.time_till_start/1000 + 's');
  11.  
  12. console.info('calculating bet & bet multiplier...');
  13. switch(gameCounter) {
  14. case 0:
  15. currentBet = baseBet;
  16. break;
  17. case 1:
  18. currentBet = currentBet * 8.5;
  19. break;
  20. case 2:
  21. currentBet = currentBet * 9.6;
  22. break;
  23. case 3:
  24. currentBet = currentBet * 9.6;
  25. break;
  26. case 4:
  27. currentBet = currentBet * 9.6;
  28. break;
  29.  
  30. }
  31. console.info('betting: ' + currentBet + ' will cash out on: ' + multiplier);
  32. if(currentBet < engine.getBalance()){
  33. if (shouldRun) engine.placeBet(Math.floor(currentBet) * 100, Math.round(multiplier * 100));
  34. } else {
  35. console.warn('balance limit');
  36. shouldRun = false
  37. }
  38. });
  39.  
  40. engine.on('game_started', function(data) {
  41. gameCounter++;
  42. });
  43.  
  44. engine.on('cashed_out', function(resp) {
  45. if(resp.username == engine.getUsername()) {
  46. console.info('cashed out on game: ' + gameCounter + ' restarting cycle...');
  47. gameCounter = 0;
  48. }
  49. });
  50.  
  51. engine.on('game_crash', function(data) {
  52.  
  53. if(!engine.lastGamePlayed()) gameCounter = 0;
  54.  
  55. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement