Vend buys

best

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name           Vend buys
// @namespace      Test
// @include        http://www.gaiaonline.com/marketplace/userstore/*/buy/?id=*
// @description best
// @version 0.0.1.20140712003910
// ==/UserScript==
var a,b;
function badsubmit()
{
alert("The price is too high.");
return false;
}
a=document.getElementById('transactionWindowInfoTopLeft');
var avgprice=a.innerHTML.match(/ [0-9.,]+(?=g)/)+'';
avgprice=avgprice.replace(',','')+'';
avgprice=avgprice.match(/[0-9.]+/);
var strprice=a.innerHTML.match(/[0-9.,]+(?=g)/)+'';
strprice=strprice.replace(',','')+'';
strprice=strprice.match(/[0-9.]+/);
if (strprice-0==avgprice-0) strprice=0;
a=document.getElementById('transactionWindowInfoTopRight');
var curprice=a.innerHTML.match(/[(][0-9.,]+(?=g)/);
if (!curprice) curprice=a.innerHTML.match(/ [0-9.,]+(?=g)/)+'';
curprice=(curprice+'').replace(',','')+'';
curprice=curprice.match(/[0-9.]+/);
a=document.forms.namedItem('buyform');
if (strprice && curprice-strprice>0) a.innerHTML='<center><font color="red"><b>You can buy it cheaper in a store!</font></center>';
else if ((avgprice<100 && curprice>avgprice*2)||(avgprice>100 && curprice>avgprice*1.2)) a.innerHTML='<center><font color="red"><b>The price is too high!</font></center>';
else
{
}