daily pastebin goal
43%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 60 in 20 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var fields = document.querySelectorAll(".field");
  2. var play_btn = document.querySelector(".btn-bet");
  3. var bet_amount = document.querySelector("input[name='amount']");
  4. var btn_cashout = document.querySelector(".btn-cashout");
  5. var loseimg = document.querySelector(".image-lose");
  6. var winimg = document.querySelector(".image-win");
  7. var multiplier = 5.5;
  8. var basebet = 10;
  9. var start = false;
  10.  
  11. if(fields == "undefined" || play_btn == "undefined" || bet_amount == "undefined" || btn_cashout == "undefined" || loseimg == "undefined" || winimg == "undefined") throw new Error("One of elements is undefined!");
  12.  
  13. var select_fields = [0,5,10,15,20,21,22];
  14.  
  15. var panel = document.createElement("div");
  16. panel.innerHTML=`
  17. <div id="bot_panel" style="background-color:#222222; color:#7594c7; border-radius:5px; padding:10px;">
  18.     <div style="text-align:center;">CSGOAtse minesweeper bot created by: <span style="color:green;">ksew</span></div>
  19.     <div id="bot_status">Status: <span style="color:red;">OFF</div>
  20.     <div>
  21.         Base bet:<input id="bot_basebet" type="number" value="10"></input>
  22.         Multiplier:<input id="bot_multiplier" type="number" value="5.5"></input>
  23.     </div>
  24.     <br>
  25.     <button id="bot_start" style="display:block; background:green; color:white; border:0; margin-left:auto; margin-right:auto;">Start</button>
  26. </div>
  27. `
  28. document.querySelector("#mine").append(panel);
  29.  
  30. var base_bet_input = document.getElementById("bot_basebet");
  31. var bet_multiplier_input = document.getElementById("bot_multiplier");
  32. var bot_start_btn = document.getElementById("bot_start");
  33. var bot_status = document.querySelector("#bot_status > span");
  34.  
  35. bot_start_btn.onclick = function() {
  36.     if(start) {
  37.         start = false;
  38.         bot_status.style.color = "green";
  39.         bot_start_btn.style.background = "green";
  40.     } else {
  41.         basebet = parseInt(base_bet_input.value);
  42.         multiplier = parseFloat(bet_multiplier_input.value);
  43.         start = true;
  44.         bot_status.style.color = "red";
  45.         bot_start_btn.style.background = "red";
  46.     }
  47. };
  48.  
  49. function betmine() {
  50.     bet = basebet;
  51.     if(start) {
  52.         bet_amount.value = bet;
  53.         play_btn.click();
  54.         var lose = false;
  55.         for(var i = 0; i<select_fields.length; i++) {
  56.             fields[select_fields[i]].click();
  57.             if(loseimg.getBoundingClientRect().width!=0) {
  58.                 lose = true;
  59.                 break;
  60.             }
  61.         }
  62.         if(lose) {
  63.             bet = Math.round(bet*multiplier);
  64.         } else {
  65.             btn_cashout.click();
  66.             if(winimg.getBoundingClientRect().width!=0) {
  67.                 bet = basebet;
  68.             } else {
  69.                 throw new Error ("Error. winning icon not shown!");
  70.             }
  71.         }
  72.         bet_amount.value = bet;
  73.        
  74.     }
  75.     setInterval(betmine(),1000);
  76. }
  77.  
  78. betmine();
RAW Paste Data
Top