SellingScripts

Untitled

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