Keystrokes for Sploop.io

Keystrokes made for Sploop.io! | For support please join our Discord - https://discord.gg/zpVgaMdrrd

ของเมื่อวันที่ 07-04-2023 ดู เวอร์ชันล่าสุด

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

ผู้เขียน
Ashureth
คะแนน
0 0 0
เวอร์ชัน
0.3
สร้างเมื่อ
07-04-2023
อัปเดตเมื่อ
07-04-2023
Size
4.35 กิโลไบต์
สัญญาอนุญาต
MIT
ปรับใช้กับ

// ==UserScript==
// @name Keystrokes for Sploop.io
// @version 0.2
// @description Keystrokes made for Sploop.io! | For support please join our Discord - https://discord.gg/zpVgaMdrrd
// @author Ashureth
// @match *://*sploop.io/*
// @license MIT
// @grant none
// ==/UserScript==

// VERIONS

/*
0.2 - Fixed some key bugs
0.3 - Fixed so that keys don't react when you're chatting or if you are in the clan tab.
*/


function Blocking() {
return document.getElementById('chat-wrapper').offsetParent == null && document.getElementById('clan-menu').offsetParent == null;
}

let html = `



Q

W

E

A

S

D

━━━━━

`
let HeldKeys = [];
let EToggle = false;

setInterval(() => {

if(document.getElementById('play-text').offsetParent !== null) {
EToggle = false;
}

var Element;

let arr = ['W', 'A', 'S', 'D', 'E', 'Q', 'Space'];

for(let i of arr) {
i != 'E' && document.getElementById(`key${i}`) && (document.getElementById(`key${i}`).style.background = '#2F3336');
}


for(let Key in HeldKeys) {
if(HeldKeys[Key] != 'E' && HeldKeys[Key] != null) {
Element = document.getElementById(`key${HeldKeys[Key]}`);

if(Element) {
Element.style.background = '#52585e'
}
} else {
Element = document.getElementById(`keyE`);

Element.style.background = EToggle ? '#52585e' : '#2F3336';

}
}
});

document.body.insertAdjacentHTML('beforeend', html);

let game = document.getElementById('game-canvas');

window.addEventListener('keydown', e => {
if(!Blocking()) return;
let isSpace = e.key === ' ';
if(isSpace) {
HeldKeys['Space'] = 'Space';
} else {
if(e.key == 'e') {
EToggle = !EToggle;
} else {
HeldKeys[e.key.toUpperCase()] = e.key.toUpperCase();
}
}
});
window.addEventListener('keyup', e => {
let isSpace = e.key === ' ';
if(isSpace) {
HeldKeys['Space'] = null;
} else {
HeldKeys[e.key.toUpperCase()] = null;
}
});