search any value and change it
// ==UserScript==
// @name Evoworld.io cheat engiene
// @namespace http://tampermonkey.net/
// @version 1.0
// @description search any value and change it
// @author You
// @match https://evoworld.io/
// @icon https://www.google.com/s2/favicons?sz=64&domain=evoworld.io
// @grant none
// ==/UserScript==
(function() {
let foundAddresses = [];
let cheatTable = [];
const style = document.createElement('style');
style.innerHTML = `
#ce-menu { position: fixed; top: 0; right: 0; width: 450px; height: 600px; background: #f0f0f0; border: 2px solid #666; z-index: 10000; font-family: 'Segoe UI', Tahoma, sans-serif; font-size: 12px; color: black; display: flex; flex-direction: column; box-shadow: -5px 0 15px rgba(0,0,0,0.3); }
.ce-header { background: linear-gradient(to bottom, #eee, #ccc); padding: 5px; border-bottom: 1px solid #999; font-weight: bold; display: flex; justify-content: space-between; }
.ce-main-controls { padding: 10px; display: flex; gap: 10px; border-bottom: 1px solid #ccc; }
.ce-list-container { flex: 1; overflow: auto; background: white; border: 1px solid #999; margin: 5px; }
.ce-table { width: 100%; border-collapse: collapse; cursor: default; table-layout: fixed; }
.ce-table th { background: #e1e1e1; position: sticky; top: 0; border: 1px solid #ccc; padding: 2px; text-align: left; } .ce-table td {
border: 1px solid #eee;
padding: 2px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 200px;
}
.ce-table tr:hover { background: #e8f2ff; }
.ce-footer-table { height: 200px; border-top: 2px solid #666; }
button { cursor: pointer; padding: 3px 8px; }
input[type="text"] { border: 1px solid #999; padding: 2px; }
`;
document.head.appendChild(style);
const container = document.createElement('div');
container.id = 'ce-menu';
container.innerHTML = `
<div class="ce-header"><span>Cheat Engine JS</span><span style="cursor:pointer" onclick="this.parentElement.parentElement.remove()">X</span></div>
<div class="ce-main-controls">
<div style="flex:1">
<input type="text" id="ce-scan-val" style="width:100%" placeholder="Value...">
<div style="margin-top:5px; display:flex; gap:5px;">
<button id="ce-new-scan">New Scan</button>
<button id="ce-next-scan">Next Scan</button>
</div>
</div>
<div style="font-size:10px; color:#444;">Found: <span id="ce-count">0</span></div>
</div>
<div class="ce-list-container">
<table class="ce-table"><thead id="ce-results-head"><tr><th>Address (Path)</th><th>Value</th></tr></thead><tbody id="ce-results-body"></tbody></table>
</div>
<div class="ce-list-container ce-footer-table">
<table class="ce-table"><thead><tr><th>Frozen</th><th>Description</th><th>Address</th><th>Value</th></tr></thead><tbody id="ce-table-body"></tbody></table>
</div>
`;
document.body.appendChild(container);
function getValByPath(path) {
try { return path.split('.').reduce((obj, prop) => obj[prop], window); } catch(e) { return undefined; }
}
function setValByPath(path, value) {
const parts = path.split('.');
const last = parts.pop();
const obj = parts.reduce((o, p) => o[p], window);
if (obj) obj[last] = isNaN(value) ? value : Number(value);
}
function scan(target, paths = null) {
let results = [];
let val = isNaN(target) ? target : Number(target);
if (!paths) {
const visited = new Set();
const rec = (obj, path) => {
if (obj === null || typeof obj !== 'object' || visited.has(obj) || path.includes('document')) return;
visited.add(obj);
for (let key in obj) {
try {
let p = `${path}.${key}`;
if (obj[key] == val) results.push(p);
if (typeof obj[key] === 'object') rec(obj[key], p);
} catch(e) {}
}
};
rec(window, "window");
} else {
paths.forEach(p => { if (getValByPath(p) == val) results.push(p); });
}
return results;
}
function updateResults() {
const body = document.getElementById('ce-results-body');
body.innerHTML = '';
foundAddresses.slice(0, 100).forEach(path => { // Лимит 100 для скорости
const tr = document.createElement('tr');
tr.innerHTML = `<td>${path}</td><td>${getValByPath(path)}</td>`;
tr.onclick = () => addToTable(path);
body.appendChild(tr);
});
document.getElementById('ce-count').innerText = foundAddresses.length;
}
function addToTable(path) {
if (!cheatTable.find(i => i.path === path)) {
cheatTable.push({ path, frozen: false, value: getValByPath(path) });
renderTable();
}
}
function renderTable() {
const body = document.getElementById('ce-table-body');
body.innerHTML = '';
cheatTable.forEach((item, index) => {
const tr = document.createElement('tr');
tr.innerHTML = `
<td style="text-align:center"><input type="checkbox" ${item.frozen ? 'checked' : ''} onchange="window._ce_freeze(${index}, this.checked)"></td>
<td>No description</td>
<td>${item.path}</td>
<td style="color:blue; cursor:pointer" onclick="window._ce_edit(${index})">${getValByPath(item.path)}</td>
`;
body.appendChild(tr);
});
}
window._ce_freeze = (idx, val) => {
cheatTable[idx].frozen = val;
cheatTable[idx].value = getValByPath(cheatTable[idx].path);
};
window._ce_edit = (idx) => {
const newVal = prompt("Enter new value:", getValByPath(cheatTable[idx].path));
if (newVal !== null) {
setValByPath(cheatTable[idx].path, newVal);
renderTable();
}
};
setInterval(() => {
cheatTable.forEach(item => {
if (item.frozen) setValByPath(item.path, item.value);
});
if (cheatTable.length > 0) renderTable();
}, 1000);
document.getElementById('ce-new-scan').onclick = () => {
foundAddresses = scan(document.getElementById('ce-scan-val').value);
updateResults();
};
document.getElementById('ce-next-scan').onclick = () => {
foundAddresses = scan(document.getElementById('ce-scan-val').value, foundAddresses);
updateResults();
};
})();