// ==UserScript==
// @name Gota.io Features by Donut
// @namespace https://www.youtube.com/channel/UCIpCflcKEN9YgaO9qDahpRg
// @version 1.6.5
// @description Hold down S to freeze. Press K to show/hide skins, N to show/hide names, M to show/hide mass, F to show/hide food, H to show/hide chat. For Team Scrimmage players: auto respawn in Team Scrimmage, "Team 2v2" is selected by default, press Enter to queue a match or leave a match that has ended, L to leave a match at any time. You can change the keys if you wish. You can also set custom keys for triple split, show/hide minimap, score panel, party panel, leaderboard, and auto decline party invites.
// @match http://gota.io/web/*
// @author Donut
// @grant none
// @run-at document-end
// @downloadURL none
// ==/UserScript==
(function(){
if (!('code' in KeyboardEvent.prototype)) {
alert("Sorry, your browser is incompatible with Gota.io Features by Donut. You're recommended to install the newest version of Google Chrome or Mozilla Firefox browsers.");
return;
}
function getVersionParts(v, validate = false) {
var parts = v.split('.');
if (validate) for (var i = 0; i < parts.length; i++) if (!/^\d+$/.test(parts[i])) return false;
return parts;
}
function compareVersions(v1, v2) {
var v1parts = getVersionParts(v1), v2parts = getVersionParts(v2);
v1parts = v1parts.map(Number);
v2parts = v2parts.map(Number);
while (v1parts.length < v2parts.length) v1parts.push(0);
while (v2parts.length < v1parts.length) v2parts.push(0);
for (var i = 0; i < v1parts.length; ++i) {
if (v1parts[i] > v2parts[i]) return 1;
else if (v1parts[i] < v2parts[i]) return -1;
}
return 0;
}
var importantUpdates = ['1.5.3', '1.6', '1.6.3'];
importantUpdates.sort(compareVersions);
var version = '1.6.5', storageVersion = localStorage['donut-version'], notify = false;
if (!storageVersion || !getVersionParts(storageVersion, true) || compareVersions(version, storageVersion) == 1 && (importantUpdates.lastIndexOf(version) >= 0 || compareVersions(importantUpdates[importantUpdates.length - 1], storageVersion) == 1)) notify = true;
else localStorage['donut-version'] = version;
var styles = {
'.donut-features-table': {
'margin': 'auto',
'width': 'max-content',
'border-collapse': 'collapse'
},
'.donut-features-table td:nth-child(1)': {
'text-align': 'left'
},
'.donut-features-table th, .donut-features-table td': {
'padding': '2px 8px'
},
'.donut-features-table input[type="text"]': {
'width': '100px',
'text-align': 'center'
},
'.donut-features-div': {
'margin': 'auto',
'padding-top': '4px',
'width': 'max-content'
},
'.donut-checkbox': {
'position': 'relative',
'top': '1px',
'margin': '0 5px'
},
'#donut-scrimmageMode': {
'box-sizing': 'content-box',
'padding': '1px 0',
'width': '104px'
},
'.donut-channel-link': {
'box-sizing': 'border-box',
'display': 'block',
'margin': '3px auto 0',
'padding': '4px 8px 4px 5.5px',
'width': '85px',
'height': '24px',
'color': '#fefefe',
'font-family': 'Arial, Helvetica, sans-serif',
'font-size': '12px',
'line-height': 'normal',
'text-align': 'center',
'text-decoration': 'none',
'background-color': '#e62117',
'border': 'solid 1px transparent',
'border-radius': '2px',
'white-space': 'nowrap',
'vertical-align': 'middle',
'box-shadow': '0 1px 0 rgba(0,0,0,0.05)'
},
'.donut-channel-link::before': {
'content': '""',
'position': 'relative',
'top': '-1px',
'display': 'inline-block',
'margin-right': '6px',
'width': '16px',
'height': '12px',
'background': 'no-repeat url(//s.ytimg.com/yts/imgbin/www-hitchhiker-vfl-Nn88d.png) -721px -88px',
'background-size': 'auto',
'vertical-align': 'middle'
},
'.donut-channel-link>span': {
'display': 'inline-block',
'-moz-box-sizing': 'border-box',
'box-sizing': 'border-box'
},
'.donut-channel-link:hover': {
'background-color': '#cc181e'
},
'.donut-channel-link:active': {
'background-color': '#b31217'
}
};
if (notify) {
styles['.donut-features-btn::before'] = {
'content': '"!"',
'position': 'absolute',
'top': '-6px',
'right': '-6px'
};
styles['.donut-features-btn::before, .donut-updated'] = {
'width': '12px',
'height': '12px',
'color': 'white',
'font-size': '11px',
'font-weight': 'bold',
'text-align': 'center',
'line-height': '12px',
'background-color': 'red',
'border-radius': '50%',
'overflow': 'hidden',
'-webkit-user-select': 'none',
'-moz-user-select': 'none',
'-ms-user-select': 'none',
'user-select': 'none',
'display': 'inline-flex',
'align-items': 'center',
'justify-content': 'center'
};
styles['.donut-updated'] = {
'position': 'relative',
'top': '-1px',
'vertical-align': 'middle'
};
}
var style = document.createElement('style');
document.head.appendChild(style);
var stylesheet = style.sheet;
for (var selector in styles)
for (var property in styles[selector])
stylesheet.insertRule(selector + '{' + property + ':' + styles[selector][property] + ';' + '}', stylesheet.cssRules.length);
var input = document.getElementsByClassName('main-input')[0], bottom = document.getElementsByClassName('main-bottom')[0], stats = document.getElementsByClassName('main-bottom-stats')[0];
input.style.margin = 'auto';
input.style.width = '270px';
bottom.style.position = 'relative';
bottom.style.left = '-7px';
stats.style.width = '100%';
stats.style.height = '140px';
var btnTemplate = document.createElement('button');
btnTemplate.className = 'gota-btn bottom-btn';
btnTemplate.style.marginTop = '12px';
btnTemplate.style.color = 'white';
btnTemplate.style.backgroundColor = 'rgba(23,22,23,.9)';
var btn = btnTemplate.cloneNode();
btn.className += ' donut-features-btn';
btn.style.position = 'relative';
btn.style.left = '2px';
btn.style.padding = '4px 3px 3px';
btn.style.width = '100%';
btn.style.fontSize = '16px';
btn.innerText = 'Features by Donut';
btn.addEventListener('click', function() {
blackout.style.opacity = '0';
blackout.style.display = 'block';
resize();
blackout.style.opacity = '1';
if (notify) {
localStorage['donut-version'] = version;
stylesheet.insertRule('.donut-features-btn::before{content:none;}', stylesheet.cssRules.length);
}
});
document.getElementsByClassName('main-bottom-right')[0].appendChild(btn);
var blackout = document.createElement('div');
blackout.style.position = 'fixed';
blackout.style.top = '0';
blackout.style.right = '0';
blackout.style.bottom = '0';
blackout.style.left = '0';
blackout.style.display = 'none';
blackout.style.background = 'rgba(0,0,0,.5)';
blackout.style.overflow = 'auto';
blackout.style.zIndex = '100';
document.body.appendChild(blackout);
var win = document.createElement('div');
win.style.position = 'absolute';
win.style.top = '50%';
win.style.left = '50%';
win.style.margin = '0';
win.style.padding = '15px';
win.style.color = 'white';
win.style.fontFamily = 'Arial, Helvetica, sans-serif';
win.style.fontSize = '16px';
win.style.lineHeight = '22px';
win.style.textAlign = 'center';
win.style.backgroundColor = 'rgb(14,14,14)';
win.style.border = 'solid 2px rgba(255,255,255,.2)';
win.style.borderRadius = '5px';
win.style.transform = 'translate(-50%, -50%)';
win.innerHTML = `
Feature
Default
Custom key
Freeze
S
Show/hide skins
K
Show/hide names
N
Show/hide mass
M
Show/hide food
F
Show/hide chat
H
Triple split
Show/hide minimap
Show/hide score panel
Show/hide party panel
Show/hide leaderboard
Toggle Decline party invites
Toggle Auto respawn
Team Scrimmage
Queue
Enter
Leave a match
L
You should only use the Leave a match hotkey when playing with random teammates. If you want to disable a hotkey, type Delete.
Team Scrimmage Default:
You can support the developer by checking out his YouTube channel:
YouTube`;
if (notify && storageVersion) {
if (compareVersions(storageVersion, '1.6') < 0) win.innerHTML = `
Now you can use any key of your keyboard as a hotkey, and select your Leave a match hotkey to be used to leave a party in Experimental (disabled by default, scroll down to enable).