Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Reddit Ban Editor - EFT Subreddit
- // @namespace https://reddit.com
- // @version 2.0
- // @description Tampermonkey script to replace the Reddit ban icon and message on r/EscapefromTarkov
- // @author You
- // @match https://www.reddit.com/r/EscapefromTarkov/*
- // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
- // @grant none
- // @run-at document-start
- // ==/UserScript==
- // Turns my tarkov reddit permanent ban message (i said "autist cheaters", the moderator took it personally) into a countdown for WW3.
- (function(){
- 'use strict';
- function getDaysUntil(dateStr) {
- const now = new Date();
- const target = new Date(dateStr);
- const diffTime = target - now;
- const diffDays = Math.round(diffTime / (1000 * 60 * 60 * 24));
- return diffDays > 0
- ? `${diffDays} day${diffDays !== 1 ? 's' : ''} remaining.`
- : `Welcome to the Rice Fields! ☠`;
- }
- function generateMessage() {
- const trumpDeadline = '2025-09-01T12:00:00';
- const xiPutinSummit = '2025-09-02T00:00:00';
- const amphibiousWindow = '2025-09-15T00:00:00';
- const fullDeploymentDate = '2027-12-31T12:00:00'; // German brigade to Lithuania
- const message1 = `Trump issues Sept 1 deadline to Russia: ${getDaysUntil(trumpDeadline)}`;
- const message2 = `Xi–Putin Beijing summit Sept 2: ${getDaysUntil(xiPutinSummit)}`;
- // Why September 15–19 Is Ideal:
- //
- // It falls just before the new moon (Sept 21) and between spring tide events (Sept 10 and Sept 24), meaning tidal conditions are in a low-to-rising phase, which is favorable for beach approaches.
- //
- // Nighttime during this window offers minimal moonlight (darkest part of lunar cycle), and the seas are predictable with enhanced tidal height variations—a tactical advantage for stealth and beach access.
- //
- // | Date Range | Lunar Phase | Tidal Status | Impact |
- // | ---------- | -------------------------------------------- | --------------------------------- | ------------------------------------------ |
- // | Sept 15–19 | Waxing crescent approaching new moon Sept 21 | Between spring tides (Sept 10–24) | Low-to-rising tides, strong current window |
- // | Sept 21 | New Moon | Maximum spring effect | Darkest night for stealth |
- // | Sept 24 | Post new moon | Spring tide peak | Reaffirming tidal extremes |
- const message3 = `AI says optimal conditions for chinese invasion of Taiwan Sept 15-19: ${getDaysUntil(amphibiousWindow)}`;
- const message4 = `German brigade fully deployed by end of 2027: ${getDaysUntil(fullDeploymentDate)}`;
- return `► ${message1} ► ${message2} ► ${message3} ► ${message4}`;
- }
- function createEmojiIcon(emojiText = '🤠') {
- const emoji = document.createElement('span');
- emoji.textContent = emojiText;
- Object.assign(emoji.style, {
- fontSize: '28px',
- marginRight: '12px',
- lineHeight: '1em',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- height: '100%',
- });
- return emoji;
- }
- function patchBanBanner() {
- const banner = document.querySelector('div[slot="post-banned-banner"]');
- if (!banner) return false;
- let patched = false;
- // Replace icon if not already replaced
- const icon = banner.querySelector('svg[icon-name^="ban"]');
- if (icon) {
- icon.replaceWith(createEmojiIcon());
- patched = true;
- }
- const msg = banner.querySelector('span.flex-auto');
- const newText = generateMessage();
- if (msg && msg.textContent.trim() !== newText) {
- msg.textContent = newText;
- patched = true;
- }
- return patched;
- }
- function observeOnceBannerExists() {
- const tryInterval = setInterval(() => {
- const banner = document.querySelector('div[slot="post-banned-banner"]');
- if (banner) {
- clearInterval(tryInterval);
- patchBanBanner();
- const observer = new MutationObserver(() => {
- try {
- patchBanBanner();
- } catch (e) {
- console.warn('Reddit Ban Editor error:', e);
- }
- });
- observer.observe(document.body, { childList: true, subtree: true });
- }
- }, 250);
- }
- function setupSPAWatches() {
- const originalPushState = history.pushState;
- const originalReplaceState = history.replaceState;
- function triggerPatch() {
- setTimeout(() => {
- observeOnceBannerExists();
- patchBanBanner();
- }, 200);
- }
- history.pushState = function (...args) {
- originalPushState.apply(this, args);
- triggerPatch();
- };
- history.replaceState = function (...args) {
- originalReplaceState.apply(this, args);
- triggerPatch();
- };
- window.addEventListener('popstate', triggerPatch);
- }
- setupSPAWatches();
- observeOnceBannerExists();
- // Periodic update every hour to keep countdown fresh
- setInterval(patchBanBanner, 60 * 60 * 1000);
- })();
Add Comment
Please, Sign In to add comment