midlow

Untitled

Feb 8th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         eBonus.gg Helper
  3. // @namespace    Royalgamer06
  4. // @version      0.3
  5. // @description  Automate tasks on eBonus.gg
  6. // @author       Royalgamer06(repost)
  7. // @include      *://ebonus.gg*
  8. // @grant        none
  9. // @run-at       document-idle
  10. // ==/UserScript==
  11.  
  12. const safeguard_refresh = 6; //minutes
  13.  
  14. setTimeout(function() {
  15.     console.log("reached");
  16.     //$(document).on("DOMSubtreeModified", function () {
  17.     var coinswatcher = setInterval(function() {
  18.         if ($(".coins_popup").length > 0) {
  19.             clearInterval(coinswatcher);
  20.             console.log("clicked");
  21.             $(".coins_popup").click();
  22.         }
  23.     }, 1000);
  24.     //});
  25.     if (location.href.indexOf("/earn-coins/watch") > -1) {
  26.         $.ajax({ type: "POST", url: "/earn-coins/watch/yt", data: { started: 'true' } });
  27.         paused = false;
  28.         started = true;
  29.         var vidlength = $("div.col_video > script").text().split("time >= ")[1].split(" ")[0];
  30.         var watcher = setInterval(function() {
  31.             $.ajax({ type: "POST", url: "/earn-coins/watch/yt", data: { paused: 'true', time: vidlength }, success: function(data) {
  32.                 console.log(data.done);
  33.                 if (data.done == "true") {
  34.                     done = true;
  35.                     clearInterval(watcher);
  36.                     location.href = "https://ebonus.gg/earn-coins/watch";
  37.                 }
  38.             }});
  39.         }, 2000);
  40.     }
  41. }, 5000);
  42.  
  43. setTimeout(function() {
  44.     location.reload();
  45. }, safeguard_refresh * 60000);
Add Comment
Please, Sign In to add comment