E-Better

Custom menu for Evades with many features for improvement.

21.03.2024 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         E-Better
// @version      0.1.5.2
// @description  Custom menu for Evades with many features for improvement.
// @author       Alertix(aka Failure), thanks to EtherCD(aka ✺Mistake✺) for helping and for making Map Filling for Beauty (https://github.com/EtherCD).
// @match        https://evades.online/*
// @match        https://evades.io/*
// @icon         https://u.cubeupload.com/FailureEvades/evadesactions.png
// @grant        none
// @run-at       document-idle
// @license      @license
// @namespace http://tampermonkey.net/
// ==/UserScript==

const customCSS = document.createElement('style');
customCSS.innerHTML = `
/* Removes ad/убирает рекламу */
.header-ad {
    opacity: .0;
    height: 90px;
    text-align: center;
    margin: 0 auto
}

.left-ad {
    opacity: .0;
    float: left
}

.right-ad {
    opacity: .0;
    float: right
}

.box-ad {
    opacity: .0;
    float: right;
    position: relative;
    left: -50%;
    transform: translate(165%)
}
`;
document.head.appendChild(customCSS);

const initEBetter = () => {
	const menu = document.createElement('div')
	menu.setAttribute('id', 'customMenu')
	menu.style.position = 'fixed'
	menu.style.top = '50%'
	menu.style.left = '0'
	menu.style.transform = 'translateY(-50%)'
	menu.style.background = 'rgba(0, 0, 0, 0.7)'
	menu.style.width = '50px'
	menu.style.height = '100vh'
	menu.style.display = 'block'
	menu.style.transition = 'width 0.5s'

	const settingsButton = document.createElement('img')
	settingsButton.src = 'https://evades.io/options.8b56ab3c.png'
	settingsButton.alt = 'Settings'
	settingsButton.style.position = 'absolute'
	settingsButton.style.top = '10px'
	settingsButton.style.left = '10px'
	settingsButton.style.width = '30px'
	settingsButton.style.height = 'auto'
	settingsButton.style.cursor = 'pointer'
	settingsButton.addEventListener('click', function () {
		toggleSubMenu()
	})

	const cursorChangerButton = document.createElement('img')
	cursorChangerButton.src =
		'https://u.cubeupload.com/FailureEvades/CursorChanger.png'
	cursorChangerButton.alt = 'Cursor Changer'
	cursorChangerButton.style.position = 'absolute'
	cursorChangerButton.style.top = '55px'
	cursorChangerButton.style.left = '10px'
	cursorChangerButton.style.width = '30px'
	cursorChangerButton.style.height = 'auto'
	cursorChangerButton.style.cursor = 'pointer'
	cursorChangerButton.addEventListener('click', function () {
		toggleCursorChangerSubMenu()
	})

	const cursorChangerSubMenu = document.createElement('div')
	cursorChangerSubMenu.setAttribute('id', 'cursorChangerSubMenu')
	cursorChangerSubMenu.style.position = 'absolute'
	cursorChangerSubMenu.style.top = '55px'
	cursorChangerSubMenu.style.left = '50px'
	cursorChangerSubMenu.style.width = '0'
	cursorChangerSubMenu.style.height = '70px'
	cursorChangerSubMenu.style.background = 'rgba(0, 0, 0, 0.7)'
	cursorChangerSubMenu.style.transition = 'width 0.5s'
	cursorChangerSubMenu.style.overflow = 'hidden'

	const changeCursorButton = document.createElement('img')
	changeCursorButton.src =
		'https://u.cubeupload.com/FailureEvades/arrowIcon.png'
	changeCursorButton.alt = 'Change Cursor'
	changeCursorButton.style.color = '#ffffff'
	changeCursorButton.style.position = 'absolute'
	changeCursorButton.style.top = '5px'
	changeCursorButton.style.left = '20px'
	changeCursorButton.style.width = '20px'
	changeCursorButton.style.height = 'auto'
	changeCursorButton.style.cursor = 'pointer'
	changeCursorButton.addEventListener('click', function () {
		changeCursor()
	})

	const currentCursorText = document.createElement('div')
	currentCursorText.textContent = 'Current Cursor: Normal'
	currentCursorText.style.color = '#ffffff'
	currentCursorText.style.position = 'absolute'
	currentCursorText.style.top = '5px'
	currentCursorText.style.left = '50px'
	currentCursorText.style.padding = '5px'
	currentCursorText.style.display = 'inline-block'

	let currentCursor = 'normal'

	cursorChangerSubMenu.appendChild(currentCursorText)
	cursorChangerSubMenu.appendChild(changeCursorButton)

	function changeCursor() {
		const body = document.querySelector('body')
		if (currentCursor === 'normal') {
			body.style.cursor = 'crosshair'
			currentCursorText.textContent = 'Current Cursor: Crosshair'
			currentCursor = 'crosshair'
		} else {
			body.style.cursor = 'auto'
			currentCursorText.textContent = 'Current Cursor: Normal'
			currentCursor = 'normal'
		}
	}

	menu.appendChild(cursorChangerButton)
	document.body.appendChild(cursorChangerSubMenu)

	function toggleCursorChangerSubMenu() {
		if (cursorChangerSubMenu.style.width === '0px') {
			cursorChangerSubMenu.style.width = '200px'
		} else {
			cursorChangerSubMenu.style.width = '0'
		}
	}

	const creditsButton = document.createElement('img')
	creditsButton.src = 'https://evades.io/question.bc02e04b.png'
	creditsButton.alt = 'Credits'
	creditsButton.style.position = 'absolute'
	creditsButton.style.top = '100px'
	creditsButton.style.left = '10px'
	creditsButton.style.width = '30px'
	creditsButton.style.height = 'auto'
	creditsButton.style.cursor = 'pointer'
	creditsButton.addEventListener('click', function () {
		toggleCreditsSubMenu()
	})

	const creditsSubMenu = document.createElement('div')
	creditsSubMenu.setAttribute('id', 'creditsSubMenu')
	creditsSubMenu.style.position = 'absolute'
	creditsSubMenu.style.top = '100px'
	creditsSubMenu.style.left = '50px'
	creditsSubMenu.style.width = '0px'
	creditsSubMenu.style.height = '150px'
	creditsSubMenu.style.background = 'rgba(0, 0, 0, 0.7)'
	creditsSubMenu.style.transition = 'width 1.5s'
	creditsSubMenu.style.overflow = 'hidden'

	const currentCreditsText = document.createElement('div')
	currentCreditsText.textContent = 'Thanks to: EtherCD(aka ✺Mistake✺)'
	currentCreditsText.style.color = '#ffffff'
	currentCreditsText.style.position = 'absolute'
	currentCreditsText.style.top = '5px'
	currentCreditsText.style.left = '10px'
	currentCreditsText.style.padding = '5px'
	currentCreditsText.style.display = 'inline-block'

	const moreButton = document.createElement('img')
	moreButton.src = 'https://u.cubeupload.com/FailureEvades/MoreButton.png'
	moreButton.alt = 'More'
	moreButton.style.position = 'absolute'
	moreButton.style.top = '1000px'
	moreButton.style.left = '10px'
	moreButton.style.width = '30px'
	moreButton.style.height = 'auto'
	moreButton.style.cursor = 'pointer'
	moreButton.addEventListener('click', function () {
		toggleMoreSubMenu()
	})

	const moreSubMenu = document.createElement('div')
	moreSubMenu.setAttribute('id', 'moreSubMenu')
	moreSubMenu.style.position = 'absolute'
	moreSubMenu.style.top = '190px'
	moreSubMenu.style.left = '50px'
	moreSubMenu.style.width = '0px'
	moreSubMenu.style.height = '150px'
	moreSubMenu.style.background = 'rgba(0, 0, 0, 0.7)'
	moreSubMenu.style.transition = 'width 1.5s'
	moreSubMenu.style.overflow = 'hidden'

	const currentMoreText = document.createElement('div')
	currentCreditsText.textContent = 'Display Keystrokes'
	currentCreditsText.style.color = '#ffffff'
	currentCreditsText.style.position = 'absolute'
	currentCreditsText.style.top = '5px'
	currentCreditsText.style.left = '10px'
	currentCreditsText.style.padding = '5px'
	currentCreditsText.style.display = 'inline-block'

	creditsSubMenu.appendChild(currentCreditsText)

	menu.appendChild(moreButton)
	document.body.appendChild(moreSubMenu)

	function toggleMoreSubMenu() {
		if (moreSubMenu.style.width === '0px') {
			moreSubMenu.style.width = '200px'
		} else {
			moreSubMenu.style.width = '0'
		}
	}

	creditsSubMenu.appendChild(currentCreditsText)

	menu.appendChild(creditsButton)
	document.body.appendChild(creditsSubMenu)

	function toggleCreditsSubMenu() {
		if (creditsSubMenu.style.width === '0px') {
			creditsSubMenu.style.width = '200px'
		} else {
			creditsSubMenu.style.width = '0'
		}
	}

	const osuButton = document.createElement('img')
	osuButton.src =
		'https://images.spasibovsem.ru/catalog/original/osu-otzyvy-1470068147.png'
	osuButton.alt = 'Osu'
	osuButton.style.position = 'absolute'
	osuButton.style.top = '145px'
	osuButton.style.left = '10px'
	osuButton.style.width = '30px'
	osuButton.style.height = 'auto'
	osuButton.style.cursor = 'crosshair'
	osuButton.addEventListener('click', function () {
		window.location.href = 'https://osu.ppy.sh/users/35576054'
	})

	menu.appendChild(osuButton)

	const friendsButton = document.createElement('img')
	friendsButton.src =
		'https://cdn0.iconfinder.com/data/icons/simple-seo-and-internet-icons/512/social_media_marketing-1024.png'
	friendsButton.alt = 'Friends'
	friendsButton.style.position = 'absolute'
	friendsButton.style.top = '190px'
	friendsButton.style.left = '10px'
	friendsButton.style.width = '30px'
	friendsButton.style.height = 'auto'
	friendsButton.style.cursor = 'pointer'
	friendsButton.addEventListener('click', function () {
		alert('Sorry, but this Feature Works in Progress!')
	})

	menu.appendChild(friendsButton)

	const subMenu = document.createElement('div')
	subMenu.setAttribute('id', 'subMenu')
	subMenu.style.position = 'absolute'
	subMenu.style.top = '0'
	subMenu.style.left = '50px'
	subMenu.style.width = '0'
	subMenu.style.height = '67px'
	subMenu.style.background = 'rgba(0, 0, 0, 0.7)'
	subMenu.style.transition = 'width 0.5s'
	subMenu.style.overflow = 'hidden'

	const colorPickerButton = document.createElement('div')
	colorPickerButton.style.display = 'flex'
	colorPickerButton.style.alignItems = 'center'
	colorPickerButton.style.cursor = 'pointer'
	colorPickerButton.style.padding = '5px'
	colorPickerButton.style.borderBottom = '1px solid #ccc'
	colorPickerButton.textContent = "Change everybody's nick color (clientside)"
	colorPickerButton.style.color = '#ffffff'

	const colorPicker = document.createElement('input')
	colorPicker.setAttribute('type', 'color')
	colorPicker.style.width = '30px'
	colorPicker.style.height = '30px'
	colorPicker.style.border = 'none'
	colorPicker.style.borderRadius = '0'
	colorPicker.style.marginLeft = '10px'

	colorPicker.addEventListener('change', function (event) {
		const newColor = event.target.value
		changeNickColor(newColor)
	})

	colorPickerButton.appendChild(colorPicker)

	subMenu.appendChild(colorPickerButton)

	menu.appendChild(settingsButton)
	document.body.appendChild(menu)
	document.body.appendChild(subMenu)

	function toggleSubMenu() {
		if (subMenu.style.width === '0px') {
			subMenu.style.width = '200px'
		} else {
			subMenu.style.width = '0'
		}
	}

	function changeNickColor(newColor) {
		const chatMessages = document.querySelectorAll('.chat-message-sender')
		chatMessages.forEach(function (message) {
			message.style.color = newColor
		})
	}

	document.addEventListener('mousemove', function (event) {
		if (event.clientX < 20) {
			menu.style.display = 'block'
			menu.style.width = '150px'
		} else {
			menu.style.width = '50px'
		}
	})
}

// EtherCD's Map Filling for Beauty
window.EvadesME = {
	vars: {
		worlds: {
			'Central Core': ['#425a6d', 0.1],
			//'Catastrophic Core': ['#B00B1E', 0.1, () => Math.abs(Math.sin(Date.now() / 1000) * 0.15)],
			'Haunted Halls': ['#664B00', 0.1],
			'Peculiar Pyramid': ['#666600', 0.1],
			'Wacky Wonderland': ['#870080', 0.1],
			'Glacial Gorge': ['#005668', 0.1],
			'Vicious Valley': ['#4d6b40', 0.1],
			'Humongous Hollow': ['#663900', 0.1],
			'Elite Expanse': ['#2a3b4f', 0.1],
			'Endless Echo': ['#4168c4', 0.1],
			'Dangerous District': ['#680000', 0.1],
			'Quiet Quarry': ['#425a6d', 0.1],
			'Monumental Migration': ['#470066', 0.1],
			'Ominous Occult': ['#63838e', 0.1],
			'Frozen Fjord': ['#27494f', 0.1],
			'Restless Ridge': ['#a88b64', 0.1],
			'Toxic Territory': ['#5c5c5c', 0.1],
			'Magnetic Monopole': ['#bf00ff', 0.1],
			'Burning Bunker': ['#cc0000', 0.1],
			'Grand Garden': ['#6a9c49', 0.1],
			'Mysterious Mansion': ['#9c0ec7', 0.1],
			'Cyber Castle': ['#21bad9', 0.1],
			'Shifting Sands': ['#c88241', 0.1],
			'Infinite Inferno': ['#9b0606', 0.1],
			'Coupled Corridors': ['#bcad59', 0.1],
			'Withering Wasteland': ['#c45945', 0.1],
			'Dusty Depths': ['#825B37', 0.1],
		},
		worldsKeys: [],
	},

	replaces: [],

	addReplace(a, b) {
		this.replaces.push([a, b])
	},

	addReplaces() {
		this.addReplace(
			/prepareCanvas\(\w\)\{[\w\d\$="'.,;#?:\s\(\)]+\}/,
			`prepareCanvas(e) {
                  this.chat.style.visibility = 'visible';
                  this.leaderboard.style.visibility = 'visible';
                  this.context.fillStyle = '#333';
                  this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height);
                  if (window.EvadesME.vars.worldsKeys.includes(e.area.regionName)) {
                    this.context.fillStyle = window.EvadesME.vars.worlds[e.area.regionName][0];
                    this.context.globalAlpha = window.EvadesME.vars.worlds[e.area.regionName][2]
                      ? window.EvadesME.vars.worlds[e.area.regionName][2]()
                      : window.EvadesME.vars.worlds[e.area.regionName][1];
                    this.context.fillRect(0, 0, this.context.canvas.width, this.context.canvas.height);
                    this.context.globalAlpha = 1;
                  }
                  this.camera.centerOn(e.self.entity);
                }`
		)
		// this.addReplace(/=['"]#006b2c['"]/, `="#6B0063"`); // #006b66
		// this.addReplace(/=['"]#00ff6b['"]/, `="#e500ff"`); // #00fff4
	},

	init() {
		this.vars.worldsKeys = Object.keys(this.vars.worlds)
		this.addReplaces()
	},

	insertCode() {
		// From script by @Irudis: Evades Helper
		// commenting from alertix: HMMMM????? hacker??🤨
		let elem = Array.from(document.querySelectorAll('script')).filter(
			a => a.type === 'module' && a.src.match(/\/index\.[0-9a-f]{8}\.js/)
		)[0]
		if (!elem) return
		if (!navigator.userAgent.includes('Firefox')) elem.remove()
		let src = elem.src

		let req = new XMLHttpRequest()
		req.open('GET', src, false)
		req.send()
		let code = req.response
		for (const r in this.replaces)
			code = code.replace(this.replaces[r][0], this.replaces[r][1])

		let nScr = document.createElement('script')
		nScr.setAttribute('type', 'module')
		nScr.innerHTML = code
		document.body.appendChild(nScr)
		console.log('E-Better was loaded!')
		initEBetter()
	},

	// idk why did ethercd put that
	asAddonForTSMod() {
		console.log('Sorry, E-Better is not working with TS-Mod')
	},
}

window.EvadesME.init()
if (!window.tsmod) window.EvadesME.insertCode()
else window.EvadesME.asAddonForTSMod()
function setZoomTo100() {
	document.body.style.zoom = '100%'
}