// ==UserScript==
// @name TW-FriendsEvents
// @description Add a button for filtering friends who wants event stuff
// @include http://*.the-west.*/game.php*
// @version 1.4.1
// @nocompat Chrome
// @grant none
// @namespace https://greasyfork.org/users/2196
// @downloadURL none
// ==/UserScript==
(function(e) {
var t = document.createElement("script");
t.type = "application/javascript";
t.textContent = "(" + e + ")();";
document.body.appendChild(t);
t.parentNode.removeChild(t);
})
(function() {
if (/http:\/\/.+\.the-west\..*\/game\.php.*/
.test(window.location.href)) {
FriendsEvents = {
id : "",
interval : 0,
ready : false,
create : function(runId) {
try {
this.id = runId;
WestUi.FriendsBar.friendsBarUi.friendsBar.filterTypes_[runId
.toLowerCase()] = function(player) {
if (player.name === Character.name)
return false;
var ev = Game.sesData[runId];
var lastActivation = WestUi.FriendsBar.friendsBarUi.friendsBar
.getEventActivation(runId,
player.player_id);
var diff = lastActivation
+ parseInt(ev.friendsbar.cooldown, 10)
- new ServerDate().getTime() / 1000;
return (diff < 0);
};
var img = $('');
var here = $('div.toggler-left');
here.before($('