TEXT   76   0
   384 3.29 KB    117

EO chat userscript

By Guest
Created: 2022-10-31 20:48:40
Expiry: Never

  1. // ==UserScript==
  2. // @name Everfree Outpost Chat Extensions
  3. // @description Adds extra chat functionalities to Everfree Outpost.
  4. // @author "Thorn Rose", "Green", "Script Anon"
  5. // @version 0.2.0
  6. // @namespace everfree-outpost
  7. // @match *://play.everfree-outpost.com/*
  8. // @grant GM_addStyle
  9. // @connect play.everfree-outpost.com
  10. // @run-at document-start
  11. // ==/UserScript==
  12.  
  13.  
  14. window.localStorage.setItem("framerate_cap",12);
  15. window.localStorage.setItem("scale_ui",2);
  16. window.localStorage.setItem("scale_world",1);
  17. var my_name="" //Your name on EO so it won't notify your own messages, it can be changed.
  18. var audio = new Audio("https://notificationsounds.com/storage/sounds/file-sounds-1148-juntos.mp3"); //The sound it will play, it can be changed
  19. //-----------------------------
  20.  
  21. var GREEN="#306030";
  22. var PURPLE="#8844CC";
  23. var BLUE="#303090";
  24. var LIGHTBLUE="#306090";
  25. var RED="#903030";
  26. var DARKCYAN="#2D5B60";
  27. var userMap = { //Change these to actual names and other colors
  28. "A": GREEN,
  29. "B": GREEN,
  30. "C": "#0047AB",
  31. "D": LIGHTBLUE,
  32. "Z": "#903060",
  33. "E": PURPLE,
  34. "F": PURPLE,
  35. "G": "#686772",
  36. "H": "#96663B",
  37. "I": "#606090",
  38. "J": "#609030",
  39. "K": DARKCYAN,
  40. "L": RED,
  41. "M": "#FFE085",
  42. "N": "#FDBFFF",
  43. "O": RED,
  44. "P": BLUE,
  45. "Q": LIGHTBLUE
  46. };
  47.  
  48. var unreadMessages = 0;
  49.  
  50. waitForKeyElements("div.chat-line", modifyChatLine);
  51. var original_title = document.title; //Do not change
  52. var blink_interval;
  53. var is_blinking=false; //Do not change
  54. $(document).mousemove(function(event) {
  55. stop_blinking();
  56. });
  57.  
  58. window.onfocus = function() {
  59. unreadMessages = 0;
  60. stop_blinking();
  61. }
  62.  
  63. function stop_blinking() {
  64. document.title = original_title;
  65. clearInterval(blink_interval)
  66. is_blinking = false;
  67. }
  68.  
  69. function blink_title(message) {
  70. if (document.title===message) {
  71. document.title=original_title;
  72. } else {
  73. document.title=message;
  74. }
  75. }
  76.  
  77. function formatDate(date) {
  78. var hours = date.getHours();
  79. var minutes = date.getMinutes();
  80. var ampm = hours >= 12 ? 'PM' : 'AM';
  81. hours = hours % 12;
  82. hours = hours ? hours : 12; // the hour '0' should be '12'
  83. minutes = minutes < 10 ? '0'+minutes : minutes;
  84. var strTime = hours + ':' + minutes + ' ' + ampm;
  85. return strTime;
  86. }
  87.  
  88.  
  89. function modifyChatLine (jNode) {
  90. stop_blinking();
  91. unreadMessages += 1;
  92. var user = jNode.children(".chat-name");
  93. var text = jNode.children(".chat-text");
  94. lastLine = text;
  95.  
  96. var username = user.text().substr(1, user.text().length - 2);
  97. var chat = document.getElementsByClassName("chat")[1];
  98.  
  99. user.text(`[${formatDate(new Date)}] ${user.text()}`)
  100. if (my_name !== username && username !== "*") {
  101. audio.play();
  102. if (!is_blinking && !document.hasFocus()) { //Title blinks only if it is not currently blinking or if the user is not on EO tab
  103. blink_interval = setInterval(function(){blink_title(`${unreadMessages} New message!`);},1000)
  104. is_blinking=true
  105. }
  106. }
  107.  
  108. if (username in userMap) {
  109. user.css("color", userMap[username]);
  110. user.css("font-weight", "bold");
  111. user.css("text-shadow", "0px 0px 6px #fff");
  112. }
  113.  
  114. chat.scrollTop = chat.scrollHeight;
  115. }

Yandere Thread - Yandere Applejack (completed)

by Guest

Bonding with Nature

by Guest

The Long and Short of It (RGRE)

by Guest

incest relationships piece of the whole pie (lewd) by Frostybox[...]

by Guest

incest thread piece of the (non-canon) pie, limestone's pie by[...]

by Guest