-
// ==UserScript==
-
// @name Everfree Outpost Chat Extensions
-
// @description Adds extra chat functionalities to Everfree Outpost.
-
// @author "Thorn Rose", "Green", "Script Anon"
-
// @version 0.2.0
-
// @namespace everfree-outpost
-
// @match *://play.everfree-outpost.com/*
-
// @grant GM_addStyle
-
// @connect play.everfree-outpost.com
-
// @run-at document-start
-
// ==/UserScript==
-
-
-
window.localStorage.setItem("framerate_cap",12);
-
window.localStorage.setItem("scale_ui",2);
-
window.localStorage.setItem("scale_world",1);
-
var my_name="" //Your name on EO so it won't notify your own messages, it can be changed.
-
var audio = new Audio("https://notificationsounds.com/storage/sounds/file-sounds-1148-juntos.mp3"); //The sound it will play, it can be changed
-
//-----------------------------
-
-
var GREEN="#306030";
-
var PURPLE="#8844CC";
-
var BLUE="#303090";
-
var LIGHTBLUE="#306090";
-
var RED="#903030";
-
var DARKCYAN="#2D5B60";
-
var userMap = { //Change these to actual names and other colors
-
"A": GREEN,
-
"B": GREEN,
-
"C": "#0047AB",
-
"D": LIGHTBLUE,
-
"Z": "#903060",
-
"E": PURPLE,
-
"F": PURPLE,
-
"G": "#686772",
-
"H": "#96663B",
-
"I": "#606090",
-
"J": "#609030",
-
"K": DARKCYAN,
-
"L": RED,
-
"M": "#FFE085",
-
"N": "#FDBFFF",
-
"O": RED,
-
"P": BLUE,
-
"Q": LIGHTBLUE
-
};
-
-
var unreadMessages = 0;
-
-
waitForKeyElements("div.chat-line", modifyChatLine);
-
var original_title = document.title; //Do not change
-
var blink_interval;
-
var is_blinking=false; //Do not change
-
$(document).mousemove(function(event) {
-
stop_blinking();
-
});
-
-
window.onfocus = function() {
-
unreadMessages = 0;
-
stop_blinking();
-
}
-
-
function stop_blinking() {
-
document.title = original_title;
-
clearInterval(blink_interval)
-
is_blinking = false;
-
}
-
-
function blink_title(message) {
-
if (document.title===message) {
-
document.title=original_title;
-
} else {
-
document.title=message;
-
}
-
}
-
-
function formatDate(date) {
-
var hours = date.getHours();
-
var minutes = date.getMinutes();
-
var ampm = hours >= 12 ? 'PM' : 'AM';
-
hours = hours % 12;
-
hours = hours ? hours : 12; // the hour '0' should be '12'
-
minutes = minutes < 10 ? '0'+minutes : minutes;
-
var strTime = hours + ':' + minutes + ' ' + ampm;
-
return strTime;
-
}
-
-
-
function modifyChatLine (jNode) {
-
stop_blinking();
-
unreadMessages += 1;
-
var user = jNode.children(".chat-name");
-
var text = jNode.children(".chat-text");
-
lastLine = text;
-
-
var username = user.text().substr(1, user.text().length - 2);
-
var chat = document.getElementsByClassName("chat")[1];
-
-
user.text(`[${formatDate(new Date)}] ${user.text()}`)
-
if (my_name !== username && username !== "*") {
-
audio.play();
-
if (!is_blinking && !document.hasFocus()) { //Title blinks only if it is not currently blinking or if the user is not on EO tab
-
blink_interval = setInterval(function(){blink_title(`${unreadMessages} New message!`);},1000)
-
is_blinking=true
-
}
-
}
-
-
if (username in userMap) {
-
user.css("color", userMap[username]);
-
user.css("font-weight", "bold");
-
user.css("text-shadow", "0px 0px 6px #fff");
-
}
-
-
chat.scrollTop = chat.scrollHeight;
-
}
by Guest
by Guest
by Guest
by Guest
by Guest