SellingScripts

Untitled

Jun 13th, 2019
582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. engine.onUpdate = function(prevState) {
  2. if (engine.gameState !== prevState.gameState) {
  3. switch (engine.gameState) {
  4. case 'STARTING':
  5. onStarting();
  6. break;
  7. case 'IN_PROGRESS':
  8. onStarted();
  9. break;
  10. case 'ENDED':
  11. onEnded();
  12. break;
  13. }
  14. }
  15. };
  16.  
  17. let bet = 1;
  18. let autoCashOut = 9.50;
  19. let accountChase = 9.50;
  20. let minWagered = 50;
  21. let counter = 0;
  22. let fakes = 0;
  23. let variance = 1.00;
  24.  
  25. let betArray = [];
  26. let usernameArray = [];
  27. let test;
  28. let betSize;
  29. let totalWagered;
  30.  
  31. function onStarting() {
  32. function imGay() {
  33. for (num3 = 0; num3 < usernameArray.length; num3++) {
  34. for (num2 = 0; num2 < engine.players.length; num2++) {
  35. console.log(engine.players[num2].username);
  36. console.log(usernameArray[num3]);
  37. if (engine.players[num2].username == usernameArray[num3]) {
  38. engine.placeBet(bet, autoCashOut).catch(console.error);
  39. return;
  40. }
  41. }
  42. }
  43. }
  44. setTimeout(imGay, 4000);
  45. imGay();
  46.  
  47. }
  48.  
  49. function onStarted() {
  50. console.log('Game started!');
  51. console.log(engine.players);
  52. }
  53.  
  54. function onEnded() {
  55. counter++;
  56. test = engine.players;
  57. test.sort(function(a, b) {
  58. return a.bet - b.bet;
  59. })
  60.  
  61. console.log(test);
  62.  
  63. betArray = [];
  64. for (num = 0; num < engine.players.length; num++) {
  65. betArray.push(engine.players[num].bet);
  66. }
  67. betArray.sort((a, b) => a - b);
  68.  
  69.  
  70. if (betArray[engine.players.length - 1] >= minWagered) {
  71. if (usernameArray.includes(test[engine.players.length - 1].username)) {
  72. return;
  73. } else {
  74. usernameArray.push(test[engine.players.length - 1].username);
  75. }
  76.  
  77.  
  78. }
  79. console.log(usernameArray);
  80.  
  81. for (playerIndex = 0; playerIndex < engine.players.length; playerIndex++) {
  82. betSize = engine.players[playerIndex].bet;
  83. totalWagered += betSize;
  84. betSize = 0;
  85. }
  86.  
  87. if (engine.play) {
  88. if (totalWagered < minWagered) {
  89. fakes++;
  90. } else {
  91. fakes = 0;
  92. }
  93. }
  94.  
  95. if (fakes == 5) {
  96. usernameArray = [];
  97. fakes = 0;
  98. }
  99.  
  100. if (counter >= 200) {
  101. usernameArray = [];
  102. counter = 0;
  103. }
  104.  
  105. console.log(usernameArray);
  106. autoCashOut = accountChase + (Math.floor(((Math.random() * variance) * 100)) / 100);
  107. }
Advertisement
Add Comment
Please, Sign In to add comment