Advertisement
Guest User

scraptf raffle bot

a guest
May 28th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // 1. make a blank chrome extension and insert the following content script.
  2. // 2. go to https://scrap.tf/raffles and let the extension sign you up for all them raffles.
  3.  
  4. $(function() {
  5.     if (document.location == "https://scrap.tf/raffles") {
  6.             var interval = 900;
  7.         var scrollfunc = function(){window.scrollTo(0,document.body.scrollHeight);};
  8.         var searchfunc = function(){
  9.                 var raffs = document.body.innerHTML.match(/\/raffles\/[A-Z0-9]{6}/g);
  10.             for (var i = 0; i < raffs.length; i++) {
  11.                 raffid = raffs[i].match(/[A-Z0-9]{6}/);
  12.                 if ($("#raffle-box-" + raffid).css("opacity") == 1) {
  13.                 var script = document.createElement("script");
  14.                 script.type  = "text/javascript";
  15.                 script.text  = "ScrapTF.Raffles.EnterRaffle('" + raffid + "');";
  16.                 console.log(script.text);
  17.                 var rafframe = document.createElement("iframe");
  18.                 rafframe.src = "/raffles/" + raffid;
  19.                 rafframe.onload = function(){
  20.                     rafframe.appendChild(script);
  21.                 };
  22.                 document.body.appendChild(rafframe);
  23.                 document.getElementById("raffle-box-" + raffid).setAttribute("style", "opacity: .2;");
  24.                 return
  25.             }
  26.         }};
  27.             setInterval(scrollfunc, interval);
  28.             setInterval(searchfunc, interval);
  29.     }
  30. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement