Deluge RPG Pokémon Detector (Stop on Legendary)

Logs all Pokémon. Stops movement when a legendary/mythical/UB is detected.

Size

5.2 KB

Version

1.4.0

Created

Mar 19, 2026

Updated

28 days ago

1// ==UserScript==
2// @name        Deluge RPG Pokémon Detector (Stop on Legendary)
3// @license     MIT
4// @namespace   http://your-namespace.com
5// @version     1.4.0
6// @description Logs all Pokémon. Stops movement when a legendary/mythical/UB is detected.
7// @match       https://www.delugerpg.com/map/*
8// @grant       none
9// ==/UserScript==
10
11(function() {
12    'use strict';
13
14    // =========================
15    // TARGET LIST
16    // =========================
17
18    var basePokemon = [
19        'Mew','Mewtwo','Articuno','Zapdos','Moltres',
20        'Raikou','Entei','Suicune','Lugia','Ho-Oh','Celebi',
21        'Regirock','Regice','Registeel','Latias','Latios','Kyogre','Groudon','Rayquaza','Jirachi','Deoxys',
22        'Uxie','Mesprit','Azelf','Dialga','Palkia','Heatran','Regigigas','Giratina','Cresselia','Phione','Manaphy','Darkrai','Shaymin','Arceus',
23        'Victini','Cobalion','Terrakion','Virizion','Tornadus','Thundurus','Landorus','Reshiram','Zekrom','Kyurem','Keldeo','Meloetta','Genesect',
24        'Xerneas','Yveltal','Zygarde','Diancie','Hoopa','Volcanion',
25        'Tapu Koko','Tapu Lele','Tapu Bulu','Tapu Fini','Cosmog','Cosmoem','Solgaleo','Lunala','Necrozma','Magearna','Marshadow','Zeraora','Meltan','Melmetal',
26        'Zacian','Zamazenta','Eternatus','Kubfu','Urshifu','Zarude','Regieleki','Regidrago','Glastrier','Spectrier','Calyrex',
27        'Enamorus',
28        'Wo-Chien','Chien-Pao','Ting-Lu','Chi-Yu','Koraidon','Miraidon',
29        'Walking Wake','Iron Leaves',
30        'Ogerpon','Terapagos','Pecharunt',
31
32        'Type: Null','Silvally',
33        'Okidogi','Munkidori','Fezandipiti',
34
35        'Mega Mewtwo X','Mega Mewtwo Y',
36        'Mega Latias','Mega Latios',
37        'Primal Kyogre','Primal Groudon',
38        'Mega Rayquaza',
39        'G-Max Urshifu',
40        'Mega Diancie',
41        'G-Max Melmetal',
42
43        'Nihilego','Buzzwole','Pheromosa','Xurkitree',
44        'Celesteela','Kartana','Guzzlord',
45        'Poipole','Naganadel','Stakataka','Blacephalon'
46    ];
47
48    var variants = [
49        '', 'Shiny','Metallic','Ghost','Dark','Shadow','Mirage','Chrome','Negative','Retro'
50    ];
51
52    var pokemonList = [];
53
54    for (let p of basePokemon) {
55        for (let v of variants) {
56            pokemonList.push(v ? v + ' ' + p : p);
57        }
58    }
59
60    // =========================
61    // STATE
62    // =========================
63
64    let isAutoMoving = true;
65    let moveInterval = null;
66    let stopped = false;
67
68    // =========================
69    // UTIL
70    // =========================
71
72    function debounce(func, wait) {
73        let timeout;
74        return function(...args) {
75            clearTimeout(timeout);
76            timeout = setTimeout(() => func(...args), wait);
77        };
78    }
79
80    function getRandomDirection() {
81        const directions = ['north','south','east','west','north-west','north-east','south-west','south-east'];
82        return directions[Math.floor(Math.random() * directions.length)];
83    }
84
85    // =========================
86    // MOVEMENT
87    // =========================
88
89    function moveCharacter() {
90        if (!isAutoMoving || stopped) return;
91
92        const direction = getRandomDirection();
93        const moveLink = document.querySelector(`a[href*="/move/${direction}"]`);
94
95        if (moveLink) {
96            moveLink.click();
97        }
98    }
99
100    // =========================
101    // DETECTION (FIXED)
102    // =========================
103
104    function checkPokemon() {
105        const showPokeDiv = document.querySelector('#show-poke');
106        if (!showPokeDiv) return;
107
108        const content = showPokeDiv.textContent || "";
109
110        if (!content.toLowerCase().includes('appeared')) return;
111
112        // Try match from target list
113        let detected = pokemonList.find(p => content.includes(p));
114
115        if (detected) {
116            console.log(detected);
117
118            stopped = true;
119            isAutoMoving = false;
120
121            if (moveInterval) {
122                clearInterval(moveInterval);
123                moveInterval = null;
124            }
125        } else {
126            // fallback for normal Pokémon
127            let rough = content.split('appeared')[0];
128            console.log(rough.trim());
129        }
130    }
131
132    const debouncedCheck = debounce(checkPokemon, 300);
133
134    // =========================
135    // OBSERVER
136    // =========================
137
138    function setupObserver() {
139        const showPokeDiv = document.querySelector('#show-poke');
140
141        if (!showPokeDiv) {
142            setTimeout(setupObserver, 1000);
143            return;
144        }
145
146        const observer = new MutationObserver(debouncedCheck);
147
148        observer.observe(showPokeDiv, {
149            childList: true,
150            subtree: true,
151            characterData: true
152        });
153
154        checkPokemon();
155    }
156
157    // =========================
158    // START
159    // =========================
160
161    function startAutoMovement() {
162        isAutoMoving = true;
163        stopped = false;
164
165        moveInterval = setInterval(moveCharacter, 2000);
166        setTimeout(moveCharacter, 1000);
167    }
168
169    if (document.readyState === 'loading') {
170        document.addEventListener('DOMContentLoaded', () => {
171            setupObserver();
172            startAutoMovement();
173        });
174    } else {
175        setupObserver();
176        startAutoMovement();
177    }
178
179})();
Deluge RPG Pokémon Detector (Stop on Legendary) | Robomonkey