idk

Script for vectaria This script have Copyright

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         idk
// @namespace    https://twojastrona.pl/
// @version      5.0
// @description   Script for vectaria This script have Copyright
// @author       x_Rediex
// @license      Copyright (c) 2025 x_Rediex. All Rights Reserved.
// @match        https://vectaria.io/*
// @grant        none
// ==/UserScript==

// Copyright (c) 2025 x_Rediex
// All Rights Reserved.
// This script is protected by copyright law.
// Any unauthorized reproduction, distribution, modification,
// or publication of this code is strictly prohibited.
// You may not copy, share, upload, or reuse any part of this script
// without explicit written permission from the author (x_Rediex).


window.WebSocket = new Proxy(WebSocket, {
  construct: function(target, args, newTarget) {
    let [address, options] = args;
    let wsObj = new target(...[address, options]);
    if (address !== 'wss://ws.vectaria.io') {
        window.gamesocket = wsObj;
    }
    return wsObj;
  }
});

let FLIGHT = false;
let GHOST = false;

function getStatus() {
    return `Creative Mode ${FLIGHT ? 'ON' : 'OFF'} (keybind f); Ghost Mode ${GHOST ? 'ON' : 'OFF'} (keybind n)`;
}

window.addEventListener('keydown', function (e) {
    if (window.gamesocket && window.gamesocket.readyState === WebSocket.OPEN && e.key === 'f') {
        FLIGHT = !FLIGHT;
        if (FLIGHT) {
            gamesocket.dispatchEvent(new MessageEvent('message', { data: '{"key":38,"data":[3,{"mode":2}]}' }));
            gamesocket.dispatchEvent(new MessageEvent('message', { data: `{"key":38,"data":[1,{"msg":"${getStatus()}","type": 3}]}` }));
        } else if (GHOST) {
            gamesocket.dispatchEvent(new MessageEvent('message', { data: '{"key":38,"data":[3,{"mode":3}]}' }));
            gamesocket.dispatchEvent(new MessageEvent('message', { data: `{"key":38,"data":[1,{"msg":"${getStatus()}","type": 3}]}` }));
        }
        else {
            gamesocket.dispatchEvent(new MessageEvent('message', { data: '{"key":38,"data":[3,{"mode":1}]}' }));
            gamesocket.dispatchEvent(new MessageEvent('message', { data: `{"key":38,"data":[1,{"msg":"${getStatus()}","type": 3}]}` }));
        }

    }
});

window.addEventListener('keydown', function (e) {
    if (window.gamesocket && window.gamesocket.readyState === WebSocket.OPEN && e.key === 'n') {
        GHOST = !GHOST;
        if (GHOST) {
            gamesocket.dispatchEvent(new MessageEvent('message', { data: '{"key":38,"data":[3,{"mode":3}]}' }));
            gamesocket.dispatchEvent(new MessageEvent('message', { data: `{"key":38,"data":[1,{"msg":"${getStatus()}","type": 3}]}` }));
        } else if (FLIGHT) {
            gamesocket.dispatchEvent(new MessageEvent('message', { data: '{"key":38,"data":[3,{"mode":2}]}' }));
            gamesocket.dispatchEvent(new MessageEvent('message', { data: `{"key":38,"data":[1,{"msg":"${getStatus()}","type": 3}]}` }));
        }
        else {
            gamesocket.dispatchEvent(new MessageEvent('message', { data: '{"key":38,"data":[3,{"mode":1}]}' }));
            gamesocket.dispatchEvent(new MessageEvent('message', { data: `{"key":38,"data":[1,{"msg":"${getStatus()}","type": 3}]}` }));
        }

    }
});