// ==UserScript== // @lastmodified 202304031757 // @name 芜湖助手 // @namespace WOOH // @version 0.8.5 // @description 托恩,起飞! // @author Woohoo[2687093] Sabrina_Devil[2696209] // @match https://www.torn.com/* // @downloadURL https://gitlab.com/JJins/wuhu-torn-helper/-/raw/dev/release.min.user.js // @grant GM_xmlhttpRequest // @grant unsafeWindow // @connect ljs-lyt.com // @connect yata.yt // @connect github.io // @connect gitlab.com // @connect staticfile.org // @connect gitee.com // ==/UserScript== !function(){"use strict";function e(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a}function t(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function n(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}const i=Symbol("CLASSNAME_KEY");function o(e){return function(t){return Reflect.defineMetadata(i,e||t.name,t),t}}function r(e){return Reflect.getMetadata(i,e)}const a=Symbol("INJECTABLE_KEY");var s,l;function c(e=s.Singleton){return function(t){return Reflect.defineMetadata(a,e,t),t}}!function(e){e[e.Singleton=1]="Singleton",e[e.Multi=2]="Multi"}(s||(s={}));class d{static set(e,t){this._container.has(e)||this._container.set(e,t)}static get(e){return this._container.get(e)}static factory(e){return function(e){if(!Reflect.getMetadata(a,e))throw new TypeError(`[${r(e)||e.name}] not injectable`)}(e),this.get(e)||this.initParam(e)}static setLogger(e){this.logger=e}static initParam(e){var t;const n=Reflect.getMetadata("design:paramtypes",e);let i=new e(...n?n.map((e=>this.factory(e))):[]);return null===(t=this.logger)||void 0===t||t.info(`[${r(e)||e.name}] 实例化`),this.set(e,i),i}}d._container=new Map;class u{static info(...e){u.counter.info++;let t="%c WH %cIFO%c"+this.getTime()+"%c";this.debug()&&console.log(t,"background:grey;color:white;","","color:grey;","",...e),this.saveLogs(t,...e)}static error(...e){u.counter.error++;let t="%c WH %cERR%c"+this.getTime()+"%c";console.error(t,"background:grey;color:white;","background:red;color:white;","color:grey;","",...e),this.saveLogs(t,...e)}static warn(...e){u.counter.warning++;let t="%c WH %cWRN%c"+this.getTime()+"%c";console.warn(t,"background:grey;color:white;","background:#ff9800;color:white;","color:grey;","",...e),this.saveLogs(t,...e)}static debug(){let e=!0;try{let t=JSON.parse(localStorage.getItem("wh_trans_settings"));t&&(e=t.isDev)}catch(e){this.error("debug错误")}return e}static getTime(){let e=new Date;return`${e.getFullYear()}-${("0"+(e.getMonth()+1)).slice(-2)}-${("0"+e.getDate()).slice(-2)} ${("0"+e.getHours()).slice(-2)}:${("0"+e.getMinutes()).slice(-2)}:${("0"+e.getSeconds()).slice(-2)}.${("00"+e.getMilliseconds()).slice(-3)}`}static getLogs(){return this.logs}static saveLogs(...e){e.forEach((e=>{if("string"==typeof e)this.logs+=e.replaceAll("%c","");else if(null!=e){let t="{}",n=Object.getPrototypeOf(e).constructor.name;try{t=JSON.stringify(e)}catch(e){}this.logs+=` [${n}] [${t}] `,e.message&&(this.logs+="错误信息: "+e.message),e.stack&&(this.logs+="错误堆栈: "+e.stack)}})),this.logs+="\r\n"}static getCounter(){return{info:u.counter.info,error:u.counter.error,warning:u.counter.warning}}}u.logs="",u.counter={info:0,error:0,warning:0};class h{static getLocal(){let e,t=localStorage.getItem("wh_trans_settings")||"{}";try{e=JSON.parse(t)}catch(e){u.error("解析localStorage对象出错",e),localStorage.setItem("wh_trans_settings","{}")}return e||{}}static conditionInterrupt(){let e=document.querySelector("#skip-to-content")||document.querySelector('[href*="#skip-to-content"]')||{innerText:""};if(document.title.toLowerCase().includes("just a moment")||e.innerText.toLowerCase().includes("please validate")||null!==document.querySelector("div.container div.cf .iAmUnderAttack"))throw"芜湖"}}!function(e){e.RAW="raw",e.GM="gm",e.PDA="pda"}(l||(l={}));var p,m=l;!function(e){e.PC="pc",e.MOBILE="mobile",e.TABLET="tablet"}(p||(p={}));var f=p;class g{constructor(){this.startTime=performance.now()}getTimeMs(){return(performance.now()-this.startTime|0)+"ms"}}let y=class{info(...e){return u.info(...e)}warn(...e){return u.warn(...e)}error(...e){return u.error(...e)}debug(){return u.debug()}};y=e([c(),o("Logger")],y);var b=y;let w=class{constructor(e){this.logger=e}ajax(e,t){return new Promise(((n,i)=>{$.ajax({method:t,url:e,success:function(e){n(e)},error:function(e){i(e)}})}))}ajaxFetch(e){let{url:t,referrer:n="/",method:i,body:o=null}=e,r={headers:{"X-Requested-With":"XMLHttpRequest"},referrer:n,method:i};return"POST"===i&&(r.headers["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8",r.body=o),window.fetch(t,r)}fetchText(e,t=null){return new Promise(((n,i)=>window.fetch(e,t).then((e=>e.text())).then((e=>n(e))).catch((e=>{this.logger.error("fetchText出错了",e),i(e)}))))}getProfile(e){return new Promise(((t,n)=>{this.ajaxFetch({url:window.addRFC("https://www.torn.com/profiles.php?step=getProfileData&XID="+e),method:"GET"}).then((e=>{e.json().then((e=>{t(e)})).catch((e=>{this.logger.error("[ProfileHelper] JSON解析错误: ",e.message,"错误堆栈: ",e.stack),n(e)}))})).catch((e=>{this.logger.error("[ProfileHelper] 网络错误: ",e.message,"错误堆栈: ",e.stack),n(e)}))}))}};w=e([o("FetchUtils"),c(),t("design:paramtypes",[b])],w);var v=w;let x=class{constructor(){this.className="MathUtils"}getRandomInt(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}};x=e([o("MathUtils"),c()],x);var k=x;class S{constructor(e,t=!1,n=d.factory(k)){this.label=e,this.checked=t,this.mathUtils=n,this.randomId=n.getRandomInt(100,2e3),this.baseElement=document.createElement("span"),this.baseElement.id="WHSwitch"+this.randomId,this.baseElement.innerHTML=`\n`,this.input=this.baseElement.querySelector("input")}getBase(){return this.baseElement}getInput(){return this.input}getHtml(){return this.baseElement.innerHTML}}let T=class{constructor(){this.permission=window.Notification&&"granted"===window.Notification.permission}push(e,t={}){if(t.sysNotify&&this.permission){let n=document.createElement("p");n.innerHTML=e,new Notification("芜湖助手",{body:u.getTime()+"\r\n"+n.innerText}).addEventListener("click",(()=>{t.sysNotifyClick&&t.sysNotifyClick(),window.focus()}))}}};T=e([o("NotificationUtils"),c(),t("design:paramtypes",[])],T);var C=T;let _=class{constructor(){if(this.isFocus=!1,this.uuid=crypto.randomUUID?crypto.randomUUID():([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))),self!==top)return null;localStorage.setItem("whuuid",this.uuid),document.addEventListener("visibilitychange",(()=>"hidden"!==document.visibilityState&&localStorage.setItem("whuuid",this.uuid))),addEventListener("focus",(()=>this.isFocus=!0)),addEventListener("blur",(()=>this.isFocus=!1))}get(){return!!this.isFocus||(!document.hidden||this.uuid===localStorage.getItem("whuuid"))}};_=e([o("WindowActiveState"),c(),t("design:paramtypes",[])],_);var E,I=_;let M=E=class{constructor(e,t={},n=d.factory(k),i=d.factory(I),o=d.factory(C),r=d.factory(b)){this.mathUtils=n,this.windowActiveState=i,this.notificationUtils=o,this.logger=r,this.notify=null,this.intervalID=-1;let{timeout:a,callback:s,sysNotify:l,force:c}=t;if(!this.windowActiveState.get()||self!==top){if(!c)return this.logger.warn("后台通知已被屏蔽"),null;this.logger.info("强制后台通知")}this.logger.info("通知的容器",E.container),E.container&&document.contains(E.container)||E.initContainer(),this.callback=s||(()=>null),E.create(this,e,a||3),E.totalCounter++,this.logger.info("创建新通知:",this,e),l&&this.notificationUtils.push(e,t)}static create(e,t,n){const i=""+e.mathUtils.getRandomInt(1e3,9999),o=document.createElement("div");o.id=`wh-notify-${i}`,o.classList.add("wh-notify-item"),o.innerHTML='
{{}}
{{}}
监测目标ID玩家的防御状态,找出隐身攻击者
","守望者 (测试中)"),i=document.createElement("p"),o=document.createElement("input"),r=document.createElement("button"),a=document.createElement("button"),s=document.createElement("button"),l=document.createElement("div");l.obj={};let c=document.createElement("div");c.list=[],c.details={};let h=null,p=function(){let e="战斗记录:
'.replace("{{}}",performance.now().toString()),"飞花库存");else{const e=new Z("请稍后 "+U.loading_gif_html(),"飞花库存");let t='| 目的地 - 更新时间 | 库存 | |||
|---|---|---|---|---|
| ${e.show} | ${n/60|0}分${n%60|0}秒前 | `;let r=0;for(o.stocks[e.name].stocks.forEach((n=>{e.stocks[n.name]&&(t+=`${e.stocks[n.name]} (${n.quantity}) | `,r++)}));r<3;)r++,t+="";t+=" | |
主要用途:出院秒飞
点起飞,页面加载完成后会马上飞走
NNB(Natural Nerve Bar)意思是:扣除所有加成后,玩家本身的犯罪条上限,可用于衡量大佬隐藏的犯罪技能等级
一般来说,左侧红色的犯罪条(Nerve Bar/NB)的上限都是包含加成的,如来自帮派、天赋的加成等。额外的加成不会影响玩家的犯罪技能
查看NNB的方法很简单,在Torn主页面的最下方有一栏Perks,NB-Perks=NNB
以下是两种计算NNB的方法:
";e.forEach((e=>{t+=`${e.name}`})),t+="
";let n=new Z(t,"常用链接");n.element.classList.add("wh-link-collection-cont"),n.element.addEventListener("click",(e=>{let t=e.target;"a"!==t.tagName.toLowerCase()&&"span"!==t.tagName.toLowerCase()||n.close()}))}}let Ce=class{constructor(e,t){this.localConfigWrapper=e,this.tornPDAUtils=t}handle(){const e=this.localConfigWrapper.config.priceWatcher,t=JSON.stringify(e),n='输入需要监视的价格,低于该价格发出通知,-1为关闭
注:需要APIKey,当前可用APIKey为
(来自冰蛙)
(来自PDA)
PT
XAN
'.replace("{{}}",localStorage.getItem("APIKey")||"不可用").replace("{{}}",this.tornPDAUtils.isPDA()?this.tornPDAUtils.APIKey:"不可用").replace("{{}}",(e.pt||-1).toString()).replace("{{}}",(e.xan||-1).toString()),i=new Z(n,"价格监视设置");i.getElement().querySelector("button").onclick=()=>{const[n,o]=Array.from(i.getElement().querySelectorAll('input[type="number"]'));e.pt=0|n.value,e.xan=0|o.value,JSON.stringify(e)!==t&&(this.localConfigWrapper.config.priceWatcher=e),i.close()}}};Ce=e([c(),o("ItemPriceWatcherHandler"),t("design:paramtypes",[B,q])],Ce);var $e=Ce;let _e=class{parse(e,t){t=t||500;const n=document.createElement("div");let i=e.split("\n");i.length>t&&(i=i.slice(0,t),i.push("..."));let o,r="";return i.forEach((e=>{if(""===e.trim())return;let t,i=e.split(" ")[0];switch(i){case"#":case"##":case"###":return"li"===r&&(o=null),r="h"+(i.length+1),t=document.createElement(r),t.innerText=e.slice(i.length+1),void n.append(t);case"-":return"li"!==r&&(o=document.createElement("ul"),n.contains(o)||n.append(o)),r="li",t=document.createElement(r),t.innerText=e.slice(2),void o.append(t)}r="p",t=document.createElement(r),t.innerText=e.trim(),n.append(t)})),n}};_e=e([o("MDUtils"),c()],_e);var Ee=_e;class Ie{constructor(...e){this.className="Provider"}static getInstance(...e){if(!this._instance){let t=new g;this._instance=new this(...e);let n=this._instance.getClassName()||this.name;u.info("实例已创建,",n,this._instance,"耗时"+t.getTimeMs()),Ie.pool[n]=this._instance}return this._instance}static getPool(){return{pool:Ie.pool}}getClassName(){return this.className}}Ie.pool={};let Me=class extends Ie{constructor(e){super(),this.mdUtils=e}show(){let e=new Z('更新历史:区间为 1 ~ 60,默认 50
`,"啤酒提醒时间设定"),t=document.createElement("button");t.innerHTML="确定",t.style.float="right",t.addEventListener("click",(()=>{let t=e.element.querySelector("input"),n=0|t.value;n!==this.localConfigWrapper.config._15AlarmTime&&((n<1||n>60)&&(n=50),t.value=n.toString(),this.localConfigWrapper.config._15AlarmTime=n,this.set_time(n),this.is_running()&&this.start(),e.close())})),e.element.appendChild(t)}responseHandler(e,t,n){if(e.includes("shops.php")&&"POST"===(null==n?void 0:n.method)){let e=n.requestBody;e&&e.includes("step=buyShopItem")&&e.includes("ID=180")&&t.json&&t.json.success&&(new A("检测到已成功购买啤酒"),this.skip_today())}}};os=e([o("BuyBeerHelper"),c(),t("design:paramtypes",[B,U,Y,k])],os);var rs=os;let as=class{handle(){new A("计划中")}};as=e([o("UpdateTranslateDict"),c()],as);var ss=as;function ls(){var e;let t=d.factory(B),n=document.createElement("p"),i=document.createElement("input"),o=document.createElement("button"),r=document.createElement("button"),a=document.createElement("button"),s=document.createElement("button"),l=document.createElement("br");n.innerHTML="飞机落地后转跳的页面,关闭功能请置空:",i.placeholder="URL",i.value=null!==(e=t.config.landedRedirect)&&void 0!==e?e:"",i.style.display="block",i.style.textAlign="left",i.style.width="100%",i.style.padding="8px",i.style.margin="8px -8px",o.innerHTML="保存",r.innerHTML="填入公司金库",a.innerHTML="填入帮派金库金库",s.innerHTML="测试链接",o.addEventListener("click",(()=>N.set("landedRedirect",i.value,!0))),r.addEventListener("click",(()=>i.value="https://www.torn.com/companies.php#/option=funds")),a.addEventListener("click",(()=>i.value="https://www.torn.com/factions.php?step=your#/tab=armoury")),s.addEventListener("click",(()=>window.open(i.value))),new Z("","落地转跳").getElement().append(n,i,o,l,r,a,s)}let cs=class{constructor(e){this.commonUtils=e}handle(){let e=u.getCounter(),t=new Z('{{}}信息 {{}}警告 {{}}错误
加载中请稍后${U.loading_gif_html()}
`,n=new Z(t,"小窗快速犯罪").getElement();let i=n.querySelector("p:first-of-type");const o=n.querySelector("#wh-quick-crime-if-container");o.innerHTML=e;const r=document.createElement("div");r.classList.add("wh-translate"),r.innerHTML=hs;let a=n.querySelector("iframe");const s=()=>{const e=a.contentWindow.document,t=a.contentWindow.WHTRANS;i&&i.remove(),a.style.display="block";const n=e.querySelector("h4#skip-to-content").innerText.toLowerCase().includes("validate");void 0===t&&(U.elementReady("#header-root",e).then((e=>e.style.display="none")),U.elementReady("#sidebarroot",e).then((e=>e.style.display="none")),U.elementReady("#chatRoot",e).then((e=>e.style.display="none")),n||(e.body.style.overflow="hidden"),U.elementReady(".content-wrapper",e).then((e=>{e.prepend(r),e.style.margin="0px",e.style.position="absolute",e.style.top="-35px",new MutationObserver(((t,n)=>{n.disconnect(),e.querySelector(".wh-translate")||e.prepend(r),n.observe(e,{childList:!0,subtree:!0})})).observe(e,{childList:!0,subtree:!0})})),U.elementReady("#go-to-top-btn button",e).then((e=>e.style.display="none")))};a.onload=s;let l=0,c=window.setInterval((()=>{if(i=n.querySelector("p:first-of-type"),!i)return clearInterval(c),void(c=void 0);if(l++,l>0&&!i.querySelector("button")){const t=document.createElement("button");t.innerHTML="重新加载",t.onclick=()=>{t.remove(),l=0,o.innerHTML=null,o.innerHTML=e,a=n.querySelector("iframe"),a.onload=s},i.append(t)}}),1e3)}};ps=e([o("IFrameCrimeHandler"),c()],ps);var ms=ps;let fs=class{constructor(e){this.commonUtils=e}show(){let e=new Z("","更多设定"),t=[{domType:"button",domId:"",domText:"清空设置",clickFunc(){new us("将清空所有芜湖助手相关设置并刷新页面,确定?",{callback:()=>{localStorage.removeItem("wh_trv_alarm"),localStorage.removeItem("wh_trans_settings"),localStorage.removeItem("whuuid"),localStorage.removeItem("wh-gs-storage"),localStorage.removeItem("WHTEST"),new A("已清空,刷新页面"),window.location.reload()}})}},{domType:"button",domId:"",domText:"通知权限",clickFunc(){}},{domType:"button",domId:"",domText:"第三方API通信权限",clickFunc(){}},{domType:"button",domId:"",domText:"小窗犯罪",clickFunc(){d.factory(ms).handle()}},{domType:"button",domId:"",domText:"飞贼小助手",tip:"加载从PC端移植的伞佬的油猴版飞贼小助手",clickFunc:()=>{!function(e){let t=d.factory(b);if(e!==m.PDA)if(e!==m.GM)new A("暂不支持");else if("function"!=typeof window.Vue){let e=new A("正在加载依赖");U.COFetch("https://cdn.staticfile.org/vue/2.2.2/vue.min.js").then((n=>{window.eval(n),e.close(),e=new A("已载入依赖"),window.GM_getValue=(e,t=undefined)=>JSON.parse(window.localStorage.getItem("wh-gs-storage")||"{}")[e]||t,window.GM_setValue=(e,t)=>{const n=JSON.parse(window.localStorage.getItem("wh-gs-storage")||"{}");n[e]=t,window.localStorage.setItem("wh-gs-storage",JSON.stringify(n))},U.COFetch(`https://gitee.com/ameto_kasao/tornjs/raw/master/GoldenSnitch.js?${performance.now()}`).then((n=>{window.eval(n),t.debug()&&window.GM_setValue("gsp_showContent",!0),e.close(),e=new A("已载入飞贼助手")})).catch((e=>new A(`PDA API错误。${JSON.stringify(e)}`)))})).catch((e=>new A(JSON.stringify(e))))}else new A("飞贼助手已经加载了");else{let e=document.querySelector("#wh-gs-loader-ifr");if(e)return void new A("飞贼小助手已经加载了");const n=document.createElement("div");n.id="wh-gs-loader",e=document.createElement("iframe"),e.id="wh-gs-loader-ifr",e.src="https://www.torn.com/crimes.php",n.append(e),document.body.append(n),U.addStyle("\n#wh-gs-loader {\nposition:fixed;\ntop:0;\nleft:0;\nz-index:100001;\n}\n");let i=new A("加载中");e.onload=()=>{i.close();const n=e.contentWindow,o=n.document;o.head.innerHTML="",o.body.innerHTML="",i=new A("加载依赖"),U.COFetch("https://cdn.staticfile.org/vue/2.2.2/vue.min.js").then((r=>{i.close(),n.eval(r),n.GM_getValue=(e,t=undefined)=>JSON.parse(n.localStorage.getItem("wh-gs-storage")||"{}")[e]||t,n.GM_setValue=(e,t)=>{const i=JSON.parse(n.localStorage.getItem("wh-gs-storage")||"{}");i[e]=t,n.localStorage.setItem("wh-gs-storage",JSON.stringify(i))},n.GM_xmlhttpRequest=function(e){"post"!==e.method.toLowerCase()&&U.COFetch(e.url).then((t=>{const n={responseText:t};e.onload(n)}))},i=new A("加载飞贼小助手"),U.COFetch(`https://gitee.com/ameto_kasao/tornjs/raw/master/GoldenSnitch.js?${performance.now()}`).then((r=>{n.eval(r.replace("http://222.160.142.50:8154/mugger","https://api.ljs-lyt.com/mugger")),n.GM_setValue("gsp_x",10),n.GM_setValue("gsp_y",10),i.close(),i=new A("飞贼小助手已加载",{timeout:1});const a=o.querySelector("#gsp"),s=()=>{e.style.height=`${a.offsetHeight+10}px`,e.style.width=`${a.offsetWidth+20}px`,a.style.top="10px",a.style.left="10px"};new MutationObserver(s).observe(a,{childList:!0,subtree:!0}),s(),t.debug()&&n.GM_setValue("gsp_showContent",!0)}))}))}}}(this.commonUtils.getScriptEngine())}}];t.forEach((t=>e.element.append(this.commonUtils.elemGenerator(t,e.element))))}};fs=e([o("AdditionalSettingsHandler"),c(),t("design:paramtypes",[U])],fs);var gs=fs;let ys=class{constructor(e){this.localConfigWrapper=e}handle(){let e=new Z('',"自定义CSS"),t=e.element.querySelector("textarea"),n=e.element.querySelector("button");t.value=this.localConfigWrapper.config.CustomCss||"",n.addEventListener("click",(()=>{N.set("CustomCss",t.value||"",!0)}))}};ys=e([o("CustomCssHandler"),c(),t("design:paramtypes",[B])],ys);var bs=ys;let ws=class extends Ie{constructor(e,t,n,i,o,r){super(),this.buyBeerHelper=e,this.commonUtils=t,this.updateTranslateDict=n,this.customCssHandler=i,this.viewLogsHandler=o,this.additionalSettingsHandler=r,this.className="SettingsHandler",this.list=[],this.constructWuhuSettingList()}show(){let e=new g;u.info("构造设置开始");let t=new Z(U.loading_gif_html(),"芜湖助手设置");window.setTimeout((()=>{let n=document.createElement("div");n.classList.add("gSetting"),this.list.forEach((e=>this.commonUtils.elemGenerator(e,n))),n.querySelector("#wh-qua-alarm-check-btn").addEventListener("click",(()=>this.buyBeerHelper.skip_today())),t.getElement().innerHTML="",t.getElement().appendChild(n),window.initializeTooltip&&window.initializeTooltip("#wh-popup-cont","white-tooltip"),u.info("构造设置结束 "+e.getTimeMs())}),0)}constructWuhuSettingList(){let e=new g;u.info("构造设置列表开始");const t=new Date;let n=this.buyBeerHelper,i=this.list;return 11===t.getMonth()&&(i.push({domType:"plain",domId:"",domHTML:"圣诞小镇",tagName:"h4"}),i.push({domType:"checkbox",domId:"wh-xmastown-wt",domText:" 圣诞小镇攻略",dictName:"xmasTownWT",isHide:!0}),i.push({domType:"checkbox",domId:"wh-xmastown-notify",domText:" 圣诞小镇物品提示",dictName:"xmasTownNotify",isHide:!0})),i.push({domType:"plain",domId:"",domHTML:"翻译",tagName:"h4"}),i.push({domType:"checkbox",domId:"wh-trans-enable",domText:" 开启翻译",dictName:"transEnable",isHide:!0}),i.push({domType:"checkbox",domId:"",domText:" 新翻译",dictName:"transNew",tip:"改进后的翻译,更好的性能"}),i.push({domType:"button",domId:"",domText:"更新翻译词库",isTornBtn:!0,clickFunc:()=>this.updateTranslateDict.handle()}),i.push({domType:"checkbox",domId:"",domText:" 收集数据以改进翻译质量",dictName:"CollectPlayerData",tip:"未实现功能当前版本: {{}}
最新版本:
通常电脑浏览器装有油猴等用户脚本扩展时可以使用链接安装(自动更新):点此安装。
这些扩展长这样:

安卓 KIWI 等可以用油猴脚本的浏览器也可以点上面的链接安装👆
Torn PDA app 或 Alook 用户可打开这个网页快捷复制粘贴。
加载脚本然后直接复制粘贴到用户脚本处。
',"如何更新").getElement().querySelector("button").onclick=e=>n(this,void 0,void 0,(function*(){let t=e.target;t.innerHTML="加载中";const n=yield U.COFetch(`https://jjins.github.io/fyfuzhi/release.min.user.js?${performance.now()}`);t.innerHTML="点击复制到剪切板",t.onclick=()=>{const e=document.createElement("textarea");e.innerHTML=n,t.parentElement.append(e),e.focus(),e.select(),document.execCommand("Copy"),e.remove(),t.innerHTML="已复制",t.onclick=null,new A("脚本已复制,请前往粘贴")}}))},e.querySelectorAll("#wh-trans-fest-date button").forEach(((e,t)=>0===t?e.addEventListener("click",(()=>{let e="| ${1+(0|t.slice(0,2))}月${t.slice(2)}日 | ${ne[t].name} | ${ne[t].eff} |
| ${t.name} | ${t.start[0]+1}月${t.start[1]}日${t.start[2]}:00~${t.end[0]+1}月${t.end[1]}日${t.end[2]}:00 |
| ${t.eff} | |
更多信息请关注群聊和公众号
","活动")})):e.addEventListener("click",null))),this.localConfigWrapper.config.SaveIconPosition){let e=this.localConfigWrapper.config.IconPosition,t={x:document.documentElement.offsetWidth,y:document.documentElement.offsetHeight};vs.setPosition(e.x>t.x?.9*t.x|0:e.x,e.y>t.y?.9*t.y|0:e.y)}document.body.append(e),this.logger.info("引入torn自带浮动提示"),window.initializeTooltip&&window.initializeTooltip(".wh-container","white-tooltip"),this.logger.info("加载torn mini profile");let o={id:window.setInterval((()=>{o.counter++,(window.$||window.unsafeWindow&&window.unsafeWindow.$)&&(!function(e){let t={timeout:0,clickable:!1,rootElement:null,targetElement:null,rootId:"profile-mini-root",rootSelector:"#profile-mini-root",userNameSelector:"a[href*='profiles.php?XID=']",contentWrapper:e,setClickable:function(e){this.clickable=e},setRootElement:function(){document.getElementById(this.rootId)?(window.ReactDOM.unmountComponentAtNode($(this.rootSelector).get(0)),this.rootElement=document.getElementById(this.rootId)):(this.rootElement=document.createElement("div"),this.rootElement.classList.add(this.rootId),this.rootElement.id=this.rootId,$("body").append(this.rootElement))},subscribeForHideListeners:function(){const e=this;let t=$(window).width();function n(n){let i=$(this);i.width()!==t&&(t=i.width(),o.call(e,n))}function i(t){document.activeElement.classList.contains("send-cash-input")||o.call(e,t)}function o(t){if(0===$(t.target).closest(this.rootSelector).length||["resize","scroll"].includes(t.type)){e.targetElement=null;let t=$(this.userNameSelector);window.ReactDOM.unmountComponentAtNode($(this.rootSelector).get(0)),t.off("click",this.handleUserNameClick),t.unbind("contextmenu"),$(document).off("click",o);let r=$(window);r.off("hashchange",o),r.off("resize",n),r.off("scroll",i)}}let r=$(window);$(document).on("click",o.bind(this)),r.on("hashchange",o.bind(this)),r.on("resize",n),e.targetElement.closest("#chatRoot")&&r.on("scroll",i)},subscribeForUserNameClick:function(){$(this.userNameSelector).click(this.handleUserNameClick.bind(this))},handleUserNameClick:function(){if(!this.clickable)return this.setClickable(!0),!1},subscribeForContextMenu:function(e){$(e).on("contextmenu",(function(e){return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!1}))},handleMouseDown:function(){const e=this;$(this.contentWrapper).on("mousedown touchstart",this.userNameSelector,(function(t){return(1===t.which||"touchstart"===t.type)&&(e.targetElement=t.currentTarget,e.subscribeForContextMenu(e.targetElement),e.handleFocusLost(t.currentTarget),e.timeout=window.setTimeout((function(){"touchstart"!==t.type?(e.setClickable(!1),e.subscribeForUserNameClick()):$(t.currentTarget).off("touchmove mouseleave"),e.subscribeForHideListeners(),e.setRootElement();const n={userID:t.currentTarget.search.slice("?XID=".length),event:t.originalEvent};window.renderMiniProfile(e.rootElement,n)}),500),"touchstart"===t.type&&void 0)}))},handleMouseUp:function(){const e=this;$(this.contentWrapper).on("mouseup touchend",this.userNameSelector,(function(){e.timeout&&clearTimeout(e.timeout)}))},handleFocusLost:function(e){const t=this;$(e).on("touchmove mouseleave",(function e(){t.timeout&&clearTimeout(t.timeout),$(this).off("touchmove mouseleave",e)}))},init:function(){this.handleMouseDown(),this.handleMouseUp()}};t.init()}("#wh-trans-icon"),window.clearInterval(o.id)),o.counter>30&&window.clearInterval(o.id)}),1e3),counter:0};return this.logger.info("图标加入文档树完成"),this}dragHandler(){let e=!1,t=!1,n={x:0,y:0};return vs.ZhongNode.addEventListener("mousedown",(t=>{if(0===t.button){t.preventDefault(),e=!0;let i=vs.getPosition();n.x=t.x-i.x,n.y=t.y-i.y}})),document.addEventListener("mouseup",(()=>{e=!1,t&&(t=!1,this.localConfigWrapper.config.SaveIconPosition&&(this.localConfigWrapper.config.IconPosition=vs.getPosition()))})),document.addEventListener("mousemove",(i=>{e&&(vs.setPosition(i.x-n.x,i.y-n.y),t=!0)})),this}static getPosition(){return{x:vs.ZhongNode.style.left?parseInt(vs.ZhongNode.style.left.slice(0,-2)):vs.ZhongNode.offsetLeft,y:vs.ZhongNode.style.top?parseInt(vs.ZhongNode.style.top.slice(0,-2)):vs.ZhongNode.offsetTop}}constructMenuList(){this.logger.info("构造菜单列表开始");let e=new g;const t=new Date;let n=this.infoUtils.getPlayerInfo(),i=[];0!==n.userID&&i.push({domType:"plain",domId:"wh-trans-welcome",domHTML:`${n.playername}[${n.userID}]`});let o=": ";{const e=ne,n=(e,t)=>(e<10?`0${e}`:e.toString())+(t<10?`0${t}`:t.toString()),i=n(t.getUTCMonth(),t.getUTCDate());if(e[i])o+=`今天 - ${e[i].name}()`;else{let n=Object.keys(e);n.push(i);const r=n.sort().indexOf(i)+1,a=e[n[r]||n[0]];o+=`${(new Date(r!==n.length?t.getUTCFullYear():t.getUTCFullYear()+1,0|n[r!==n.length?r:0].slice(0,2),0|n[r!==n.length?r:0].slice(2),8).getTime()-t.getTime())/864e5|0}天后 - ${a.name}()`}}i.push({domType:"plain",domId:"wh-trans-fest-date",domHTML:o});let r={onEv:!1,daysLeft:1/0,events:te};return i.events=te,r.events.forEach(((e,n)=>{if(r.onEv)return;const i=t.getFullYear(),o=new Date(i,e.start[0],e.start[1],e.start[2]),a=new Date(i,e.end[0],e.end[1],e.end[2]);if(o点击开打:

❌ 没有权限
点击网页内任意位置以激活闹钟
正在{{}} ✈