Includes : Inventory [DISCONTINUED]

By w35l3y Last update Jul 26, 2009 — Installed 60 times.


Script Summary: Inventory Function

Version: 1.0.2.0

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

License: GNU GPL

Thumb

FOR SCRIPTERS/PROGRAMMERS only

If you aren't either scripter or 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 :	Inventory : Inventory.process
      URL :		^http:\/\/www\.neopets\.com\/useobject\.phtml
      Content-Type :	(leave it blank)
      Function :	referrer to specified site
      Config... :	http://www.neopets.com/iteminfo.phtml
      		(click "Config..." button to type the value above)
    • Description :	Inventory : Inventory.process 2
      URL :		^http:\/\/www\.neopets\.com\/process_cash_object\.phtml
      Content-Type :	(leave it blank)
      Function :	referrer to specified site
      Config... :	http://www.neopets.com/iteminfo.phtml
      		(click "Config..." button to type the value above)
    • Description :	Inventory : Inventory.auction
      URL :		^http:\/\/www\.neopets\.com\/add_auction\.phtml
      Content-Type :	(leave it blank)
      Function :	referrer to specified site
      Config... :	http://www.neopets.com/iteminfo.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/54389.user.js
// @require        http://userscripts.org/scripts/source/53965.user.js
// @require        http://userscripts.org/scripts/source/54316.user.js

Examples

// Puts all your items into SDB (one per one)
Inventory.list(function(list)
{
	var items = [];
	var action = 0;
	for ( var ai = 0 , at = list.length ; ai < at ; ++ai )
	{
		var item = list[ai];
		items.push([item.Link,item.Name,item.Image,item.Description,item.Category].join("\n"));
		if ((item.Category & (Inventory.Category.Auctioned|Inventory.Category.Trading)) == 0)
		{
			setTimeout(Inventory.process, ++action * 2500, item, "safetydeposit", function(a,b,c)
			{
				GM_log(a.responseText);
				alert(["Erro? " + b,"Message: " + c].join("\n"));
			});
		}
	}
	alert(items.join("\n\n"));
});