Vend buys

best

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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
{
}