Greasy Fork

OpenBerryFeeder

Press \ to open the Berry Feeder with Pokémon & eggs from the current page

目前为 2022-11-08 提交的版本。查看 最新版本

// ==UserScript==
// @name        OpenBerryFeeder
// @author      QtheConqueror
// @namespace   Automation
// @description Press \ to open the Berry Feeder with Pokémon & eggs from the current page
// @version     1.1
// @include     http://gpx.plus/users/*
// @include     https://gpx.plus/users/*
// @grant       none
// @license     GPL-3.0-or-later
// ==/UserScript==

var hasTriggered = false;
document.addEventListener('keydown', function(e) {
    if (e.type == 'keydown') {
        var char = e.key
        if ((char == '\\' || char == '|') && !hasTriggered) {
            hasTriggered = !hasTriggered;
            window.eval('var fnames = []; var links = document.querySelectorAll("a.pIcons:not(.transparent)"); links.forEach(link => {fnames.push(link.dataset["fname"]);}); berryFeeder(fnames, "users", "the Users List", false);');
        }
    }
});