Guest User

Untitled

a guest
Feb 15th, 2026
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. // ==UserScript==
  2. // @name RubyManor AutoRefresh
  3. // @namespace https://i-rpg.net/
  4. // @version 1.0
  5. // @description Auto refresh and redirect on keyword
  6. // @match *://i-rpg.net/*
  7. // @match *://*.i-rpg.net/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. const exploreURL = "https://i-rpg.net/rubymanor.php?action=explore&step=explore";
  15. const redirectURL = "https://i-rpg.net/rubymanor.php?action=explore&step=in4";
  16. const keyword = "Korytarze Rubinowego Dworu";
  17. const delay = 500;
  18.  
  19. // flaga w localStorage, żeby przekierować tylko RAZ
  20. let redirected = localStorage.getItem("rubyRedirected");
  21.  
  22. // jeśli jesteśmy na explore
  23. if (location.href.includes("step=explore")) {
  24. if (document.body.innerText.includes(keyword) && !redirected) {
  25. localStorage.setItem("rubyRedirected", "1");
  26. location.href = redirectURL;
  27. return;
  28. }
  29.  
  30. setTimeout(() => {
  31. location.reload();
  32. }, delay);
  33. }
  34.  
  35. // jeśli jesteśmy na in3 → wracamy na explore i czyścimy flagę
  36. if (location.href.includes("step=in4")) {
  37. setTimeout(() => {
  38. localStorage.removeItem("rubyRedirected");
  39. location.href = exploreURL;
  40. }, delay);
  41. }
  42.  
  43. })();
Advertisement
Add Comment
Please, Sign In to add comment