Mouse Line Aimer for zombsroyale.io

Creates a line that follows the mouse

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
tols2i89 tols2i89
日安装量
1
总安装量
22
评分
0 0 0
版本
1.0
创建于
2025-11-10
更新于
2025-11-10
大小
1.9 KB
许可证
MIT
适用于

// ==UserScript==
// @name Mouse Line Aimer for zombsroyale.io
// @namespace JonJon565
// @version 1.0
// @description Creates a line that follows the mouse
// @author JonJon565|IGN:911
// @match https://zombsroyale.io/
// @grant GM_addStyle
// @license MIT
// @downloadURL https://update.greasyfork.org/scripts/491778/Mouse%20Line%20Aimer%20for%20zombsroyaleio.user.js
// @updateURL https://update.greasyfork.org/scripts/491778/Mouse%20Line%20Aimer%20for%20zombsroyaleio.meta.js
// ==/UserScript==

(function() {
'use strict';

var line = document.createElement('div');
line.id = 'cursor-line';
document.body.appendChild(line);

GM_addStyle(`
#cursor-line {
display: none; /* Initially hide the line */
position: fixed;
top: 50%;
left: 50%;
width: 150px; /* Set line thickness */
height: 3px;
background-color: black;
z-index: 9999;
transform-origin: 0 0; /* Set transform origin to top left corner */
}
`);
document.addEventListener('mousemove', function(event) {
var line = document.getElementById('cursor-line');
var centerX = window.innerWidth / 2;
var centerY = window.innerHeight / 2;
var mouseX = event.clientX;
var mouseY = event.clientY;
var deltaX = mouseX - centerX;
var deltaY = mouseY - centerY;
var angle = Math.atan2(deltaY, deltaX);
var distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
line.style.transform = 'translate(0%, 0%) rotate(' + angle + 'rad)';
line.style.width = distance + 'px';
});

document.addEventListener('keydown', function(event) {
if (event.key === '-') {
var line = document.getElementById('cursor-line');
line.style.display = (line.style.display === 'none') ? 'block' : 'none';
}
});
})();