// ==UserScript== // @name 冰蛙宝鉴 // @namespace SMTH // @version 3.4.1 // @description 随时随地通过API接口看你想看! // @author bingri[1523812] kaeru[1769499] htys[1545351] mirrorhye[2564936] tobytorn[1617955] Microdust[2587304] // @match https://www.torn.com/* // @grant GM_xmlhttpRequest // @grant GM.xmlHttpRequest // @connect * // @connect tornsmth.website // @require https://cdn.staticfile.org/xlsx/0.17.5/xlsx.min.js // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min.js // @require https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js // @downloadURL none // ==/UserScript== function bingwaMain(){"use strict";if(!window.BINGWA){window.BINGWA=!0,console.log("冰蛙启动");const ue=window.jQuery;var f,b,m,y,o;f=ue,b=window,m=document,o="tornInputMoney",f.fn[o]=function(t){if("string"==typeof t){var e,a=t,n=Array.prototype.slice.call(arguments,1);return this.each(function(){if(!f.data(this,"plugin_"+o)||"function"!=typeof f.data(this,"plugin_"+o)[a])throw new Error("Method "+a+" does not exist on jQuery."+o);e=f.data(this,"plugin_"+o)[a].apply(this,n)}),e!==y?e:this}if("object"==typeof t||!t)return this.each(function(){f.data(this,"plugin_"+o)||f.data(this,"plugin_"+o,new zt(this,t))})};const me=Object.freeze({GM:"gm",PDA:"pda",OTHER:"other"});let e=me.OTHER;"function"==typeof GM_xmlhttpRequest?e=me.GM:"object"==typeof GM&&"function"==typeof GM.xmlHttpRequest?(e=me.GM,window.GM_xmlhttpRequest=GM.xmlHttpRequest):"function"==typeof PDA_httpGet&&(e=me.PDA);const ye=[{name:"foo",title:"阅兵助手",desc:"在部分页面显示阅兵按钮,可以快速获取玩家信息",default:!1},{name:"noAssisting",title:"防打重",desc:"如果已有其他人进入战斗则屏蔽JOIN按钮",default:!1},{name:"mugoo",title:"山贼助手",desc:"在市场列表界面显示用户状态和攻击链接",default:!0},{name:"chatQuickWithdraw",title:"聊天快捷取钱",desc:"聊天频道内显示快捷取钱按钮",default:!1},{name:"travelFilter",title:"飞花过滤",desc:"在海外市场页面屏蔽不重要物品",default:!0},{name:"jailView",title:"监狱助手",desc:"在监狱页面屏蔽分数大于10000的目标,本帮人员置顶高亮显示",default:!0},{name:"crimeView",title:"犯罪助手",desc:"在犯罪界面显示额外信息",default:!1},{name:"stockexchange_show_abbr",title:"股票助手",desc:"在股票交易市场页面的股票名称前显示缩写",default:!0},{name:"gym_show_ratio",title:"健身房助手",desc:"在健身房页面显示推荐的属性比例",default:!0},{name:"common_modify_header_links",title:"顶部快捷入口",desc:"在页面顶部添加一些常用页面的链接",default:!0},{name:"hide_cloud_while_flying",title:"飞行无云",desc:"在飞行界面隐藏飞机和云彩",default:!0},{name:"withdrawal_helper",title:"取钱助手",desc:"右下角聊天people框高亮显示帮派可取钱名单",default:!0},{name:"bigger_screen_on_laptop",title:"laptop大屏",desc:"飞行中使用笔记本电脑时可以全屏显示",default:!0},{name:"taking_off_reminder",title:"起飞吃药提醒",desc:"起飞前根据CD提醒吃药和OC",default:!0},{name:"bounty_parade",title:"悬赏阅兵",desc:"报纸-悬赏页面显示目标BS",default:!1},{name:"nurse_suggestion",title:"护士建议",desc:"智能提醒出院吃药",default:!0},{name:"extra_recent_attacks",title:"更多最近攻击(帮派)",desc:"帮派chain页面显示更多5分钟内攻击记录(减少错过的复仇)",default:!1},{name:"shows_bingwa_icon",title:"显示冰蛙图标",desc:"在侧边栏显示冰蛙图标,可以作为冰蛙的快速入口",default:!0},{name:"wawa_detection_cache",title:"蛙蛙探测缓存",desc:"缓存蛙蛙探测结果30秒",default:!0}];ye.forEach(t=>{var e=Jt("BWM_SETTINGS",t.name);null==e&&Vt("BWM_SETTINGS",t.name,String(t.default)),window[t.name]="true"==Jt("BWM_SETTINGS",t.name)});let u=localStorage.getItem("APIKey");const xe={20465:"SMTH - Phoenix Nirvana",36134:"SMTH - Silver Hand",10741:"SMTH - Trisolary",16335:"SMTH - November Chopin",16424:"SMTH - HoYoverse",9356:"SMTH - Party Animals",27902:"SMTH - Concord",11796:"SMTH - Bright Summit"};var n,a,d,i,t,r,s,l,c,p,h={8836:"Vinerri",2095:"Guerrilla Warfare",11356:"-UGK-",31312:"TORNado",8255:"Scream Silence",26312:"The Avengers",28205:"Invictus",10913:"Unbroken Warriors",8510:"Ara Pacis",5113:"ThugLife",13343:"The Defiant",39756:"Abusement Park",38761:"Shadow Healers",42125:"Octogenarian DirtyBombers",35739:"Kingsmen",14820:"Unbroken Legion",10140:"In Memory of the Fallen",9405:"Lake Of Lerna",30085:"Rampage Total Destruction"};const ve={gray:"#adadad",red:"#ff7373",green:"#8fbc8f",blue:"#65a5d1",purple:"#8d6dd7",yellow:"#f39826",yellowgreen:"#83a000",pink:"#e467b3",salmon:"#F9CDAD",orange:"#FFDEAD"};if(jt(".bw-hidden { display: none !important }"),jt(`.bw-no-select { -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; }`),jt(`.bw-chat-withdraw .bw-chat-withdraw-btn { margin-left: auto; height: fit-content; background-color: #adadad; color: white; cursor: pointer; padding: 2px; }`),jt(`.bw-chat-withdraw.bw-chat-withdraw-amount .bw-chat-withdraw-btn { background-color: #8fbc8f; }`),jt(`.bw-shared-armory { float: right; margin-right: 4px; }`),jt(`.bw-shared-armory::after { content: '公'; background-color: #5d9525; color: white; padding: 4px; border-radius: 4px; }`),Date.prototype.format=function(t){var e,a={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(e in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),a)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?a[e]:("00"+a[e]).substr((""+a[e]).length)));return t},function(){var e=Jt("APICache_companies","last-updated");if(null!=e&&null!=e){var a=new Date;let t=new Date(e);t.setDate(t.getDate()+1),t{var a=parseInt(ue(e).find("div.details").attr("itemid"));if(isNaN(a)||!(0"+a+"")}}}),t.attr("filtered","filtered")}ue("#show_more").length<1&&(ue(".travel-agency-market").after("
点击显示全部
"),ue("#show_more").click(function(){ue(this).parent().remove(),t.removeClass("hide")}))}(),common_modify_header_links&&ce(),setInterval(function(){const t=ue("[class*=chat-box-header__info-btn___]").closest("[class*=chat-box___]");t.each(function(){var t=ue(this).find("[class*=chat-box-header__name___]").text();if(t){const n=ue(this).find("[class*=chat-box-message__timestamp___]").last().text();var e=n.trim().match(/^(\d\d):(\d\d)(\([0-9mhd]*\))?$/);if(e){var a=e[1],e=e[2];const o=new Date;o.setUTCHours(a<=o.getUTCHours()?a:a-24);e=`${a}:${e}:00 - ${o.getUTCDate().toString().padStart(2,0)}/${(o.getUTCMonth()+1).toString().padStart(2,0)}/${o.getUTCFullYear().toString().slice(2)} TCT`;const i=ue(this).find("[class*=chat-box-message__message___]").toArray().slice(-5).map(t=>`[${ue(t).text()}]`);Vt("CHAT_LAST_MESSAGE",t,e+"|||"+i.join(""))}}})},1e3),chatQuickWithdraw&&pe(),setInterval(function(){if(0
`);e=`/loader.php?sid=attack&user2ID=${n}`;ue("#bingwa-mini-profile-attack").html(`
`),Vt("battlestats",n,t.estimate_bs),ue("#bingwa-mini-profile-bs").html(`
${t.estimate_bs_display}
`);let a=parseInt(100*t.life.current/t.life.maximum);100${t.last_action_details}`)})}},500),withdrawal_helper&&he(),hide_cloud_while_flying&&0"+n.toFixed(2)+""+(0<=o?" + ":" - ")+Math.abs(o).toFixed(2)),ue(e).css("color",0<=o?"green":"red"),ue(e).attr("show-value","show-value")})},500),0<=window.location.href.indexOf("shops.php?step=bitsnbobs")&&ue(".buy-flexslider input[name^=buyAmount]").val("100"),0<=window.location.href.indexOf("factions.php?step=your")){class t{constructor(){this.data=null,this.error=null,this.whitelist=new Set,this.load()}async load(){try{var t=await ae("https://bingwa-api.tornsmth.website/faction-loan/data.json"),e=JSON.parse(t),a=e.expire,n=Math.floor((new Date).getTime()/1e3);!a||a li.depositor[user-id=${e}] div.amount [data-value]`).attr("data-value")):0}function x(){var t=JSON.parse(ue("#websocketConnectionData").text());return t.playername+" ["+t.userID+"]"}function v(e,a){const n=g(a);if(void 0===n||isNaN(n))e.text("").append(`${a}$error`);else{let t="$"+n;0!=n&&(t=n.toString().replace(/\d{1,3}(?=(\d{3})+$)/g,function(t){return t+","}).replace(/^[^\$]\S+/,function(t){return"$"+t})),t.includes("-")?e.text("").append(`${a}${t}`):e.text("").append(`${a}${t}`)}}function w(){const o=ue(".money-wrap").children(".give-block"),a="give-money",i="array";function r(){ue(".button-wrap").remove(),t()}function t(){const n=Jt(a,i);var t=function(){let a=`
给自己`;return n.forEach((t,e)=>{a+=(t=t,`${t.button_name}`)}),a+=`+ 全取 x
`,a}();o.before(t),ue("#deposit-add").click(()=>{0'),ue("#deposit-input").tornInputMoney({groupMoneyClass:null}),ue("#deposit-input").focus(),ue("#deposit-input").blur(()=>{var t=ue("#deposit-input").val();let e=n;e.push({button_name:`取${function t(e){return e<0?"-"+t(-e):0==e?"0":e<=1?parseFloat((100*e).toFixed(2))+"%":e<1e3?""+parseInt(e):1e3<=e&&e<1e6?parseFloat((e/1e3).toFixed(2))+"k":1e6<=e&&e<1e9?parseFloat((e/1e6).toFixed(2))+"m":1e9<=e&&e<1e12?parseFloat((e/1e9).toFixed(2))+"b":1e12<=e&&e<1e15?parseFloat((e/1e12).toFixed(2))+"t":1e15<=e?"MAX":"error"}(Lt("$"+t))}`,"button-value":t}),Vt(a,i,e),r()}))}),ue("#deposit-remove").click(()=>{ue("#deposit-remove").hasClass("deposit-removing")?(ue(".deposit-money-btn").css("background-color",ve.blue),ue(".deposit-money-btn").removeClass("deposit-removing"),ue("#deposit-remove").css("background-color",ve.red),ue("#deposit-remove").removeClass("deposit-removing")):(ue(".deposit-money-btn").css("background-color",ve.red),ue(".deposit-money-btn").addClass("deposit-removing"),ue("#deposit-remove").css("background-color",ve.salmon),ue("#deposit-remove").addClass("deposit-removing"))}),ue("#deposit-self").click(()=>{ue("input#money-user").val(x()).addClass("chosen")}),n.forEach((t,e)=>{ue(`#deposit${e}`).click(()=>{if(ue(`#deposit${e}`).hasClass("deposit-removing")){let t=n;return t.splice(e,1),Vt(a,i,t),void r()}o.children(".inputs-wrap").children(".input-money-group").addClass("success").children("input").attr("value",t["button-value"]),o.children(".inputs-wrap").children(".radio-wp").children(".btn-wrap").children(".btn").children().attr("disabled",!1).removeClass("disabled"),o.children(".inputs-wrap").children(".radio-wp").find("#give-money").click()})}),ue("#deposit-all").click(()=>{const e=ue("#money-user").val();if(""===e)alert("全取请先输入玩家ID");else{let t=g(e);var a;t<0&&"string"==typeof e&&!we.error&&we.data&&((a=e.match(/\[(\d+)\]$/))&&(a=a[1],a=we.data[a]||0,t+=a)),0${ue("#money-user").val()}`);var n=g(o);0<=n?(ue("#before-value").css("background-color","var(--default-green-color)").html(`
${Lt(n)}
`),ue("#before-title").css("color","var(--default-green-color)")):(ue("#before-value").css("background-color","var(--default-red-color)").html(`
${Lt(n)}
`),ue("#before-title").css("color","var(--default-red-color)"));e=Bt(ue(".money-wrap").find(".count.input-money").first().val()),n=n-e;0<=n?(ue("#after-value").css("background-color","var(--default-green-color)").html(`
${Lt(n)}
`),ue("#after-title").css("color","var(--default-green-color)")):(ue("#after-value").css("background-color","var(--default-red-color)").html(`
${Lt(n)}
`),ue("#after-title").css("color","var(--default-red-color)"));let t=0<=n;!we.error&&we.data?(e=we.data[a]||0,-n<=e?(t=!0,ue("#loan-value").css("background-color","var(--default-green-color)").html(`
${Lt(e)}
`),ue("#loan-title").css("color","var(--default-green-color)")):(ue("#loan-value").css("background-color","var(--default-red-color)").html(`
${Lt(e)}
`),ue("#loan-title").css("color","var(--default-red-color)"))):we.error?(ue("#loan-value").css("background-color","var(--default-red-color)").html(`
加载失败: ${we.error}
`),ue("#loan-title").css("color","var(--default-red-color)")):(ue("#loan-value").css("background-color","var(--default-blue-color)").html('
正在加载
'),ue("#loan-title").css("color","var(--default-blue-color)")),"checked"!==ue(".money-wrap .give-block .inputs-wrap .radio-wp #give-money").attr("checked")&&(t=!0),we.whitelist.has(a)&&(t=!0),ue(".money-wrap .give-block .action-confirm .btn-wrap button").attr("disabled",!t),t?ue("#bw-check-loan").hide():ue("#bw-check-loan").show().attr("data-uid",a)}}}},1e3);function _(e,a,n){let o=Lt(a);if(0<=a){let t=100*a/n;"准备金率"==e&&(t=Math.min(100*a,100),o=(100*a).toFixed(2)+"%"),ue("#faction_balance_li").append(`
${Zt(22,0,"var(--default-green-color)","var(--default-bg-panel-color)",e)}
${Zt(22,t,"var(--default-green-color)","var(--default-bg-panel-color)",o)}
`)}else{n=100*a/n+100;ue("#faction_balance_li").append(`
${Zt(22,n,"var(--default-bg-panel-color)","var(--default-red-color)",e)}
${Zt(22,0,"var(--default-red-color)","var(--default-bg-panel-color)",o)}
`)}}let e=new MutationObserver(function(t,e){!function(){const t=ue("div#money-user-cont").find("li.ui-custom-item");!ue("input#money-user")||"."!=ue("input#money-user").val()&&" "!=ue("input#money-user").val()||(ue("input#money-user").val(x()).addClass("chosen"),console.log(x()),v(t.children(),x())),0{e=parseInt(ue(e).find("span.money").attr("data-value"));0 `),_("帮派余额",i,r),_("所有存款总和",e,r),_("帮派公共资金",o,r),_("正存款总和",a,r),_("负存款总和",n,r),_("准备金率",parseFloat(i/a),r)}}(),function(){const t=ue(".money-wrap").children(".give-block");0
收款人
取款前余额
取款后余额
贷款额度
`)}(),function(){const t=ue(".money-wrap .give-block .action-confirm");0===t.length||0手工检查贷款'),ue("#bw-check-loan").click(function(){var t=ue(this).attr("data-uid");t&&we.whitelist.add(t)}))}(),ue(".inputs-wrap .radio-wp input").removeAttr("disabled")});e.observe(document.getElementById("faction-controls"),{childList:!0,subtree:!0})}if(jailView&&0<=window.location.href.indexOf("jailview.php")){const _e="bingwa_bust";class t{constructor(t){this.refresh_callback=t;t=Xt(_e);t&&"3.0.5"===t.version?(this.info=t.info,this.conf=t.conf):(this.info={timestamp:0},this.conf={hidden:!1,prob_min:null,prob_max:null,order:"ASC",friend:"PIN",quick_bust:"ON"}),this.refreshInfo()}getBustSkill(){return this.info.level*(1+this.info.faction_perk/100)*(1+this.info.edu_perk/100)}getBustProb(t){let e=this.info.penalty;return this.info.job_perk&&(e/=2),276.536-(.73643*t+5309.59*e)/this.getBustSkill()}save(){Kt(_e,{info:this.info,conf:this.conf,version:"3.0.5"})}refreshInfo(){var t=Math.floor((new Date).getTime()/1e3),e=this.info.error?5:60;t-this.info.timestamp{await this.fetchInfo(),this.save(),this.refresh_callback&&this.refresh_callback()}))}increasePenalty(){"penalty"in this.info&&(this.info.penalty+=1,this.save())}async fetchInfo(){var t=Math.floor((new Date).getTime()/1e3),e=`https://api.torn.com/user/?selections=basic,perks,log&log=5360&to=${t+10}&key=${u}`;const a=await fetch(e);if(a.ok){const n=await a.json();if("error"in n)this.info={timestamp:t,error:n.error.error};else{this.info={timestamp:t},this.info.level=n.level;const o=n.faction_perks.find(t=>t.match(/bust success chance/i));this.info.faction_perk=o?parseInt(o.match(/\d+/)[0]):0,this.info.job_perk=0<=n.job_perks.indexOf("+ Easier to bust more people at once");const i=n.education_perks.find(t=>t.match(/Busting skill/i));this.info.edu_perk=i?parseInt(i.match(/\d+/)[0]):0,this.info.penalty=0;for(const r of Object.values(n.log))t-r.timestamp<=259200&&(this.info.penalty+=1/(1+(t-r.timestamp)/36e3))}}else this.info={timestamp:t,error:a.statusText}}}const ke=new t(I),$e=new MutationObserver(async function(t){let e=!1;for(const a of t)for(const n of a.addedNodes)"LI"===n.tagName?e=function(t){if(ue(t).find("b.bust-score").attr("bust-score"))return!1;var e=(function(t){t=t.find("span.time").text().match(/\d+/g),t=t||[0];return t[1]?60*parseInt(t[0])+parseInt(t[1]):parseInt(t[0])}(ue(t))+180)*function(t){t=t.find("span.level").text().match(/\d+/g);return t?parseInt(t[0]):0}(ue(t));if(0==e)return!1;e=``;return ue(t).find("span.reason").append(e),ue(t).removeClass("gray"),!0}(n)||e:ue(n).text().match(/You busted .* out of jail/i)&&(e=!0,ke.increasePenalty());e&&I()});function k(t){const e=t.find("a.faction").attr("href");return e?e.substring(30):0}function $(){const t=ue("ul.user-info-list-wrap").children("li");t.each(function(){if(0!==ue(this).find("b.bust-score").length){var e=parseFloat(ue(this).find("b.bust-score").attr("bust-prob"));let t=!1;isNaN(e)||(null!==ke.conf.prob_min&&eke.conf.prob_max&&(t=!0));e=k(ue(this))in xe;"PIN"===ke.conf.friend&&e&&(t=!1),t?ue(this).addClass("bw-hidden"):ue(this).removeClass("bw-hidden"),ke.conf.friend&&e?ue(this).css("background-color","rgba(110, 160, 55, 0.15)"):ue(this).css("background-color","");const a=ue(this).children("a.bust");"ON"===ke.conf.quick_bust||"ON_BOTH"===ke.conf.quick_bust?a.attr("href",a.attr("href").replace(/\bstep=breakout\b/,"step=breakout1&")):a.attr("href",a.attr("href").replace(/\bstep=breakout1\b/,"step=breakout"));const n=ue(this).children("a.bye");"ON_BAIL"===ke.conf.quick_bust||"ON_BOTH"===ke.conf.quick_bust?n.attr("href",n.attr("href").replace(/\bstep=buy\b/,"step=buy1&")):n.attr("href",n.attr("href").replace(/\bstep=buy1\b/,"step=buy"))}}),ke.conf.order&&(t.sort(function(t,e){var a=parseInt(ue(t).find("b.bust-score").attr("bust-score")),n=parseInt(ue(e).find("b.bust-score").attr("bust-score")),t=k(ue(t))in xe,e=k(ue(e))in xe;return"PIN"===ke.conf.friend&&t!=e?Number(e)-Number(t):"ASC"===ke.conf.order?a-n:n-a}),t.detach().appendTo("ul.user-info-list-wrap"))}function I(){const n=ke.info,t=ue(".info-msg-cont").first();var e;t.css("background","var(--default-bg-panel-color)"),t.css("font-size","12px"),t.html(`

`),null!==ke.conf.prob_min&&ue("#bust-conf-prob-min").val(ke.conf.prob_min),null!==ke.conf.prob_max&&ue("#bust-conf-prob-max").val(ke.conf.prob_max),ue("#bust-conf-order").val(ke.conf.order),ue("#bust-conf-friend").val(ke.conf.friend),ue("#bust-conf-quick-bust").val(ke.conf.quick_bust),te(ue("#bust-conf-prob-min"),t=>/^\d*$/.test(t)),te(ue("#bust-conf-prob-max"),t=>/^\d*$/.test(t)),ue("#bust-conf input").change(D),ue("#bust-conf select").change(D),"loading"===n.error?ue("#bust-info").html("正在读取 Bust 历史,请稍等。若 5 秒内未出结果,请刷新页面重试。"):"Access level of this key is not high enough"===n.error?ue("#bust-info").html(` 权限不足,无法读取 Bust 惩罚! 请使用 Full Access 类型的 API Key `):n.error?ue("#bust-info").html(`出错啦!${n.error}`):(e=n.job_perk?"惩罚效果减半":"无",ue("#bust-info").html(` Bust 惩罚: ${n.penalty.toFixed(2)} Bust 技能: ${ke.getBustSkill().toFixed(2)} 工作特技: ${e} `),ue("#bust-info").tooltip({tooltipClass:"white-tooltip",content:function(){var t=50===n.faction_perk?"50%":`${n.faction_perk}%`,e=65===n.edu_perk?"65%":`${n.edu_perk}%`;return`个人等级: ${n.level}
帮派加成: ${t}
教育加成: ${e}`}})),ue("#bust-info").append('显示选项'),S(ke.conf.hidden),ue("#bust-info-toggle-conf").click(function(){ke.conf.hidden=!ke.conf.hidden,ke.save(),S(ke.conf.hidden)}),ue("b.bust-score").each(function(){var e=ue(this).attr("bust-score");if(e){let t="t-red";if(n.error)ue(this).text(` ${e}`),ue(this).removeAttr("bust-prob");else{const a=ke.getBustProb(e);t=120<=a?"t-gray-9":100<=a?"t-green":80<=a?"t-yellow":0<=a?"t-red":"t-red bg-red active",ue(this).html(` ${e}  ${a.toFixed(1)}%`),ue(this).attr("bust-prob",a.toFixed(1))}ue(this).attr("class",`bust-score ${t}`)}}),$()}function S(t){t?(ue("#bust-info-toggle-conf").text("显示选项"),ue("#bust-conf").hide()):(ue("#bust-info-toggle-conf").text("隐藏选项"),ue("#bust-conf").show())}function D(){var t=ue("#bust-conf-prob-min").val();ke.conf.prob_min=t?parseInt(t):null;t=ue("#bust-conf-prob-max").val();ke.conf.prob_max=t?parseInt(t):null,ke.conf.order=ue("#bust-conf-order").val(),ke.conf.friend=ue("#bust-conf-friend").val(),ke.conf.quick_bust=ue("#bust-conf-quick-bust").val(),ke.save(),$()}$e.observe(document.getElementsByClassName("userlist-wrapper")[0],{childList:!0,characterData:!0,subtree:!0})}if(crimeView&&0<=window.location.href.indexOf("loader.php?sid=crimes")&&setInterval(function(){window.location.href.endsWith("#/")?function(){if(!(0a&&t<=100&&(a=t,n=this)}),n){const e=ue(n).closest("svg").parent();e.append(`
${a}%
`),e.css("overflow","visible")}}}}():window.location.href.endsWith("#/searchforcash")&&function(){if(!(0n&&(n=t)}}});for(var{$ele:t,prob:e}of i){var a=e===n?"t-green":"t-gray-c";t.after(`${e}%`)}}}()},1e3),gym_show_ratio&&0<=window.location.href.indexOf("gym.php")){const Ie={0:{name:"balanced",description:"平衡比例",str:100,def:100,spd:100,dex:100},1:{name:"hank-str",description:"Hank比例-Str最高",str:100,def:80,spd:28,dex:80},2:{name:"hank-def",description:"Hank比例-Def最高",str:80,def:100,spd:80,dex:28},3:{name:"hank-spd",description:"Hank比例-Spd最高",str:28,def:80,spd:100,dex:80},4:{name:"hank-dex",description:"Hank比例-Dex最高",str:80,def:28,spd:80,dex:100},5:{name:"baldr-str",description:"Baldr比例-Str最高",str:100,def:72,spd:80,dex:72},6:{name:"baldr-def",description:"Baldr比例-Def最高",str:72,def:100,spd:72,dex:80},7:{name:"baldr-spd",description:"Baldr比例-Spd最高",str:80,def:72,spd:100,dex:72},8:{name:"baldr-dex",description:"Baldr比例-Dex最高",str:72,def:80,spd:72,dex:100}},Se={1:{name:"Premier Fitness",stage:1,cost:10,energy:5,strength:20,speed:20,defense:20,dexterity:20,note:""},2:{name:"Average Joes",stage:1,cost:100,energy:5,strength:24,speed:24,defense:27,dexterity:24,note:""},3:{name:"Woody's Workout Club",stage:1,cost:250,energy:5,strength:27,speed:32,defense:30,dexterity:27,note:""},4:{name:"Beach Bods",stage:1,cost:500,energy:5,strength:32,speed:32,defense:32,dexterity:0,note:""},5:{name:"Silver Gym",stage:1,cost:1e3,energy:5,strength:34,speed:36,defense:34,dexterity:32,note:""},6:{name:"Pour Femme",stage:1,cost:2500,energy:5,strength:34,speed:36,defense:36,dexterity:38,note:""},7:{name:"Davies Den",stage:1,cost:5e3,energy:5,strength:37,speed:0,defense:37,dexterity:37,note:""},8:{name:"Global Gym",stage:1,cost:1e4,energy:5,strength:40,speed:40,defense:40,dexterity:40,note:""},9:{name:"Knuckle Heads",stage:2,cost:5e4,energy:10,strength:48,speed:44,defense:40,dexterity:42,note:""},10:{name:"Pioneer Fitness",stage:2,cost:1e5,energy:10,strength:44,speed:46,defense:48,dexterity:44,note:""},11:{name:"Anabolic Anomalies",stage:2,cost:25e4,energy:10,strength:50,speed:46,defense:52,dexterity:46,note:""},12:{name:"Core",stage:2,cost:5e5,energy:10,strength:50,speed:52,defense:50,dexterity:50,note:""},13:{name:"Racing Fitness",stage:2,cost:1e6,energy:10,strength:50,speed:54,defense:48,dexterity:52,note:""},14:{name:"Complete Cardio",stage:2,cost:2e6,energy:10,strength:55,speed:57,defense:55,dexterity:52,note:""},15:{name:"Legs, Bums and Tums",stage:2,cost:3e6,energy:10,strength:0,speed:55,defense:55,dexterity:57,note:""},16:{name:"Deep Burn",stage:2,cost:5e6,energy:10,strength:60,speed:60,defense:60,dexterity:60,note:""},17:{name:"Apollo Gym",stage:3,cost:75e5,energy:10,strength:60,speed:62,defense:64,dexterity:62,note:""},18:{name:"Gun Shop",stage:3,cost:1e7,energy:10,strength:65,speed:64,defense:62,dexterity:62,note:""},19:{name:"Force Training",stage:3,cost:15e6,energy:10,strength:64,speed:65,defense:64,dexterity:68,note:""},20:{name:"Cha Cha's",stage:3,cost:2e7,energy:10,strength:64,speed:64,defense:68,dexterity:70,note:""},21:{name:"Atlas",stage:3,cost:3e7,energy:10,strength:70,speed:64,defense:64,dexterity:65,note:""},22:{name:"Last Round",stage:3,cost:5e7,energy:10,strength:68,speed:65,defense:70,dexterity:65,note:""},23:{name:"The Edge",stage:3,cost:75e6,energy:10,strength:68,speed:70,defense:70,dexterity:68,note:""},24:{name:"George's",stage:3,cost:1e8,energy:10,strength:73,speed:73,defense:73,dexterity:73,note:""},25:{name:"Balboas Gym",stage:4,cost:5e7,energy:25,strength:0,speed:0,defense:75,dexterity:75,note:"Requirements must be maintained to preserve access to this gym"},26:{name:"Frontline Fitness",stage:4,cost:5e7,energy:25,strength:75,speed:75,defense:0,dexterity:0,note:"Requirements must be maintained to preserve access to this gym"},27:{name:"Gym 3000",stage:4,cost:1e8,energy:50,strength:80,speed:0,defense:0,dexterity:0,note:"Requirements must be maintained to preserve access to this gym"},28:{name:"Mr. Isoyamas",stage:4,cost:1e8,energy:50,strength:0,speed:0,defense:80,dexterity:0,note:"Requirements must be maintained to preserve access to this gym"},29:{name:"Total Rebound",stage:4,cost:1e8,energy:50,strength:0,speed:80,defense:0,dexterity:0,note:"Requirements must be maintained to preserve access to this gym"},30:{name:"Elites",stage:4,cost:1e8,energy:50,strength:0,speed:0,defense:0,dexterity:80,note:"Requirements must be maintained to preserve access to this gym"},31:{name:"The Sports Science Lab",stage:4,cost:5e8,energy:25,strength:90,speed:90,defense:90,dexterity:90,note:"The use of drugs may result in the loss of membership without refunds"},32:{name:"Unknown",stage:4,cost:2147483647,energy:10,strength:100,speed:100,defense:100,dexterity:100,note:"Membership by invite only"},33:{name:"The Jail Gym",stage:0,cost:0,energy:5,strength:34,speed:34,defense:46,dexterity:0,note:""}};for(var C in ue("#gymroot").after(`
锻炼比例推荐

按照当前健身房效果一枪25E超过多少钱可以放弃GYM吃SE
Strength$0
Defense$0
Speed$0
Dexterity$0
`),ue("#se-table").find("td").attr("style","font-size: 18px; border: 4px solid darkgray; padding:6px; text-align:center;"),Ie)ue("#gym-ratio").append(``);function A(t,e,a,n){const o=ue("[class^='gymContent___']").children("[class^='properties___']").children("li");var i=ue("#strength-val").text().split(",").join(""),r=ue("#defense-val").text().split(",").join(""),s=ue("#speed-val").text().split(",").join(""),l=ue("#dexterity-val").text().split(",").join(""),d=Math.max(i/t,r/e,s/a,l/n),t=Math.abs(d*t-i)<=1?i:parseInt(d*t),e=Math.abs(d*e-r)<=1?r:parseInt(d*e),a=Math.abs(d*a-s)<=1?s:parseInt(d*a),n=Math.abs(d*n-l)<=1?l:parseInt(d*n);const c=[t,e,a,n],p=[t-i,e-r,a-s,n-l];let h=0;ue(".gym-goal").remove(),o.each(function(){const t=ue(this).children("[class^='propertyContent___']").children("[class^=description___]").children("p:first");0==t.children(".gym-perks").length?t.html(`还差:${Gt(p[h])} `):t.prepend(`还差:${Gt(p[h])} `),h++})}setInterval(function(){const e=ue("[class^='gymContent___']").children("[class^='properties___']").children("li");"1"!=e.first().attr("hasdone")&&0{var t=`https://api.torn.com/user/?selections=perks&key=${u}`;fetch(t).then(t=>t.ok?t.json():void console.log("---探测失败---"),t=>{console.log("---网络异常---")}).then(t=>{if(null!=t)if("error"in t)a(t.error);else{let a=[{},{},{},{}];for(var e in t){const l=t[e];var n,o,i,r=e.split("_")[0];for(let t=0;ta(t))}).then(function(o){console.log(o);var t=Se[function(){for(let t=1;t<32;t++){const e=ue("#gym-"+t).attr("class");if(void 0===e)return 33;if(0<=e.indexOf("active"))return t}}()];const i=[(t.strength/10).toFixed(1),(t.defense/10).toFixed(1),(t.speed/10).toFixed(1),(t.dexterity/10).toFixed(1)];console.log(i);let r=0;e.each(function(){var t,e=(100*(o[r].total-1)).toFixed(2),a=(o[r].total*i[r]).toFixed(3);let n="健身房系数: +"+i[r];for(t in n+="
系数外总加成: +"+e+"%",o[r])"total"!=t&&(n+="
"+t+": +"+o[r][t]+"%");ue(this).children("[class^='propertyContent___']").children("[class^=description___]").children("p:first").append(`实际系数: ${a} `);a=function(t,e,a,n,o){let i=5e7;t<5e7&&(i=t);n=a*o*((3.480061091e-7*Math.log(n+250)+3091619094e-15)*i+682775184551527e-19*(n+250)-.0301431777),t*=.01;return e/t*n}(ue(this).children("[class^='propertyTitle___']").children("[class^='propertyValue___']").text().split(",").join(""),45e7,a,5025,25);ue("#se-table").children().children(":eq("+r+")").children(".value").text(Lt(parseInt(a))),r++})}).catch(t=>console.log("getGymPerks "+t)))},2e3);const De=Jt("gym-ratio","ratio_number");null!==De&&void 0!==De&&(ue("#gym-ratio").children("[value="+De+"]").attr("selected","true"),ue("#gym-ratio-info").text(`Str : Def : Spd : Dex = ${Ie[De].str} : ${Ie[De].def} : ${Ie[De].spd} : ${Ie[De].dex}`),setInterval(()=>{0o||(e=66<=(o=t)?"green":"red",a=66<=t?"高":"低",ue("#stealth-value").remove(),n=ue("#log-header").children(":first").attr("class"),ue("#log-header").children(":first").after(` 隐身几率:  ${a}  Stealth:  ${t}% `)))}},500)}{function M(){const t=ue("#defender_Primary").siblings().last(),e=ue("#defender_Secondary").siblings().last(),a=ue("#defender_Melee").siblings().last();0${t}`),a+=50})}0<=window.location.href.indexOf("loader.php?sid=attack&user2ID")&&(n=setInterval(M,1e3))}{function M(){const t=ue("[class^='playersModelWrap___']").find("[class^='topWrap___']");2==t.length&&(clearInterval(a),t.each(function(){ue(this).children(":first").after('')}))}0<=window.location.href.indexOf("loader.php?sid=attack&user2ID")&&(a=setInterval(M,1e3),setInterval(function(){const t=ue(".bw-hp-percent");2==t.length&&t.each(function(){var t=ue(this).siblings("span[class^='userName___']").text();const e=ue(this).siblings("div[class^='textEntries___']").find("[id^='player-health-value_']").text();var a=(e.split("/")[0].replace(",","").trim()/e.split("/")[1].replace(",","").trim()*100).toFixed(2);t&&a&&ue(this).text(` (${a}%)`)})},1e3))}if(0<=window.location.href.indexOf("loader.php?sid=attack&user2ID")){const Me=setInterval(function(){0
检测中
检测中
刷新
`),ue("#"+a+"-refresh-btn").click(()=>{location.reload()}),ee(e,function(t){var e;null!=t&&"last_action"in t?("Online"==(e=t.last_action.status)?ue("#"+a+"-online").css("background-color",ve.green):"Idle"==e?ue("#"+a+"-online").css("background-color",ve.yellow):ue("#"+a+"-online").css("background-color",ve.gray),ue("#"+a+"-online").children().text(e),ue("#"+a+"-last").children().text(t.last_action_details)):"error"in t&&ue("#"+a+"-last").children().text("API读取失败")},function(t){ue("#"+a+"-last").children().text("蛙蛙探测 "+e+" 失败 "+t)})}(ue("[class^=playerWindow___]"),"lower-layer"),clearInterval(Me))},500)}if(nurse_suggestion&&0<=window.location.href.indexOf("item.php")&&ge(".tutorial-cont"),0<=window.location.href.indexOf("factions.php?step=your")){class t{constructor(){this.sharedSet=null,this.lastActions=null,this.error=null,this.load().then(()=>{fe(this)})}async load(){try{var t,e,a=await ae("https://bingwa-api.tornsmth.website/faction-armory/armory.json"),n=await(await fetch(`https://api.torn.com/faction/?selections=basic&key=${u}`)).json(),o=JSON.parse(a),i=o.expire,r=Math.floor((new Date).getTime()/1e3);if(!i||i
OC准备就绪 点击前往执行
`),ue("#oc-btn").click(function(){ue(this).text("蛙蛙正在前往……"),window.location.href="https://www.torn.com/factions.php?step=your#/tab=crimes"})),0
DRUG CD 小于10分钟 先不要飞了哦
`):0
DRUG CD 不足1小时 先不要飞了哦
`):0
DRUG CD 为1-2小时之间 可尽情飞翔
`):0
DRUG CD 为2-5小时之间 可尽情飞翔
`):0
DRUG CD 大于5小时 可尽情飞翔
`):ue("#tab-menu4").after(`
DRUG CD 为零 是不是忘吃药了
`),async function(){try{var t=await(await fetch(`https://api.torn.com/user/?selections=icons&key=${u}`)).json();const e=t.icons.icon85||t.icons.icon86;if(!e)return;const[,a,n]=e.split("-").map(t=>t.trim());if(a.match(/Blackmail|Kidnapping|Bomb Threat/i))return;const i=function(t){var e={day:86400,hour:3600,minute:60,second:1};let a=0;for(const o of Object.keys(e)){var n=t.match(new RegExp(`(\\d+) *${o}`,"i"));n&&(a+=parseInt(n[1])*e[o])}return a}(n);ue(".travel-wrap").each(function(){if(0!==ue(this).find(".flight-time").length){const a=ue(this).find(".flight-time").text().split("-")[1];var[t,e]=a.trim().split(":"),t=3600*parseInt(t)+60*parseInt(e),e=i-2*t;if(!(7200<=e)){const n=ue(this).find(".travel-confirm .travel-info-btn");t=0注意 OC`);e<=0&&o.attr("data-confirm",!0),n.hide(),o.insertBefore(n).click(be)}}});const o=new MutationObserver(async function(t){for(const e of t)ue(e.addedNodes).find("button.bw-oc-reminder-btn").click(be)});o.observe(ue(".travel-agency")[0],{childList:!0,subtree:!0})}catch(t){console.trace("Error in rendering OC reminder",t)}}()),0<=window.location.href.indexOf("factions.php?step=")){setInterval(function(){ue("div.title").children("div.id").text("BS");const t=ue("li.enemy,li.your").children("div.id");0({[parseInt(t.ID)]:t.TOTAL})))}get(t){return this.bw_target_cache[t]||this.wawa_cache[t]}}const Fe=new t;function F(t){return ue(t).find("[bs]").attr("bs")}function O(t){return 1e15<=t?"max":1e13<=t?parseInt(t/1e12)+"t":1e12<=t?(t/1e12).toFixed(1)+"t":1e10<=t?parseInt(t/1e9)+"b":1e9<=t?(t/1e9).toFixed(1)+"b":1e7<=t?parseInt(t/1e6)+"m":1e6<=t?(t/1e6).toFixed(1)+"m":1e4<=t?parseInt(t/1e3)+"k":1e3<=t?(t/1e3).toFixed(1)+"k":t}let a=setInterval(E,3e3);setInterval(function(){const t=ue("[class^='status-wrap territoryBoxWp___']"),e=t.children(".ttwar-time");0c&&(t=i-5e4),0${p}
${h}
`),ue(this).find(".ttwar-end").text(`(${new Date(1e3*t).format("dd日hh:mm")})`)})},1e3);let n=0;function E(){const t=ue("[class^='status-wrap territoryBoxWp___']");if(0
'),0`):ue(this).append(`
`)})}}function P(){0===ue("[class^='status-wrap territoryBoxWp___']").length&&(console.log("war page closed"),clearInterval(n),a=setInterval(E,3e3))}function N(t){var e=parseInt(t/86400),a=e?e+"天":"",n=parseInt(t%86400/3600),e=parseInt(t%3600/60),t=t%60;return a+z(n,2)+":"+z(e,2)+":"+z(t,2)}function z(t,e){return t.toString().length>=e?t.toString():z(t="0"+t,e)}}if(extra_recent_attacks&&0<=window.location.href.indexOf("factions.php?step=")){function j(t,e){const a=t.split(" ");let n=0;return"s"==a[1]?n=e-parseInt(a[0]):"m"==a[1]?n=e-parseInt(60*a[0]):"h"==a[1]&&(n=e-parseInt(3600*a[0])),n}let s=[],l=[];setInterval(function(){const n=ue(".recent-attacks"),o=parseInt((new Date).getTime()/1e3);if(0${0<=t?"+":""}${Bt(t)}
)`))}(ue(this))})}},1e3),0<=window.location.href.indexOf("page.php?sid=log")){const Oe=setInterval(function(){const t=ue(".panel > div[class^=title]");0!==t.length&&(clearInterval(Oe),t.prepend(''),ue("#log-export-btn").click(async function(){const t=new Proxy(new URLSearchParams(window.location.search),{get:(t,e)=>t.get(e)});var a=t.cat?t.cat.split(","):[];const n=t.log&&0===a.length?t.log.split(","):[];if(0!==a.length||0!==n.length){alert("注意:\n* 请勿同时使用其他频繁请求 API 的功能(例如:冰蛙目标、阅兵、犯罪经验)\n* 导出需要很长时间,请耐心等待\n* 若要取消,请刷新或关闭页面\n");try{ue(this).prop("disabled",!0),ue(this).text("正在导出,请耐心等待");var e=await(await fetch(`https://api.torn.com/user/?selections=basic&key=${u}`)).json();if("error"in e)throw new Error(e.error.error);const s=Math.max(Math.ceil(n.length/10),1),l=[];for(let e=0;e{ue(this).text(`正在导出,请耐心等待 (第 ${e+1}/${s} 批 ${new Date(1e3*t).format("yyyy-MM-dd")})`)};for await(const d of ne(a,n.slice(10*e,10*(e+1)),t.from,t.to,o))l.push(d)}l.sort((t,e)=>e.timestamp-t.timestamp);var i={user_id:e.player_id,user_name:e.name,timestamp:Math.floor((new Date).getTime()/1e3),categories:a,types:n,logs:l},r=`data:application/json;charset=utf-8,${encodeURIComponent(JSON.stringify(i))}`;ue(this).replaceWith(`导出完毕,点击保存`)}catch(t){console.trace(t),"Access level of this key is not high enough"===t.message?ue(this).replaceWith('权限不足!请使用 Full Access 类型的 API Key'):(ue(this).text("出错啦!请刷新重试"),alert(`出错啦!${t}`))}}else alert("请选择日志类型")}))},1e3)}if(0<=window.location.href.indexOf("preferences.php")){let o=setInterval(B,2e3),i=0;function R(){var t=ue("[class^=api___]"),e=ue("#name").attr("aria-expanded"),a=ue("#name").attr("aria-hidden");0
冰蛙APIKey设置
你拥有的APIKey个数为
冰蛙当前使用的APIKey为
`);const n=ue("[class^=keyRow]");ue("#apikey-number").text(`${n.length}`),ue("#apikey-current").text(`${window.localStorage.getItem("APIKey")}`),0
`),t==window.localStorage.getItem("APIKey")?(ue("#"+t).children("button").text("已使用").attr("disabled","true"),ue("#"+t).children(".key-level").html(`
${e}
`).css("background-color",ve.red),ue("#"+t).children(".key-value").html(`
${t}
`).css("background-color",ve.red)):(ue("#"+t).children(".key-level").html(`
${e}
`),ue("#"+t).children(".key-value").html(`
${t}
`))}),ue(".key-btn").click(function(){ue(".key-btn").each(function(){ue(this).text("未使用").removeAttr("disabled"),ue(this).siblings().css("background-color","#333")}),window.localStorage.setItem("APIKey",ue(this).parent().attr("id")),ue(this).text("已使用").attr("disabled","true"),ue(this).siblings().css("background-color",ve.red),ue("#apikey-current").text(`${window.localStorage.getItem("APIKey")}`)})):ue("#apikey-wrapper").text("没有已存在的APIKEY,请先创建一个然后刷新页面")}else console.log("apikey node heartbeat")}}else if(null==u||""==u)ue("body").prepend(``);else{const Ee=ue("#sidebarroot").find("[class^='status-icons___']"),Pe=ue("#top-page-links-list").children("a");if(0');Pe.last().after('宝鉴'),ue(".a_click_view_api_info").click(function(){if(ue("#bwm").length<1){var e=ue("#mainContainer")[0].clientWidth;let t=985;e<985&&(t=e);e=` `;ue("#sidebarroot").hide(),ue(".content-wrapper").hide(),ue("#mainContainer").prepend(e);function l(t){const e=ue("#bwm-nav [id^=bwm-]");e.attr("style","cursor: pointer; display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none;"),ue(t).attr("style","cursor: pointer; display: block; color: black; background-color: #4CAF50; text-align: center; padding: 14px 16px; text-decoration: none;")}function a(){var t=getVersion();return` `}ue("#bwm").append(a()),ue("#bwm-version").click(function(){ue("#bwm").children(":last").remove(),ue("#bwm").append(a()),l("#bwm-version")}),ue("#bwm-api").click(function(){ue("#bwm").children(":last").remove(),ue("#bwm").append(function(){let t="";for(var e in n)t+=''+e+"  ";t+='

    ';let a='
'+t+'