Get All Colors in game

console logs all colors in the game

  1. // ==UserScript==
  2. // @name Get All Colors in game
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.0.1
  5. // @description console logs all colors in the game
  6. // @author r!PsAw
  7. // @match https://diep.io/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=diep.io
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. let ui_color_range = {
  14. min: 1,
  15. max: 7
  16. }
  17.  
  18. let net_color_range = {
  19. min: 0,
  20. max: 27
  21. }
  22.  
  23. function get_style_color(property){
  24. return getComputedStyle(document.documentElement).getPropertyValue(property).trim();
  25. }
  26.  
  27. //single use
  28. //let diep_user_colors = update_your_colors();
  29. //loop
  30. let diep_user_colors;
  31. setInterval( () => {
  32. if(input && window.lobby_ip){
  33. diep_user_colors = update_your_colors();
  34. console.log("updated colors:");
  35. console.log(diep_user_colors);
  36. }
  37. }, 500);
  38.  
  39. function get_hex(convar){
  40. let diep_hex = input.get_convar(convar);
  41. let normal_hex = "#"+diep_hex.split("x")[1];
  42. return normal_hex;
  43. }
  44.  
  45. function get_hidden(type, number){
  46. 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!");
  47. switch (type){
  48. case "UI":
  49. return get_style_color(`--uicolor${number}`);
  50. break
  51. case "NET":
  52. return get_style_color(`--netcolor${number}`);
  53. break
  54. }
  55. }
  56.  
  57. function update_your_colors(){
  58. let temp_container = {
  59. background: get_hex("ren_background_color"),
  60. bar_background: get_hex("ren_bar_background_color"),
  61. border: get_hex("ren_border_color"),
  62. grid: get_hex("ren_grid_color"),
  63. healthbar_back: get_hex("ren_health_background_color"),
  64. healthbar_front: get_hex("ren_health_fill_color"),
  65. minimap: get_hex("ren_minimap_background_color"),
  66. minimap_border: get_hex("ren_minimap_border_color"),
  67. scorebar: get_hex("ren_score_bar_fill_color"),
  68. solid_border: get_hex("ren_stroke_solid_color"),
  69. xp_bar: get_hex("ren_xp_bar_fill_color"),
  70. ui1: get_hidden("UI", 1),
  71. ui2: get_hidden("UI", 2),
  72. ui3: get_hidden("UI", 3),
  73. ui4: get_hidden("UI", 4),
  74. ui5: get_hidden("UI", 5),
  75. ui6: get_hidden("UI", 6),
  76. ui7: get_hidden("UI", 7),
  77. smasher_and_dominator: get_hidden("NET", 0),
  78. barrels: get_hidden("NET", 1),
  79. body: get_hidden("NET", 2),
  80. blue_team: get_hidden("NET", 3),
  81. red_team: get_hidden("NET", 4),
  82. purple_team: get_hidden("NET", 5),
  83. green_team: get_hidden("NET", 6),
  84. shiny_shapes: get_hidden("NET", 7),
  85. square: get_hidden("NET", 8),
  86. triangle: get_hidden("NET", 9),
  87. pentagon: get_hidden("NET", 10),
  88. crashers: get_hidden("NET", 11),
  89. arena_closers_neutral_dominators: get_hidden("NET", 12),
  90. scoreboard_ffa_etc: get_hidden("NET", 13),
  91. maze_walls: get_hidden("NET", 14),
  92. others_ffa: get_hidden("NET", 15),
  93. necromancer_squares: get_hidden("NET", 16),
  94. fallen_bosses: get_hidden("NET", 17)
  95. }
  96. return temp_container;
  97. };