Script Summary: Inventory Function
Version: 1.0.2.0
Copyright: 2009, w35l3y (http://gm.wesley.eti.br/includes)
License: GNU GPL
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)
- 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 : 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)
- 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/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"));
});


