Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Auto Reload Protopage
- // @namespace http://blog.monstuff.com/archives/cat_greasemonkey.html
- // @description Reload pages every 5 minutes
- // @include http://mrush.mobi/*
- // @exclude http://mrush.mobi/chat*
- // @exclude http://mrush.mobi/amulet*
- // @exclude http://mrush.mobi/clan*
- // @exclude http://mrush.mobi/forum*
- // @exclude http://mrush.mobi/thread*
- // @exclude http://mrush.mobi/sets*
- // @exclude http://mrush.mobi/build*
- // @exclude http://mrush.mobi/view_profile*
- // @exclude http://mrush.mobi/post_message*
- // @exclude http://mrush.mobi/items*
- // @exclude http://mrush.mobi/ability*
- // @exclude http://mrush.mobi/runes*
- // @grant none
- // ==/UserScript==
- // based on code by Julien Couvreur
- // and included here with his gracious permission
- function pause(n){
- today=new Date()
- today2=today
- while((today2-today)<=n){
- today2=new Date()
- }
- }
- myFunction();
- function myFunction() {
- //Enter to php
- if (document.location.pathname=="/pvp"){
- if (document.querySelector("a[class*='ubtn inbl mt-15 green mb2']")){
- var targetNode = document.querySelector ("a[class*='ubtn inbl mt-15 green mb2']");
- if (targetNode) {
- window.onload = function() {
- setTimeout(function() {
- targetNode.click();
- }, 1000);
- };
- }
- }
- }
- /*
- if (document.querySelector("[href^='/lair']")){
- var targetNode = document.querySelector("[href^='/lair']");
- if (targetNode) {
- window.onload = function() {
- setTimeout(function() {
- targetNode.click();
- }, 800);
- };
- }
- }
- if (document.location.pathname=="/lair"){
- if (document.getElementsByClassName("body")){
- var arr = document.getElementsByTagName('div');
- var len = arr.length;
- for(var i = 0;i<arr.length;i++){
- var dis = document.getElementsByTagName('div')[i].className;
- text="ubtn inbl mt-15 red mb2";
- if (document.getElementsByTagName('div')[i].innerHTML.indexOf(text) != '-1'){
- if (window.getComputedStyle(document.getElementsByClassName(dis)[0],null).getPropertyValue('display')=='block'){
- var targetNode = document.getElementsByTagName('div')[i].querySelector("a[class*='ubtn inbl mt-15 red mb2']");
- if (targetNode) {
- window.onload = function() {
- setTimeout(function() {
- targetNode.click();
- }, 1500);
- };
- }
- }
- }}}
- }
- if (document.querySelector("[href^='/arena']")){
- var targetNode = document.querySelector("[href^='/arena']");
- if (targetNode) {
- window.onload = function() {
- setTimeout(function() {
- targetNode.click();
- }, 800);
- };
- }
- }
- if (document.location.pathname=="/arena"){
- if (document.getElementsByClassName("body")){
- var arr = document.getElementsByTagName('div');
- var len = arr.length;
- for(var i = 0;i<arr.length;i++){
- var dis = document.getElementsByTagName('div')[i].className;
- text="ubtn inbl mt-15 red mb5";
- if (document.getElementsByTagName('div')[i].innerHTML.indexOf(text) != '-1'){
- if (window.getComputedStyle(document.getElementsByClassName(dis)[0],null).getPropertyValue('display')=='block'){
- var targetNode = document.getElementsByTagName('div')[i].querySelector("a[class*='ubtn inbl mt-15 red mb5']");
- if (targetNode) {
- window.onload = function() {
- setTimeout(function() {
- targetNode.click();
- }, 1500);
- };
- }
- }
- }}}
- }
- */
- //pvp
- if (document.getElementsByClassName("fr w50")[0]){
- var arr = document.getElementsByClassName("fr w50")[0].getElementsByTagName('div');
- var len = arr.length;
- for(var i = 0;i<arr.length;i++){
- var dis = document.getElementsByClassName("fr w50")[0].getElementsByTagName('div')[i].className;
- if (window.getComputedStyle(document.getElementsByClassName(dis)[0],null).getPropertyValue('display')=='block'){
- var targetNode = document.getElementsByClassName("fr w50")[0].getElementsByTagName('div')[i].querySelector("a[class*='ubtn inbl s red_no']");
- if (targetNode) {
- //window.setInterval(targetNode.click(),5000);
- window.onload =function() {
- setTimeout(function() {
- targetNode.click();
- }, 1500);
- };
- // triggerMouseEvent (targetNode, "click");
- }
- }
- }
- }
- if (document.location.pathname=="/online"){
- if (document.querySelector("[href^='/invite']")){
- var targetNode = document.querySelector("[href^='/invite']");
- if (targetNode) {
- //window.setTimeout(targetNode.click(), 2000);
- window.onload = function() {
- setTimeout(function() {
- targetNode.click();
- }, 700);
- };
- }
- }
- }
- //document.location.reload();
- // if (!document.getElementsByClassName("fr w50")[0]){
- window.setTimeout("document.location.reload();", 1500);
- //}
- }
- //document.location='http://mrush.mobi/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement