Includes : Neopets : Safety Deposit Box

By w35l3y Last update Dec 10, 2009 — Installed 4,947 times.


Script Summary: SDB Function

Version: 1.0.0.4

Copyright: 2009+, w35l3y (http://gm.wesley.eti.br)

License: GNU GPL

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)

  1. Make sure to install Mason (Firefox plugin) first
  2. Once installed, right-click on Mason icon in statusbar or go to menu Tools > Mason Option...
  3. Click "Add..."
  4. Add:
    Description :	Neopets : Safety Deposit Box : SDB.remove
    URL :		^http:\/\/www\.neopets\.com\/process_safetydeposit\.phtml\?checksub=scan
    Function :	referrer to specified site
    Config... :	http://www.neopets.com/safetydeposit.phtml
    		(click "Config..." button to type the value above)
    Description :	Neopets : Safety Deposit Box : SDB.list
    URL :		^http:\/\/www\.neopets\.com\/safetydeposit\.phtml
    Function :	referrer to specified site
    Config... :	http://www.neopets.com/safetydeposit.phtml
    		(click "Config..." button to type the value above)
  5. Click OK
  6. Make sure to have the new option Activated
  7. Click OK again
  8. Then you may install the script

Implementing

// @require        http://userscripts.org/scripts/source/56489.user.js
// @require        http://userscripts.org/scripts/source/56528.user.js

Examples

// Removes your codestones from SDB
SDB.list({
	"category":2,
	"onsuccess":function(params)
	{
		var items = [];
		for ( var ai = 0 , at = params.list.length ; ai < at ; ++ai )
		{
			var item = params.list[ai];
			items.push([item.Id,item.Quantity,item.Name]);
		}
		alert("[Codestones]\n" + items.join("\n"));

		if (items.length)
		setTimeout(SDB.remove, 1000, {
			"category":2,
			"items":items,
			"onsuccess":function(params)
			{
				alert("Remaining codestones on SDB: " + params.list.length);
			}
		});
	}
});