Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name RubyManor AutoRefresh
- // @namespace https://i-rpg.net/
- // @version 1.0
- // @description Auto refresh and redirect on keyword
- // @match *://i-rpg.net/*
- // @match *://*.i-rpg.net/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- const exploreURL = "https://i-rpg.net/rubymanor.php?action=explore&step=explore";
- const redirectURL = "https://i-rpg.net/rubymanor.php?action=explore&step=in4";
- const keyword = "Korytarze Rubinowego Dworu";
- const delay = 500;
- // flaga w localStorage, żeby przekierować tylko RAZ
- let redirected = localStorage.getItem("rubyRedirected");
- // jeśli jesteśmy na explore
- if (location.href.includes("step=explore")) {
- if (document.body.innerText.includes(keyword) && !redirected) {
- localStorage.setItem("rubyRedirected", "1");
- location.href = redirectURL;
- return;
- }
- setTimeout(() => {
- location.reload();
- }, delay);
- }
- // jeśli jesteśmy na in3 → wracamy na explore i czyścimy flagę
- if (location.href.includes("step=in4")) {
- setTimeout(() => {
- localStorage.removeItem("rubyRedirected");
- location.href = exploreURL;
- }, delay);
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment