Prediction Toggle

Toggles net_predict_movement

当前为 2021-09-24 提交的版本,查看 最新版本

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

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

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

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

您需要先安装一款用户脚本管理器扩展,例如 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 = '';
            }
        }
    });
})();