Script Summary: Bank Function
Version: 1.0.3.0
Copyright: 2009, w35l3y (http://gm.wesley.eti.br/includes)
License: GNU GPL

This script was discontinued!
New version : http://userscripts.org/scripts/show/56533
FOR SCRIPTERS/PROGRAMMERS only
If you are neither scripter nor programmer, you're discouraged to install this script directly.But if you are and intend to use this script, please advice your users to install Mason (Firefox plugin) and follow the steps below (BEFORE INSTALLING section).
At time this is not required, but it may be in near future so it's highly recommended users to install Mason.
BEFORE INSTALLING (not required but highly recommended)
- Make sure to install Mason (Firefox plugin) first
- Once installed, right-click on Mason icon in statusbar or go to menu Tools > Mason Option...
- Click "Add..."
- Add:
Description : The National Neopian Bank : Bank.process URL : ^http:\/\/www\.neopets\.com\/process_bank\.phtml Content-Type : (leave it blank) Function : referrer to specified site Config... : http://www.neopets.com/bank.phtml (click "Config..." button to type the value above)
- Click OK
- Make sure to have the new option Activated
- Click OK again
- Then you may install the script
Implementing
// @require http://userscripts.org/scripts/source/54389.user.js // @require http://userscripts.org/scripts/source/53965.user.js // @require http://userscripts.org/scripts/source/54156.user.js
Examples
Bank.collect(function(e, has_error, error_node)
{
if (!has_error)
alert('Interest collected!');
else if (error_node)
alert(error_node.textContent);
else
alert('Apparently you are not logged in.');
});Bank.withdraw(1000, null, function(e, has_error, error_node)
{
if (!has_error || error_node)
{
var hand = (e.responseXML.evaluate("string(id('header')//td/a[contains(@href,'?type=inventory')]/text())", e.responseXML, null, XPathResult.STRING_TYPE, null).stringValue||"unknown error").replace(/[,.]/g,'');
alert(error_node && error_node.textContent || "NPs on hand: " + hand);
}
else
alert('Apparently you are not logged in.');
}); // amount, pin number, callbackBank.deposit(1000); // you don't need to define a callback function to any these functions



