Greasy Fork is available in English.

TagPro Name Changer

By default, it displays VapingDragon's name as VapingPig

Встановити цей скрипт?
Скрипт запропонований Автором

Вам також може сподобатись TagPro RL Chat.

Встановити цей скрипт
  1. // ==UserScript==
  2. // @name TagPro Name Changer
  3. // @description By default, it displays VapingDragon's name as VapingPig
  4. // @author Ko
  5. // @version 1.2
  6. // @include *.koalabeast.com:*
  7. // @include *.jukejuice.com:*
  8. // @include *.newcompte.fr:*
  9. // @include *.koalabeast.com/game
  10. // @include *.jukejuice.com/game
  11. // @include *.newcompte.fr/game
  12. // @supportURL https://www.reddit.com/message/compose/?to=Wilcooo
  13. // @license MIT
  14. // @namespace https://greasyfork.org/users/152992
  15. // ==/UserScript==
  16.  
  17.  
  18. // This option makes sure that only green names are changed
  19. // (change to false to disable)
  20. const onlyAuth = true;
  21.  
  22. // All names that should be changed, and their replacements:
  23. const replacements = {
  24. 'VapingDragon' : 'VapingPig' ,
  25. 'YouCanAddYourOwn' : 'LikeThis' ,
  26. 'AddAsMuchAsYou' : 'like!' ,
  27. 'Ko' : 'Ko the Great',
  28. };
  29.  
  30. tagpro.ready(function() {
  31.  
  32. // We *could* just change the name directly in the player object,
  33. // but that may cause problems if other scripts use that name (like TagPro Analytics)
  34. // Instead I alter the various functions that draw the name on the screen.
  35.  
  36. // There's this function: tagpro.renderer.drawName
  37. // that draws the name next to a ball
  38. // I copied it from the TP source code, and altered it a bit
  39.  
  40. tagpro.renderer.drawName = function( player, forceRedraw=false ) {
  41. if (!player.sprites.name || forceRedraw) {
  42.  
  43. if (player.sprites.name) player.sprites.info.removeChild(player.sprites.name);
  44.  
  45. if (!tagpro.settings.ui.names) return;
  46.  
  47. var color = "#ffffff";
  48. if (player.auth) color = "#BFFF00";
  49.  
  50. var name = player.name;
  51. if (name in replacements) name = replacements[name]; // This is the line I wrote myself
  52.  
  53. player.sprites.name = tagpro.renderer.veryPrettyText(name, color);
  54. player.sprites.info.addChild(player.sprites.name);
  55. }
  56. player.sprites.name.x = 20;
  57. player.sprites.name.y = -21;
  58. player.sprites.name.visible = tagpro.settings.ui.names;
  59. };
  60.  
  61. // This next function draws the name in chat messages:
  62. // nvm that's to much programmatical trouble for this stupid script
  63. // Same for the scoreboard
  64. });