Advertisement
Guest User

Untitled

a guest
Sep 10th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.55 KB | None | 0 0
  1. // GAME SETTINGS
  2. var cashout = 350; //WILL AUTO CASHOUT AT THIS NUMBER IF HASNT DONE ALREADY
  3. var basebet = 50; //FIRST BET WILL BE IN THIS RANGE
  4. var maxbet = 1500; //WILL NOT EXEED THIS BET
  5. var divide = 7; //BET IS PREVIOUS GAMES TOTAL BETS DIVIDED BY THIS NUMBER
  6. var lowbetthresh = 2500; //CASHOUT IF TOTAL BETS ARE LOWER THAN THIS AT THE START
  7. var highestplayerpercent = 100; // CASHOUT IF HIGHEST PLAYERS BET IS X PERCENT OF THE TOTAL
  8. var MaxProfit = 170000; //SCRIPT STOPS WHEN TOTAL BALANCE EXCEEDS THIS VALUE
  9.  
  10. var blacklist = ['yolk','Sly']
  11.  
  12. //WITHDRAW SETTINGS
  13. var TargetBits = 10000000000; //WILL CASHOUT EVERYTHING OVER THIS AMOUNT
  14. var password = ''; //PASSWORD FOR THE WITHDRAW
  15. var vault = 'exchangebot'; //ACCOUNT TO WITHDRAW TO
  16.  
  17. // RANDOM BET MULTIPLIERS
  18. var highmultiplyer = 0.4;
  19. var lowmultiplyer = 1.4;
  20.  
  21. // GAME VARIABLES
  22. var playerbets = [];
  23. var cashedoutbets = 0;
  24. var ingame = 0;
  25. var withdrawn = Number(0);
  26. var remaining = Number(0);
  27. var currentBalance = (engine.getBalance() / 100) - withdrawn;
  28. var firstGame = true;
  29. var withdrawn = Number(0);
  30. var currentBalance = (engine.getBalance() / 100) - withdrawn;
  31.  
  32. var totalethos = 0;
  33. var highestbet = 0;
  34. var lastmax = 0;
  35. var first = 0;
  36.  
  37. function precisionRound(number, precision) {
  38. var factor = Math.pow(10, precision);
  39. return Math.round(number * factor) / factor;
  40. }
  41.  
  42.  
  43.  
  44. engine.on('game_starting', function(data) {
  45. if (lastmax >= maxbet) {
  46. basebet = maxbet;
  47. } else {
  48. if (lastmax == 0) {
  49.  
  50. } else {
  51. basebet = lastmax;
  52. }
  53. }
  54. currentBalance = (engine.getBalance() / 100) - withdrawn;
  55. betlow = Math.round(basebet / lowmultiplyer);
  56. bethigh = Math.round(basebet * highmultiplyer);
  57. bet = Math.floor((Math.random() * bethigh) + betlow);
  58. first = 1;
  59. bet = bet * 100;
  60. currentBalance = (engine.getBalance() / 100) - withdrawn;
  61. console.log("Current Balance :" + currentBalance);
  62. console.log("Withdrawn to " + vault + " :" + withdrawn);
  63. console.log("Bet Amount :" + bet / 100);
  64. firstGame = false;
  65. engine.placeBet(Math.round(bet), cashout, false);
  66. });
  67. engine.on('game_started', function(data) {
  68. highestbet = 0;
  69. remaining = Number(0);
  70. highestbetplayer = '';
  71. ingame = 0;
  72. cashedoutbets = 0;
  73. totalbet = 0;
  74. players = 0;
  75. playerbets = [];
  76. for (var key in data) {
  77. if (data.hasOwnProperty(key)) {
  78. if (data[key].bet / 100 > highestbet) {
  79. highestbet = data[key].bet / 100;
  80. highestbetplayer = key;
  81. }
  82.  
  83. if (blacklist.includes(key) == false) {
  84. playerbets.push(key, data[key].bet / 100);
  85. totalbet += data[key].bet;
  86. players++;
  87. } else {
  88. console.log(key + " was not included");
  89. }
  90.  
  91. var key = data[key].bet;
  92. }
  93. }
  94. cashedoutbets += bet / 100;
  95. target = (totalbet / 100) / 1.3;
  96. totalethos = totalbet / 100;
  97. highestpercent = Math.floor((highestbet / totalethos) * 100);
  98. lastmax = totalethos / divide;
  99. console.log("Total Players :" + players);
  100. console.log("Total Bet :" + totalethos);
  101. console.log("Target Cashout :" + target);
  102. console.log("Highest Bet : [" + highestbetplayer + "]:" + highestbet);
  103. console.log("Highest Bet %: [" + highestpercent + "%]");
  104. if (first == 1) {
  105. //console.log(playerbets);
  106. if (totalethos <= lowbetthresh) {
  107. engine.cashOut();
  108. ingame = 1;
  109. console.log("Cashing Out [Total Bet Too Low]");
  110. }
  111. if ((highestbet / totalethos) * 100 > highestplayerpercent) {
  112. engine.cashOut();
  113. ingame = 1;
  114. console.log("Cashing Out [Highest Better Too Big]");
  115. }
  116. }
  117.  
  118. });
  119. engine.on('cashed_out', function(resp) {
  120.  
  121. if (blacklist.includes(resp.username) == false) {
  122. //console.log(resp);
  123. //console.log(playerbets);
  124. player = playerbets.indexOf(resp.username);
  125. playerbet = player + 1;
  126. //console.log(playerbet);
  127. //console.log(playerbets[playerbet]);
  128. cashedoutbets += playerbets[playerbet];
  129. } else {
  130. console.log(resp.username + ' cashed out but i dont care');
  131. }
  132.  
  133.  
  134.  
  135. if (cashedoutbets >= target) {
  136.  
  137. if (ingame == 0) {
  138. console.log("Cashing out");
  139. engine.cashOut();
  140. ingame = 1;
  141. }
  142.  
  143. } else {
  144. if (ingame == 0) {
  145. remaining = Math.round(target - cashedoutbets);
  146. console.clear();
  147. console.log("Current Balance :" + currentBalance);
  148. console.log("Withdrawn to " + vault + " :" + withdrawn);
  149. console.log("Bet Amount :" + bet / 100);
  150. console.log("Target Cashout :" + Math.round(target));
  151. console.log("Cashout Our So far :" + cashedoutbets);
  152. console.log("Remaining :" + remaining);
  153. }
  154. }
  155.  
  156.  
  157. });
  158. engine.on('game_crash', function(data) {
  159. console.log(cashedoutbets);
  160. console.clear();
  161. currentBalance = (engine.getBalance() / 100) - withdrawn;
  162. if (currentBalance > TargetBits) {
  163. excess = currentBalance - TargetBits;
  164. withdrawAmount = Number(0);
  165. withdrawAmount += Number(excess);
  166. withdrawAmount = (withdrawAmount).toFixed(2);
  167. console.log('[Bot] Attempting to withdraw ' + withdrawAmount + ' to ' + vault);
  168. cors = transferRequest('POST', 'https://www.ethcrash.io/transfer-request');
  169. withdrawn += Number(withdrawAmount);
  170. currentBalance = (engine.getBalance() / 100) - withdrawn;
  171. }
  172.  
  173. });
  174. function transferRequest(method, url) {
  175. var xhr = new XMLHttpRequest();
  176. if ("withCredentials" in xhr) {
  177. uuid = uuidv4();
  178. params = 'fakeusernameremembered=&fakepasswordremembered=&amount=' + withdrawAmount + '&to-user=' + vault + '&password=' + password + '&transfer-id=' + uuid;
  179. xhr.open(method, url, true);
  180. xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  181. xhr.onreadystatechange = function() {
  182. if (xhr.readyState == 4 && xhr.status == 200) {}
  183. }
  184. xhr.send(params);
  185. } else if (typeof XDomainRequest != "undefined") {
  186. xhr = new XDomainRequest();
  187. xhr.open(method, url);
  188. xhr.send();
  189. } else {
  190. xhr = null;
  191. xhr.send();
  192. }
  193. return xhr;
  194. xhr.send();
  195. }
  196.  
  197. function uuidv4() {
  198. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
  199. var r = Math.random() * 16 | 0,
  200. v = c == 'x' ? r : (r & 0x3 | 0x8);
  201. return v.toString(16);
  202. });
  203. engine.on('cashed_out', function(data) {
  204. if (data.username == engine.getUsername()) {
  205. console.log('[BustaBot] Successfully cashed out at ' + (data.stopped_at / 100) + 'x');
  206. SessionProfit = SessionProfit + (Unit * MaxSessionProfit);
  207. if(((engine.getBalance() - StartBalance) / 100).toFixed(2) > MaxProfit){
  208. console.log('[BustaBot] Maximum profit reached, bot is shutting down...');
  209. console.log('[BustaBot] You have made '+((engine.getBalance() - StartBalance) / 100).toFixed(2)+' profit this session.');
  210. engine.stop();
  211. }
  212. LastResult = "WON";
  213. }
  214. });
  215. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement