Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. //You can change these variables:
  2. var baseBet = 150;//bet to return to on win
  3. var maxLoses = 5;//the number of losses you can take in a row, after "maxLoses" loses the program will terminate
  4.  
  5. //You can change these variables but it is recommended to leave them as is:
  6. var baseCashout = 1.08;//this is the cashout that will be returned to on a win, the cashout will be variable after a loss
  7.  
  8. //Do not change these variables:
  9. var currentBet = baseBet;//used in determining what the current bet amount is
  10. var percent;//based on your baseBet and you maxLoses this will calculate what percent of your bits you will lose if you suffer more than "maxLoses" in a row
  11. //this will be used to find out by how much to proportionally increase your bet while remaining under the original percent
  12. var currentCashout = baseCashout;//used in determining what the current cashout is
  13. var maxBet = baseBet*Math.pow(4,maxLoses-1);
  14. var stopScriptOnLoss = true;//will stop the script in the event of "maxLoses" loses in a row
  15. var cumulativeLoss = 0;
  16. var playing = false;//will delay initial start by one game so that if script is ran between 'game_started' and 'game_crash' phase
  17. //it will not prematurly increase bet if busts below "currentCashout"
  18. var totalLoss = baseBet;//This is the total amount you would lose after "maxLoses" loses in a row
  19.  
  20. //used to calculate totalLoss
  21. function calcTotalLoss(baseB){
  22. let temp = baseB;
  23. var allLoss = baseB;
  24. for(let i=0;i<maxLoses-1;i++){
  25. temp = temp*4;
  26. allLoss += temp;
  27. }
  28. return allLoss;
  29. }
  30. totalLoss = calcTotalLoss(baseBet);
  31.  
  32. //used to calculate totalLoss
  33. function balCheck(){
  34. let bal = (engine.getBalance()/100);
  35. if(bal<totalLoss){
  36. console.log("Based on your parameters you need a minimum of " + totalLoss + " to use this strategy, and you only have " + bal);
  37. engine.stop();
  38. }
  39. else if(maxBet>100000){
  40. console.log("RaiGames allows bets no larger than 100000 as of 1/10/18, and your strategy would try to place a bet of size " + maxBet + " as the last bet which is too large");
  41. engine.stop();
  42. }
  43. else{
  44. percent = totalLoss/bal;
  45. }
  46. }
  47. balCheck();
  48.  
  49.  
  50. engine.on('game_starting', function(info) {
  51. engine.placeBet(currentBet*100, currentCashout*100);
  52. });
  53.  
  54. engine.on('game_crash', function(data) {
  55. if(!playing){
  56. playing = true;
  57. return;
  58. }
  59. if((data.game_crash/100)<currentCashout && currentBet==maxBet){
  60. console.log("Max Loses reached")
  61. if(stopScriptOnLoss)
  62. engine.stop();
  63. else{//currently this is dead code
  64. currentBet = baseBet;
  65. currentCashout = baseCashout;
  66. cumulativeLoss = 0;
  67. }
  68. }
  69. else if((data.game_crash/100)<currentCashout){
  70. cumulativeLoss+=currentBet;
  71. currentBet*=4;
  72. currentCashout = ((cumulativeLoss/currentBet)+1).toFixed(2);
  73. }
  74. else{
  75. currentBet = baseBet;
  76. currentCashout = baseCashout;
  77. cumulativeLoss = 0;
  78. if(((baseBet+1)*Math.pow(4,maxLoses-1))>100000)
  79. return;
  80. else{
  81.  
  82. }
  83. }
  84. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement