Greasy Fork 还支持 简体中文。

GC - Kad Fed Notification

Displays a notification when youve fed a kad

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         GC - Kad Fed Notification
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Displays a notification when youve fed a kad
// @author       Dani (but really mandi)
// @match        https://www.grundos.cafe/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none

// @require      http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// ==/UserScript==

// get the current page since we use this a lot
const CURRENT_PAGE = window.location.pathname;

const THEME2004 = $('img[src*="/04/"]').length > 0 ? true : false;

 let currentUser = THEME2004 ? $('td.tl a[href^="/userlookup/?"]').text() : $('td.tt a[href^="/userlookup/?"]').text();
(function() {

    'use strict';
    // show message at the top of the page if you've already fed a kad
    if ('/games/kadoatery/' == CURRENT_PAGE) {
        let kad = $('p:contains("Thanks, ' + currentUser + '!")');
        if ( kad.length > 0) {
            let kadName = kad.parent().find('b:first-of-type').text();
            kadName = kadName.split(currentUser)[0]
            $('b:contains("The Kadoatery")').parent().parent().prepend(`<div id="alreadyFedKad" style="padding:5px;background-color:pink;"><center>You already fed "${kadName}"</center></div>`);
        }
    }
    // Your code here...
})();