Greasy Fork is available in English.

Prediction Toggle

Toggles net_predict_movement

// ==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 = '';
            }
        }
    });
})();