Question..

in
Subscribe to Question.. 2 posts, 2 voices



Codest / ievil Scriptwright
FirefoxWindows

Can this be used to find the lowest available shop wizard price using the SW not the SSW.

E.g.:

Use this script with another to find the lowest price of an item.

 
w35l3y Script's Author
FirefoxWindows

you can use this script to find items.

ordering them by price is up to you

an example of using this script to find the lowest price would be:

function getLowestPrices(item, attempts, callback)
{
	(function recursive(items, e, h, m, item, attempts, callback, list)	// creates an recursive function to keep an search after another
	{
		list.push.apply(list, items);

		if (--attempts < 0)	// done!
		{
			callback(list.sort(function(a, b)
			{
				return ( a.Price == b.Price ? 0 : ( a.Price < b.Price ? -1 : 1 ) );
			}));
		}
		else	// keep searching...
		{
			setTimeout(Wizard.find, 1000, item, recursive, item, attempts, callback, list);
		}
	})([], undefined, false, undefined, item, attempts, callback, []);
}

// and then...
getLowestPrices("plain omelette", 10, function(items)
{
	alert("Lowest price: "+items[0].Price);
});

I haven't tested it but you got the ideia

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel