Prediction Toggle

Toggles net_predict_movement

目前為 2021-09-24 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Prediction Toggle
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  Toggles net_predict_movement
// @author       Altanis#6362
// @match        https://diep.io/
// @grant        none
// ==/UserScript==
(async function() {
    'use strict';

    var GUI1 = document.createElement("div");
    GUI1.style = `pointer-events: none; position: fixed; top:10px; left:10px; font-family: Ubuntu; color: #FFFFFF; font-style: normal; font-size: 17px;  text-shadow: black 2px 0px, black -2px 0px, black 0px -2px, black 0px 2px, black 2px 2px, black -2px 2px, black 2px -2px, black -2px -2px, black 1px 2px, black -1px 2px, black 1px -2px, black -1px -2px, black 2px 1px, black -2px 1px, black 2px -1px, black -2px -1px;`;
    document.body.appendChild(GUI1);
    GUI1.innerHTML = `<div style='
border: 6px solid transparent
border-image: linear-gradient(to bottom right, #b827fc 0%, #2c90fc 25%, #b8fd33 50%, #fec837 75%, #fd1892 100%);
border-image-slice: 1;
padding: 0px 9px;
opacity:0.9;
align-content: center;'>
<p>
[P]: Disable Prediction
<p>
[Y]: Toggle GUI

<p style="font-size: 10px;">
Script by: Altanis#6362
</p>
</div>`;

    const prediction = {
        enabled: true
    };

    document.addEventListener('keydown', async event => {
        if (event.keyCode == 80 || event.which == 80) {
            prediction['enabled'] = !prediction['enabled'];
            window.input.execute('net_predict_movement ' + prediction['enabled']);

            if (GUI1.innerHTML == '') return;

            GUI1.innerHTML = `<div style='
border: 6px solid transparent
border-image: linear-gradient(to bottom right, #b827fc 0%, #2c90fc 25%, #b8fd33 50%, #fec837 75%, #fd1892 100%);
border-image-slice: 1;
padding: 0px 9px;
opacity:0.9;
align-content: center;'>
<p>
[P]: ${prediction['enabled'] ? 'Disable' : 'Enable'} Prediction
<p>
[Y]: Toggle GUI

<p style="font-size: 10px;">
Script by: Altanis#1261
</p>
</div>`;
        } else if (event.keyCode == 89 || event.which == 89) {
            if (GUI1.innerHTML == false) {
                GUI1.innerHTML = `<div style='
border: 6px solid transparent
border-image: linear-gradient(to bottom right, #b827fc 0%, #2c90fc 25%, #b8fd33 50%, #fec837 75%, #fd1892 100%);
border-image-slice: 1;
padding: 0px 9px;
opacity:0.9;
align-content: center;'>
<p>
[P]: ${prediction['enabled'] ? 'Disable' : 'Enable'} Prediction
<p>
[Y]: Toggle GUI

<p style="font-size: 10px;">
Script by: Altanis#1261
</p>
</div>`;
            } else {
                GUI1.innerHTML = '';
            }
        }
    });
})();