SellingScripts

Untitled

Apr 15th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. let accountNumber = 1;
  2. let autoCashOut = 10;
  3. let accountChase = 10;
  4.  
  5.  
  6. let totalWagered = 0;
  7. let minWagered = 40;
  8. let bet = 1;
  9. let array = [];
  10. let test = true;
  11. let num = 0;
  12. let playerIndex = 0;
  13. let betSize = 0;
  14.  
  15. engine.onUpdate = function(prevState) {
  16. if (engine.gameState !== prevState.gameState) {
  17. switch (engine.gameState) {
  18. case 'STARTING':
  19. onStarting();
  20. break;
  21. case 'IN_PROGRESS':
  22. onStarted();
  23. break;
  24. case 'ENDED':
  25. onEnded();
  26. break;
  27. }
  28. }
  29. };
  30. setTimeout(onStarting, 4500);
  31. function onStarting() {
  32. for (num = 0; num < engine.players.length; num++) {
  33. array.push(engine.players[num].autoCashOut);
  34. }
  35. array.sort((a, b) => a - b);
  36. console.log(array);
  37.  
  38. if (array[engine.players.length - accountNumber] <= accountChase) {
  39. autoCashOut = (array[engine.players.length - accountNumber]) + 0.01;
  40. accountChase = autoCashOut;
  41. } else {
  42. autoCashOut = accountChase + (Math.floor(((Math.random() * 0.06) * 100)) / 100);
  43. }
  44.  
  45.  
  46. if (engine.balance >= bet) {
  47. engine.placeBet(bet, autoCashOut).catch(console.error);
  48. }
  49. console.log("Our cashout will be at : " + autoCashOut);
  50. }
  51. setTimeout(onStarted,4500);
  52. function onStarted() {
  53. console.log('Game started!');
  54. console.log(engine.players);
  55. for (playerIndex = 0; playerIndex < engine.players.length; playerIndex++) {
  56. betSize = engine.players[playerIndex].bet;
  57. totalWagered = totalWagered + betSize;
  58. }
  59. console.log("Total Wagered: " + totalWagered + " mETH");
  60. }
  61.  
  62.  
  63. // Do some analyse from results and adjust your next strategy
  64. function onEnded() {
  65. console.log('Game crashed at ' + engine.multiplier);
  66. if (totalWagered >= minWagered) {
  67. bet = 1;
  68. totalWagered = 0;
  69. betSize = 0;
  70. } else {
  71. bet = 0;
  72. totalWagered = 0;
  73. betSize = 0;
  74.  
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment