TEXT   98   0
   384 3.29 KB    117

EO chat userscript

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

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

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