Refined ESP: optimized logic, helper functions, boss highlight, no darkness, food/enemy distinction
Size
7.3 KB
Version
9.21
Created
Feb 12, 2026
Updated
about 1 month ago
1// ==UserScript==
2// @name Evoworld ReaperView 9.2
3// @namespace http://tampermonkey.net/
4// @version 9.21
5// @description Refined ESP: optimized logic, helper functions, boss highlight, no darkness, food/enemy distinction
6// @author senka1
7// @match https://evoworld.io/
8// @grant none
9// @license MIT
10// @downloadURL https://update.greasyfork.org/scripts/543274/Evoworld%20ReaperView%2092.user.js
11// @updateURL https://update.greasyfork.org/scripts/543274/Evoworld%20ReaperView%2092.meta.js
12// ==/UserScript==
13
14(function () {
15 'use strict';
16
17 // Display an alert when the script is activated
18 alert("ESP ON\nModified by senka1");
19
20 // Wait for the game to fully load before initializing ESP
21 function waitForGameLoad() {
22 if (typeof game !== 'undefined' && game.canvas && game.dynamicContext && game.me) {
23 initESP();
24 } else {
25 setTimeout(waitForGameLoad, 500);
26 }
27 }
28
29 function initESP() {
30 const ctx = game.dynamicContext;
31 const canvas = game.canvas;
32 const config = {
33 showFood: true,
34 showEnemies: true
35 };
36
37 // List of conditional bosses that are only dangerous if they can eat the player
38 const conditionalBosses = [
39 "swampmonster", "demonicimp", "phoenix", "phoenixbird",
40 "shadowreaper", "grimreaper", "ghostlyreaper", "voidreaper", "dragon"
41 ];
42
43 // Boss detection logic
44 const isBoss = (name, me, obj) => {
45 if (name === "pumpkin") return false;
46 if (name.includes("reaper") || (name.startsWith("pumpkin") && name !== "pumpkin")) return true;
47 return conditionalBosses.includes(name) && canEat(obj, me);
48 };
49
50 // Disable in-game darkness overlay
51 drawDarkness = () => {};
52
53 // Helper function to create and style DOM elements
54 const createElement = (tag, style, parent, text) => {
55 const el = document.createElement(tag);
56 if (text) el.textContent = text;
57 Object.assign(el.style, style);
58 parent.appendChild(el);
59 return el;
60 };
61
62 // Create ESP toggle button
63 const toggleBtn = createElement('button', {
64 position: 'fixed', top: '60px', right: '10px', zIndex: 9999,
65 padding: '8px 12px', fontSize: '16px', cursor: 'pointer',
66 backgroundColor: '#222', color: 'white', border: 'none',
67 borderRadius: '4px', opacity: '0.7'
68 }, document.body, 'ESP');
69 toggleBtn.title = 'Toggle ESP Menu (M)';
70
71 // Create settings menu
72 const menu = createElement('div', {
73 position: 'fixed', top: '50%', left: '50%', transform: 'translate(-50%, -50%)',
74 backgroundColor: 'rgba(0,0,0,0.85)', color: 'white', padding: '20px',
75 borderRadius: '10px', fontFamily: 'Arial, sans-serif', fontSize: '18px',
76 zIndex: 9999, display: 'none', width: '280px', boxShadow: '0 0 10px #000'
77 }, document.body);
78
79 // Menu title bar
80 const title = createElement('div', {
81 fontWeight: 'bold', fontSize: '20px', marginBottom: '12px',
82 display: 'flex', justifyContent: 'space-between', alignItems: 'center'
83 }, menu, 'Config ESP');
84
85 // Close button
86 const closeBtn = createElement('button', {
87 backgroundColor: 'transparent', border: 'none', color: 'white',
88 fontSize: '20px', cursor: 'pointer', fontWeight: 'bold'
89 }, title, 'X');
90
91 // Menu toggle handlers
92 closeBtn.onclick = () => menu.style.display = 'none';
93 toggleBtn.onclick = () => menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
94 document.addEventListener('keydown', e => {
95 if (e.key.toLowerCase() === 'm') menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
96 });
97
98 // Checkbox creation for config toggles
99 const createCheckbox = (labelText, key) => {
100 const label = createElement('label', { display: 'block', marginBottom: '10px' }, menu);
101 const checkbox = document.createElement('input');
102 checkbox.type = 'checkbox';
103 checkbox.checked = config[key];
104 checkbox.style.marginRight = '10px';
105 checkbox.onchange = () => config[key] = checkbox.checked;
106 label.appendChild(checkbox);
107 label.appendChild(document.createTextNode(labelText));
108 };
109
110 createCheckbox('ESP Food (Yellow/Green)', 'showFood');
111 createCheckbox('ESP Enemy (Red/Cyan/Purple)', 'showEnemies');
112
113 // Legend to explain color codes
114 const legend = document.createElement('div');
115 legend.innerHTML = `
116 <hr style="margin: 10px 0;">
117 <div style="font-size: 14px;">
118 <b>Legend:</b><br>
119 <span style="color: yellow;">Yellow</span> - Edible NPC Food<br>
120 <span style="color: green;">Green</span> - Edible Players<br>
121 <span style="color: red;">Red</span> - Enemy Players<br>
122 <span style="color: cyan;">Cyan</span> - NPC Threats<br>
123 <span style="color: purple;">Purple</span> - Boss Mobs (Reapers/Pumpkins always, others if they can eat you)<br>
124 </div>
125 <div style="text-align:center; font-size:12px; margin-top:8px; color:#aaa">ESP Script v9.1 by senka1</div>
126 `;
127 menu.appendChild(legend);
128
129 // Helper to calculate object center
130 const getCenter = obj => ({
131 x: obj.position.x + obj.width / 2,
132 y: obj.position.y + obj.height / 2
133 });
134
135 // Validation helpers
136 const isActive = obj => obj?.active ?? obj?.isActive ?? true;
137 const validObj = obj => obj && obj.position && obj.width > 0 && obj.height > 0 && isActive(obj);
138 const canEat = (a, b) => foodChain?.[a.name]?.eats?.[b.name];
139
140 // Determine ESP attributes based on object type and relationships
141 const getESPAttributes = (me, obj) => {
142 const name = obj.name?.toLowerCase() || "";
143 const isPlayer = obj.type === objectType.PLAYER;
144 if (!validObj(obj) || obj === me) return null;
145
146 if (isBoss(name, me, obj)) {
147 return { color: 'purple', alpha: 1.0, dist: 6000, width: 4.0 };
148 }
149
150 if (config.showEnemies && canEat(obj, me)) {
151 return {
152 color: isPlayer ? 'red' : 'cyan',
153 alpha: isPlayer ? 1.0 : 0.5,
154 dist: 3000,
155 width: isPlayer ? 2.4 : 2.0
156 };
157 }
158
159 if (config.showFood && canEat(me, obj)) {
160 return {
161 color: isPlayer ? 'green' : 'yellow',
162 alpha: isPlayer ? 1.0 : 0.5,
163 dist: 3000,
164 width: 2.0
165 };
166 }
167
168 return null;
169 };
170
171 // Main rendering logic to draw ESP lines
172 function drawESP() {
173 ctx.clearRect(0, 0, canvas.width, canvas.height);
174 const me = game.me;
175 if (!me?.position) return;
176 const mePos = getCenter(me);
177
178 for (const obj of Object.values(game.gameObjects)) {
179 const attr = getESPAttributes(me, obj);
180 if (!attr) continue;
181
182 const objPos = getCenter(obj);
183 if (Math.hypot(mePos.x - objPos.x, mePos.y - objPos.y) > attr.dist) continue;
184
185 const meRender = game.getRenderPosition(mePos.x, mePos.y);
186 const objRender = game.getRenderPosition(objPos.x, objPos.y);
187
188 ctx.save();
189 ctx.globalAlpha = attr.alpha;
190 ctx.strokeStyle = attr.color;
191 ctx.lineWidth = attr.width;
192 ctx.beginPath();
193 ctx.moveTo(meRender.x, meRender.y);
194 ctx.lineTo(objRender.x, objRender.y);
195 ctx.stroke();
196 ctx.restore();
197 }
198 }
199
200 // Hook into game rendering cycle
201 const originalDraw = game.beforeDrawAllObjects;
202 game.beforeDrawAllObjects = function () {
203 originalDraw?.apply(this, arguments);
204 drawESP();
205 };
206 }
207
208 waitForGameLoad();
209})();
210