Pet Protector (fixed)

Protects your Neopets by hiding them at the Lab Ray, Rainbow Fountain, etc.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name        Pet Protector (fixed)
// @author      Etryn (fixed by RealisticError)
// @namespace   http://reddit.com/u/Etryn
// @description Protects your Neopets by hiding them at the Lab Ray, Rainbow Fountain, etc.
// @include     http://www.neopets.com/quickref.phtml
// @include     http://www.neopets.com/lab2.phtml
// @include     http://www.neopets.com/pool/
// @include     http://www.neopets.com/iteminfo.phtml?obj_id=*
// @include     http://www.neopets.com/pound/abandon.phtml
// @include     http://www.neopets.com/petpetlab.phtml
// @grant       none
// @version     1.21
// ==/UserScript==

// Modify PETNAME with the names of the pets you want to protect (properly spelled and capitalized!)
var pets = ["PETNAME", "PETNAME", "PETNAME"];

// List of Dangerous Items that can alter pet color/species
var dangerousItems = [
	"Morphing Potion",
	"Magical",
	"Transmogrification Potion",
	"Flask of Rainbow Fountain Water",
	"Mysterious Swirly Potion",
	"8-bit Power-Up Potion",
	"Turnip Tonic",
	"Potato Potion",
	"Kaleideonegg",
	"Witchy Negg",
	"Vortex Negg",
	"Plaid Negg",
	"Vengeful Scroll",
	"One-Use Robotification Zappermajig",
	"Glowing Jelly",
];

// Set hidePet to an empty function
var hidePet = function () {};

// Set hidePet based on web address
if (window.location.pathname.match("lab2")) {
	hidePet = function(index,petName) {
		$('input[value="'+petName+'"]').parent().remove();
        $(".bx-loading").remove();
	};
} else if (window.location.pathname.match("pool")) {
	hidePet = function(index,petName) {
		$('input[value="'+petName+'"]').parent().parent().remove();
	};
} else if (window.location.pathname.match("iteminfo")) {
	var isDangerous = false
	$.each(dangerousItems,function(index,itemName) {
		if($('td:contains("'+itemName+'")').length > 0) {
			isDangerous = true;
		}
	});
	if(isDangerous) {
		hidePet = function(index,petName) {
			$('option[value*="'+petName+'"]').remove();
		};
	}
} else if (window.location.pathname.match("abandon")) {
	hidePet = function(index,petName) {
		$('input[value="'+petName+'"]').parent().parent().remove();
        $(".bx-loading").remove();
	};
} else if (window.location.pathname.match("petpetlab")) {
	hidePet = function(index,petName) {
		$('table table td:contains("'+petName+'")').remove();
	};
} else if (window.location.pathname.match("quickref")) {
	$('a[href*="convert_pet"]').parent().remove();
}

// Hide the pets!
$.each(pets,hidePet);