// ==UserScript==
// @name Get All Colors in game
// @namespace http://tampermonkey.net/
// @version 0.0.1
// @description console logs all colors in the game
// @author r!PsAw
// @match https://diep.io/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=diep.io
// @grant none
// @license MIT
// ==/UserScript==
let ui_color_range = {
min: 1,
max: 7
}
let net_color_range = {
min: 0,
max: 27
}
function get_style_color(property){
return getComputedStyle(document.documentElement).getPropertyValue(property).trim();
}
//single use
//let diep_user_colors = update_your_colors();
//loop
let diep_user_colors;
setInterval( () => {
if(input && window.lobby_ip){
diep_user_colors = update_your_colors();
console.log("updated colors:");
console.log(diep_user_colors);
}
}, 500);
function get_hex(convar){
let diep_hex = input.get_convar(convar);
let normal_hex = "#"+diep_hex.split("x")[1];
return normal_hex;
}
function get_hidden(type, number){
type === "UI"?(ui_color_range.min <= number && number <= ui_color_range.max)?null:console.log("illegal Number!"):type === "NET"?(net_color_range.min <= number && number <= net_color_range.max)?null:("illegal Number!"):console.log("illegal Type!");
switch (type){
case "UI":
return get_style_color(`--uicolor${number}`);
break
case "NET":
return get_style_color(`--netcolor${number}`);
break
}
}
function update_your_colors(){
let temp_container = {
background: get_hex("ren_background_color"),
bar_background: get_hex("ren_bar_background_color"),
border: get_hex("ren_border_color"),
grid: get_hex("ren_grid_color"),
healthbar_back: get_hex("ren_health_background_color"),
healthbar_front: get_hex("ren_health_fill_color"),
minimap: get_hex("ren_minimap_background_color"),
minimap_border: get_hex("ren_minimap_border_color"),
scorebar: get_hex("ren_score_bar_fill_color"),
solid_border: get_hex("ren_stroke_solid_color"),
xp_bar: get_hex("ren_xp_bar_fill_color"),
ui1: get_hidden("UI", 1),
ui2: get_hidden("UI", 2),
ui3: get_hidden("UI", 3),
ui4: get_hidden("UI", 4),
ui5: get_hidden("UI", 5),
ui6: get_hidden("UI", 6),
ui7: get_hidden("UI", 7),
smasher_and_dominator: get_hidden("NET", 0),
barrels: get_hidden("NET", 1),
body: get_hidden("NET", 2),
blue_team: get_hidden("NET", 3),
red_team: get_hidden("NET", 4),
purple_team: get_hidden("NET", 5),
green_team: get_hidden("NET", 6),
shiny_shapes: get_hidden("NET", 7),
square: get_hidden("NET", 8),
triangle: get_hidden("NET", 9),
pentagon: get_hidden("NET", 10),
crashers: get_hidden("NET", 11),
arena_closers_neutral_dominators: get_hidden("NET", 12),
scoreboard_ffa_etc: get_hidden("NET", 13),
maze_walls: get_hidden("NET", 14),
others_ffa: get_hidden("NET", 15),
necromancer_squares: get_hidden("NET", 16),
fallen_bosses: get_hidden("NET", 17)
}
return temp_container;
};