🐭️ Mousehunt - Item Quantity Fix

Fixes the "You Own: 0" bug when viewing an item info page.

As of 02.06.2022. See ბოლო ვერსია.

// ==UserScript==
// @name         🐭️ Mousehunt - Item Quantity Fix
// @version      1.0.1
// @description  Fixes the "You Own: 0" bug when viewing an item info page.
// @license      MIT
// @author       bradp
// @namespace    bradp
// @match        https://www.mousehuntgame.com/i.php
// @icon         https://brrad.com/mouse.png
// @grant        none
// ==/UserScript==

/**
 * On load check for the item quantity and url param.
 */
 $(document).ready(function () { // eslint-disable-line no-undef
	const urlParam = 'i.php?id=';

	if (window.location.href.indexOf(urlParam) === -1) {
		return;
	}

	const id = window.location.href.split(urlParam)[1];

	const qty = document.querySelector('.itemView-sidebar-quantity');
	if (! (qty && qty.textContent.indexOf('You Own:') !== -1)) {
		return;
	}

	const itemName = document.querySelector('.itemViewContainer').getAttribute('data-item-type');
	if (!itemName) {
		return;
	}

	hg.views.ItemView.show(itemName);
});
长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

注册一下就行

Rainyun

一年攒够 12 元