SellingScripts

Untitled

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