您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Empêche les missed clics dans le jeu d'échecs en ligne Lichess en ne comptant pas le clic gauche si la souris a bougé pendant le délai de mouvement spécifié avant le clic. Affiche un indicateur à côté du pseudo du joueur qui utilise le script.
当前为
// ==UserScript== // @name Antimisclic - Lichess // @namespace http://tampermonkey.net/ // @version 0.1 // @description Empêche les missed clics dans le jeu d'échecs en ligne Lichess en ne comptant pas le clic gauche si la souris a bougé pendant le délai de mouvement spécifié avant le clic. Affiche un indicateur à côté du pseudo du joueur qui utilise le script. // @author YGL (Benjamin Moine) // @include https://lichess.org/* // @grant none // @license Gnu GPL v3.0. // ==/UserScript== /* * @license Gnu GPL *This script is licensed under the GNU General Public License v3.0. * For more information, please see: https://www.gnu.org/licenses/gpl-3.0.html */ (function() { 'use strict'; let delay = 1000; // Default delay in milliseconds let indicator = null; let lastMouseMoveTime = Date.now(); let lastMousePosition = { x: 0, y: 0 }; let isTrackpad = false; function createIndicator() { indicator = document.createElement('div'); indicator.id = 'am-indicator'; updateIndicator(); document.body.appendChild(indicator); } function updateIndicator() { if (indicator) { indicator.style.display = 'block'; indicator.style.backgroundColor = '#001F3F'; // Dark blue color indicator.style.color = 'white'; indicator.style.padding = '5px'; indicator.style.borderRadius = '5px'; indicator.style.position = 'fixed'; indicator.style.top = '10px'; indicator.style.left = '10px'; indicator.style.zIndex = '9999'; indicator.textContent = 'A-M activé'; } } function playAudio() { const audio = new Audio('https://www.soundjay.com/button/beep-07.wav'); audio.play(); } document.addEventListener('mousemove', function(event) { lastMouseMoveTime = Date.now(); lastMousePosition = { x: event.clientX, y: event.clientY }; }); document.addEventListener('mousedown', function(event) { if (event.button === 0) { const now = Date.now(); const timeSinceLastMove = now - lastMouseMoveTime; if (timeSinceLastMove < delay && !isTrackpad) { playAudio(); event.stopPropagation(); event.preventDefault(); } } }); function checkTrackpad() { const timeThreshold = 100; // Milliseconds const now = Date.now(); const timeSinceLastMove = now - lastMouseMoveTime; const distanceMoved = Math.sqrt( Math.pow(lastMousePosition.x - event.clientX, 2) + Math.pow(lastMousePosition.y - event.clientY, 2) ); const movementSpeed = distanceMoved / timeSinceLastMove; isTrackpad = timeSinceLastMove < timeThreshold && movementSpeed < 0.1; } function toggleConfigPanel() { const configPanel = document.getElementById('am-config-panel'); if (configPanel) { configPanel.remove(); } else { createConfigPanel(); } } function createConfigPanel() { const configPanel = document.createElement('div'); configPanel.id = 'am-config-panel'; configPanel.style.backgroundColor = 'blue'; configPanel.style.color = 'white'; configPanel.style.padding = '10px'; configPanel.style.borderRadius = '5px'; configPanel.style.position = 'fixed'; configPanel.style.top = '50%'; configPanel.style.left = '50%'; configPanel.style.transform = 'translate(-50%, -50%)'; configPanel.style.zIndex = '10000'; const titleLabel = document.createElement('label'); titleLabel.textContent = 'Délai de mouvement avant le clic (en millisecondes): '; configPanel.appendChild(titleLabel); const inputField = document.createElement('input'); inputField.type = 'number'; inputField.value = delay; configPanel.appendChild(inputField); const saveButton = document.createElement('button'); saveButton.textContent = 'Sauvegarder'; saveButton.addEventListener('click', function() { delay = parseInt(inputField.value); toggleConfigPanel(); }); configPanel.appendChild(saveButton); document.body.appendChild(configPanel); } document.addEventListener('keydown', function(event) { if (event.ctrlKey && event.altKey && event.key === 'j') { if (indicator) { indicator.remove(); indicator = null; } else { createIndicator(); } } if (event.ctrlKey && event.altKey && event.key === 'k') { toggleConfigPanel(); } }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址