Greasy Fork

Greasy Fork is available in English.

Fast Linesplit (like fast split)

Put your cursor on top of on of the dots and press U

当前为 2023-02-16 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Fast Linesplit (like fast split)
// @namespace    Put your cursor on top of on of the dots and press U
// @version      1.1
// @description  Put your cursor on top of on of the dots and press U
// @author       Net#1872
// @license      GPL-3.0-or-later
// @match        https://cellcraft.io/
// @match        https://agma.io/
// @grant        none
// ==/UserScript==

var split = "U"
window.addEventListener('keydown', keydown);
setTimeout(function() {
    split = split.charCodeAt(0)

}, 50)
function fsLine(){
    $("#canvas").trigger($.Event("keydown", { keyCode: 84}));
    $("#canvas").trigger($.Event("keyup", { keyCode: 84}));
}
function freezeKey() {
    $("#canvas").trigger($.Event("keydown", { keyCode: 70}));
    $("#canvas").trigger($.Event("keyup", { keyCode: 70}));
}

function keydown(event) {
    if(event.keyCode == split){
        fsLine()
        setTimeout(freezeKey, 115)
        setTimeout(freezeKey, 165)
    }
}



$("head").append(`<style>
.point {
  background-color:#333;
}

.point:hover {
  background-color: orange;
}
</style>`);

//Credit to wynell for the window.innerHeight and window.innerWidth

let [w, h] = [, window.innerHeight]
$('body').append(`
<div class="point" id="point-top" onclick="fsLine()" style="border: 2px solid white; border-radius: 100%; width: 15px; height: 15px; position: fixed; left: ${
  window.innerWidth / 2
}px; top: ${0}px; transform: translate(-50%, -50%);"></div>
<div class="point" id="point-right" onclick="fsLine()" style="border: 2px solid white; border-radius: 100%; width: 15px; height: 15px; position: fixed; left: ${
  window.innerWidth
}px; top: ${window.innerHeight / 2}px; transform: translate(-50%, -50%);"></div>
<div class="point" id="point-bottom" onclick="fsLine()" style="border: 2px solid white; border-radius: 100%; width: 15px; height: 15px; position: fixed; left: ${
  window.innerWidth / 2
}px; top: ${window.innerHeight}px; transform: translate(-50%, -50%);"></div>
<div class="point" id="point-left" onclick="fsLine()" style="border: 2px solid white; border-radius: 100%; width: 15px; height: 15px; position: fixed; left: ${0}px; top: ${
  window.innerHeight / 2
}px; transform: translate(-50%, -50%);"></div>
</div>`)
$('#settingTab3,.rab-radius').click(function (e) {
  $('#roleSettings').css('display', 'block')
  $('#cLinesplitOverlay')
    .removeAttr('disabled')
    .parent()
    .parent()
    .css('display', 'block')
})

$(window).resize(function (e) {
  let [w, h] = [window.innerWidth, window.innerHeight]
  $('#point-top')
    .css('left', `${window.innerWidth / 2}px`)
    .css('top', `${0}px`)
  $('#point-right')
    .css('left', `${window.innerWidth}px`)
    .css('top', `${window.innerHeight / 2}px`)
  $('#point-bottom')
    .css('left', `${window.innerWidth / 2}px`)
    .css('top', `${window.innerHeight}px`)
  $('#point-left')
    .css('left', `${0}px`)
    .css('top', `${window.innerHeight / 2}px`)
})