Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Eclipse Auto Clicker
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description Bichok Eclipse Auto Clicker
- // @match https://tap.eclipse.xyz/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- function waitForElements() {
- return new Promise(resolve => {
- function check() {
- const container = document.querySelector('.row-start-1.grid.place-content-start.justify-center.py-8.md\\:col-span-1');
- const canvas = document.querySelector('canvas');
- if (container && canvas) {
- resolve({ container, canvas });
- return true;
- }
- return false;
- }
- if (check()) return;
- const observer = new MutationObserver(mutations => {
- if (check()) {
- observer.disconnect();
- }
- });
- observer.observe(document.body, {
- childList: true,
- subtree: true
- });
- });
- }
- function createToggleButton() {
- const toggleButton = document.createElement('button');
- toggleButton.innerHTML = '🖱️ Off';
- toggleButton.style.cssText = `
- margin: 20px auto 0;
- padding: 8px 16px;
- border-radius: 8px;
- background: #0B979F;
- color: white;
- border: none;
- cursor: pointer;
- font-weight: bold;
- opacity: 0.8;
- display: block;
- `;
- return toggleButton;
- }
- function getRandomCoordinates(element) {
- const rect = element.getBoundingClientRect();
- const centerX = rect.left + rect.width / 2;
- const centerY = rect.top + rect.height / 2;
- const radiusX = rect.width * 0.3;
- const radiusY = rect.height * 0.3;
- const angle = Math.random() * Math.PI * 2;
- const distance = Math.random();
- const x = centerX + Math.cos(angle) * radiusX * distance;
- const y = centerY + Math.sin(angle) * radiusY * distance;
- return { x, y };
- }
- function simulateRealClick(element) {
- if (!element) return;
- const { x, y } = getRandomCoordinates(element);
- const { x: upX, y: upY } = getRandomCoordinates(element);
- const mouseDown = new MouseEvent('mousedown', {
- view: window,
- bubbles: true,
- cancelable: true,
- clientX: x,
- clientY: y,
- button: 0,
- buttons: 1
- });
- element.dispatchEvent(mouseDown);
- setTimeout(() => {
- const mouseUp = new MouseEvent('mouseup', {
- view: window,
- bubbles: true,
- cancelable: true,
- clientX: upX,
- clientY: upY,
- button: 0,
- buttons: 0
- });
- element.dispatchEvent(mouseUp);
- setTimeout(() => {
- const click = new MouseEvent('click', {
- view: window,
- bubbles: true,
- cancelable: true,
- clientX: upX,
- clientY: upY,
- button: 0,
- buttons: 0
- });
- element.dispatchEvent(click);
- }, 5 + Math.random() * 10);
- }, 50 + Math.random() * 50);
- }
- async function initAutoClicker() {
- const { container, canvas } = await waitForElements();
- const toggleButton = createToggleButton();
- container.appendChild(toggleButton);
- let isClicking = localStorage.getItem('autoClickerEnabled') === 'true';
- let clickTimeout = null;
- let reloadTimeout = null;
- function performClick() {
- if (!isClicking) return;
- const shouldTakeLongBreak = Math.random() < 0.002;
- simulateRealClick(canvas);
- if (shouldTakeLongBreak) {
- clickTimeout = setTimeout(performClick, 10000 + Math.random() * 20000);
- } else {
- clickTimeout = setTimeout(performClick, 100 + Math.random() * 50);
- }
- }
- function scheduleReload() {
- if (!isClicking) return;
- reloadTimeout = setTimeout(() => {
- localStorage.setItem('autoClickerEnabled', 'true');
- location.reload();
- }, 30 * 60 * 1000);
- }
- if (isClicking) {
- toggleButton.innerHTML = '🖱️ On';
- toggleButton.style.background = '#9F0B0B';
- setTimeout(() => {
- performClick();
- scheduleReload();
- }, 45000);
- }
- toggleButton.addEventListener('click', () => {
- isClicking = !isClicking;
- localStorage.setItem('autoClickerEnabled', isClicking);
- toggleButton.innerHTML = isClicking ? '🖱️ On' : '🖱️ Off';
- toggleButton.style.background = isClicking ? '#9F0B0B' : '#0B979F';
- if (isClicking) {
- performClick();
- scheduleReload();
- } else {
- if (clickTimeout) {
- clearTimeout(clickTimeout);
- }
- if (reloadTimeout) {
- clearTimeout(reloadTimeout);
- }
- }
- });
- }
- initAutoClicker().catch(console.error);
- })();
Add Comment
Please, Sign In to add comment