// ==UserScript== // @name 饰品筛选倒余额 比例自定义 支持buff c5game igxe // @namespace http://tampermonkey.net/ // @icon https://store.steampowered.com/favicon.ico // @version 0.22 // @description 饰品筛选倒余额 可视化比例自定义面板 支持buff c5game igxe // @author wsz987 // @match *://buff.163.com/market/?game=* // @match *://buff.163.com/market/goods?goods_id=* // @match *://www.c5game.com/* // @match *://www.igxe.cn/* // @match *://www.igxe.cn/product/* // @require https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js // @require https://cdn.staticfile.org/vue/2.4.2/vue.min.js // @grant GM_getValue // @grant GM_setValue // @grant GM_openInTab // @grant GM_addStyle // @supportURL https://keylol.com/t577669-1-1 // @downloadURL none // ==/UserScript== /*A 上一页 S 居中且过滤 D 下一页 W 居中 E 过滤后全部打开*/ (function() { 'use strict'; const tool_default = ['300','0.7','0.75','3','2']//自定义默认配置 web(); middle() try{ document.onkeydown=function(event){ var e = event || window.event || arguments.callee.caller.arguments[0]; if(e && e.keyCode==83){ middle().then(v.filter()) } if(e && e.keyCode==68){ v.nextpage(); } if(e && e.keyCode==65){ v.prevpage(); } if(e && e.keyCode==87){ middle(); } if(e && e.keyCode==69){ v.filter().then(v.allopen()); } } }catch(e){console.log(e)} $("body").append(`
`); if(GM_getValue("saved")==null) GM_setValue("saved", tool_default) console.log(`配置[${GM_getValue('saved')}]`) var saved_update = GM_getValue("saved") var v=new Vue({ el: '#tools', data:{ count:GM_getValue("saved")[0], idea:GM_getValue("saved")[1], unidea:GM_getValue("saved")[2], timeout:GM_getValue("saved")[3], fortimeout:GM_getValue("saved")[4] }, mounted() { if(location.href.includes('buff.163.com/market/goods?goods_id=')||location.href.includes('www.igxe.cn/product')||location.href.includes('c5game.com/dota/')||location.href.includes('c5game.com/csgo/item')){ console.log(`${this.timeout}s后开始筛选 ${this.fortimeout}次校验`) setTimeout(()=>{ if(this.choice()){ for (var i = 0; i < this.fortimeout; i++) { (i=> { setTimeout(()=>{ console.log(`第 ${i+1}次校验`) this.choice() }, 500 * i); })(i); } } },this.timeout*1000); } }, methods:{ prevpage(){ try{ $(".page-link.prev")[0].click(); }catch(e){ try{ console.log(e) $(".previous")[0].childNodes[0].click(); }catch(e){console.log(e) $(".prev.js-page")[0].click();} } }, nextpage(){ try{ $(".page-link.next")[0].click() try{ setTimeout(this.filter,2000); }catch(e){console.log(e)} }catch(e){ try{ console.log(e) $(".next")[0].childNodes[0].click(); }catch(e){ console.log(e) $(".next.js-page")[0].click(); } } }, tools_reset(){ console.log('数据重置') GM_setValue("saved", null) window.location.reload() }, choice(){ try{ var lsr=eval($(".lsr")[0].innerText), hbr=eval($(".hbr")[0].innerText), Value_1=eval(this.idea), Value_2=eval(this.unidea); //lsr出售价比例 hbr收购价比例 console.log(GM_getValue('saved')[1],GM_getValue('saved')[2]); if(lsr>eval(1)||hbr>eval(1)){window.close()} if(lsr>Value_1){ if(hbr>Value_2){ window.close(); } }else{ if(hbr>Value_2){ window.close(); } } }catch(e){ console.log(e) return true } }, filter(){ return new Promise(resolve => { let n=0 Array.from($(website[1])).filter(x=>{ if(eval(x.innerHTML.replace(/[^0-9]/g, ''))>parseInt(this.count)) return ++n; x.parentNode.parentNode.remove(); }) if(eval(n)==eval(website[3])){ this.nextpage(); } }); }, allopen(){ let i=0,l=$(website[2]) for(i;i