Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Auto Reload Protopage
  3. // @namespace http://blog.monstuff.com/archives/cat_greasemonkey.html
  4. // @description Reload pages every 5 minutes
  5. // @include http://mrush.mobi/*
  6. // @exclude http://mrush.mobi/chat*
  7. // @exclude http://mrush.mobi/amulet*
  8. // @exclude http://mrush.mobi/clan*
  9. // @exclude http://mrush.mobi/forum*
  10. // @exclude http://mrush.mobi/thread*
  11. // @exclude http://mrush.mobi/sets*
  12. // @exclude http://mrush.mobi/build*
  13. // @exclude http://mrush.mobi/view_profile*
  14. // @exclude http://mrush.mobi/post_message*
  15. // @exclude http://mrush.mobi/items*
  16. // @exclude http://mrush.mobi/ability*
  17. // @exclude http://mrush.mobi/runes*
  18. // @grant none
  19. // ==/UserScript==
  20.  
  21. // based on code by Julien Couvreur
  22. // and included here with his gracious permission
  23. function pause(n){
  24. today=new Date()
  25. today2=today
  26. while((today2-today)<=n){
  27. today2=new Date()
  28. }
  29. }
  30.  
  31. myFunction();
  32. function myFunction() {
  33. //Enter to php
  34. if (document.location.pathname=="/pvp"){
  35. if (document.querySelector("a[class*='ubtn inbl mt-15 green mb2']")){
  36. var targetNode = document.querySelector ("a[class*='ubtn inbl mt-15 green mb2']");
  37. if (targetNode) {
  38. window.onload = function() {
  39. setTimeout(function() {
  40. targetNode.click();
  41. }, 1000);
  42. };
  43. }
  44. }
  45. }
  46. /*
  47. if (document.querySelector("[href^='/lair']")){
  48. var targetNode = document.querySelector("[href^='/lair']");
  49. if (targetNode) {
  50. window.onload = function() {
  51. setTimeout(function() {
  52. targetNode.click();
  53. }, 800);
  54. };
  55.  
  56. }
  57. }
  58.  
  59.  
  60. if (document.location.pathname=="/lair"){
  61. if (document.getElementsByClassName("body")){
  62. var arr = document.getElementsByTagName('div');
  63. var len = arr.length;
  64. for(var i = 0;i<arr.length;i++){
  65. var dis = document.getElementsByTagName('div')[i].className;
  66. text="ubtn inbl mt-15 red mb2";
  67. if (document.getElementsByTagName('div')[i].innerHTML.indexOf(text) != '-1'){
  68. if (window.getComputedStyle(document.getElementsByClassName(dis)[0],null).getPropertyValue('display')=='block'){
  69. var targetNode = document.getElementsByTagName('div')[i].querySelector("a[class*='ubtn inbl mt-15 red mb2']");
  70. if (targetNode) {
  71. window.onload = function() {
  72. setTimeout(function() {
  73. targetNode.click();
  74. }, 1500);
  75. };
  76. }
  77. }
  78. }}}
  79. }
  80. if (document.querySelector("[href^='/arena']")){
  81. var targetNode = document.querySelector("[href^='/arena']");
  82. if (targetNode) {
  83. window.onload = function() {
  84. setTimeout(function() {
  85. targetNode.click();
  86. }, 800);
  87. };
  88.  
  89. }
  90. }
  91.  
  92. if (document.location.pathname=="/arena"){
  93. if (document.getElementsByClassName("body")){
  94. var arr = document.getElementsByTagName('div');
  95. var len = arr.length;
  96. for(var i = 0;i<arr.length;i++){
  97. var dis = document.getElementsByTagName('div')[i].className;
  98. text="ubtn inbl mt-15 red mb5";
  99. if (document.getElementsByTagName('div')[i].innerHTML.indexOf(text) != '-1'){
  100. if (window.getComputedStyle(document.getElementsByClassName(dis)[0],null).getPropertyValue('display')=='block'){
  101. var targetNode = document.getElementsByTagName('div')[i].querySelector("a[class*='ubtn inbl mt-15 red mb5']");
  102. if (targetNode) {
  103. window.onload = function() {
  104. setTimeout(function() {
  105. targetNode.click();
  106. }, 1500);
  107. };
  108. }
  109. }
  110. }}}
  111. }
  112. */
  113. //pvp
  114. if (document.getElementsByClassName("fr w50")[0]){
  115. var arr = document.getElementsByClassName("fr w50")[0].getElementsByTagName('div');
  116. var len = arr.length;
  117. for(var i = 0;i<arr.length;i++){
  118. var dis = document.getElementsByClassName("fr w50")[0].getElementsByTagName('div')[i].className;
  119. if (window.getComputedStyle(document.getElementsByClassName(dis)[0],null).getPropertyValue('display')=='block'){
  120. var targetNode = document.getElementsByClassName("fr w50")[0].getElementsByTagName('div')[i].querySelector("a[class*='ubtn inbl s red_no']");
  121. if (targetNode) {
  122. //window.setInterval(targetNode.click(),5000);
  123. window.onload =function() {
  124. setTimeout(function() {
  125. targetNode.click();
  126. }, 1500);
  127. };
  128. // triggerMouseEvent (targetNode, "click");
  129. }
  130. }
  131. }
  132.  
  133.  
  134. }
  135.  
  136. if (document.location.pathname=="/online"){
  137. if (document.querySelector("[href^='/invite']")){
  138. var targetNode = document.querySelector("[href^='/invite']");
  139. if (targetNode) {
  140. //window.setTimeout(targetNode.click(), 2000);
  141. window.onload = function() {
  142. setTimeout(function() {
  143. targetNode.click();
  144. }, 700);
  145. };
  146.  
  147. }
  148. }
  149. }
  150. //document.location.reload();
  151. // if (!document.getElementsByClassName("fr w50")[0]){
  152. window.setTimeout("document.location.reload();", 1500);
  153. //}
  154. }
  155.  
  156. //document.location='http://mrush.mobi/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement