Neopets - Max Till Withdrawal

Sets withdraw value to amount in till and autofills PIN, so all you have to do is hit enter! Credit to diceroll123 for the original inspiration (code for figuring out the amount of NP in your till)

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @author         darknstormy
// @name           Neopets - Max Till Withdrawal
// @version        1.0
// @description    Sets withdraw value to amount in till and autofills PIN, so all you have to do is hit enter! Credit to diceroll123 for the original inspiration (code for figuring out the amount of NP in your till)
//                 Note: this does expose your PIN to anyone using your computer, so please use this judiciously and not on a shared browser/account/device.
//                 The author is not responsible for any security breaches as a result of you typing your PIN in plaintext into a user script that runs in your browser.
// @include        *://*.neopets.com/market.phtml?type=till
// @license        MIT
// @namespace https://greasyfork.org/users/1328929
// ==/UserScript==

// Put your PIN where the #### are
const PIN = "####"

var d = document;

var np = d.body.innerHTML.match(/You currently have <b>([0-9,\,]*) NP<\/b> in your till./)[1];
np = np.replace(/,/g, '');

if(np == 0) return;

$('[name="amount"]').val(np);

if (d.getElementById("pin_field")) {
   d.getElementById("pin_field").value = PIN
}