// ==UserScript== // @name 冰蛙宝鉴 // @namespace SMTH // @version 3.3.8 // @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 fe=window.jQuery;var f,u,m,y,i;f=fe,u=window,m=document,i="tornInputMoney",f.fn[i]=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_"+i)||"function"!=typeof f.data(this,"plugin_"+i)[a])throw new Error("Method "+a+" does not exist on jQuery."+i);e=f.data(this,"plugin_"+i)[a].apply(this,n)}),e!==y?e:this}if("object"==typeof t||!t)return this.each(function(){f.data(this,"plugin_"+i)||f.data(this,"plugin_"+i,new Nt(this,t))})};const ue=Object.freeze({GM:"gm",PDA:"pda",OTHER:"other"});let e=ue.OTHER;"function"==typeof GM_xmlhttpRequest?e=ue.GM:"object"==typeof GM&&"function"==typeof GM.xmlHttpRequest?(e=ue.GM,window.GM_xmlhttpRequest=GM.xmlHttpRequest):"function"==typeof PDA_httpGet&&(e=ue.PDA);const be=[{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}];be.forEach(t=>{var e=Xt("BWM_SETTINGS",t.name);null==e&&Jt("BWM_SETTINGS",t.name,String(t.default)),window[t.name]="true"==Xt("BWM_SETTINGS",t.name)});let b=localStorage.getItem("APIKey");const me={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,o,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 ye={gray:"#adadad",red:"#ff7373",green:"#8fbc8f",blue:"#65a5d1",purple:"#8d6dd7",yellow:"#f39826",yellowgreen:"#83a000",pink:"#e467b3",salmon:"#F9CDAD",orange:"#FFDEAD"};if(zt(".bw-hidden { display: none !important }"),zt(`.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; }`),zt(`.bw-chat-withdraw .bw-chat-withdraw-btn { margin-left: auto; height: fit-content; background-color: #adadad; color: white; cursor: pointer; padding: 2px; }`),zt(`.bw-chat-withdraw.bw-chat-withdraw-amount .bw-chat-withdraw-btn { background-color: #8fbc8f; }`),zt(`.bw-shared-armory { float: right; margin-right: 4px; }`),zt(`.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=Xt("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(fe(e).find("div.details").attr("itemid"));if(isNaN(a)||!(0"+a+"")}}}),t.attr("filtered","filtered")}fe("#show_more").length<1&&(fe(".travel-agency-market").after("
点击显示全部
"),fe("#show_more").click(function(){fe(this).parent().remove(),t.removeClass("hide")}))}(),common_modify_header_links&&le(),setInterval(function(){const t=fe("[class*=chat-box-header__info-btn___]").closest("[class*=chat-box___]");t.each(function(){var t=fe(this).find("[class*=chat-box-header__name___]").text();if(t){const n=fe(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 i=new Date;i.setUTCHours(a<=i.getUTCHours()?a:a-24);e=`${a}:${e}:00 - ${i.getUTCDate().toString().padStart(2,0)}/${(i.getUTCMonth()+1).toString().padStart(2,0)}/${i.getUTCFullYear().toString().slice(2)} TCT`;const o=fe(this).find("[class*=chat-box-message__message___]").toArray().slice(-5).map(t=>`[${fe(t).text()}]`);Jt("CHAT_LAST_MESSAGE",t,e+"|||"+o.join(""))}}})},1e3),chatQuickWithdraw&&de(),setInterval(function(){if(0
`);e=`/loader.php?sid=attack&user2ID=${n}`;fe("#bingwa-mini-profile-attack").html(`
`),Jt("battlestats",n,t.estimate_bs),fe("#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&&ce(),hide_cloud_while_flying&&0"+n.toFixed(2)+""+(0<=i?" + ":" - ")+Math.abs(i).toFixed(2)),fe(e).css("color",0<=i?"green":"red"),fe(e).attr("show-value","show-value")})},500),0<=window.location.href.indexOf("shops.php?step=bitsnbobs")&&fe(".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 te("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(fe("#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 i=fe(".money-wrap").children(".give-block"),a="give-money",o="array";function r(){fe(".button-wrap").remove(),t()}function t(){const n=Xt(a,o);var t=function(){let a=`
给自己`;return n.forEach((t,e)=>{a+=(t=t,`${t.button_name}`)}),a+=`+ 全取 x
`,a}();i.before(t),fe("#deposit-add").click(()=>{0'),fe("#deposit-input").tornInputMoney({groupMoneyClass:null}),fe("#deposit-input").focus(),fe("#deposit-input").blur(()=>{var t=fe("#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"}(Bt("$"+t))}`,"button-value":t}),Jt(a,o,e),r()}))}),fe("#deposit-remove").click(()=>{fe("#deposit-remove").hasClass("deposit-removing")?(fe(".deposit-money-btn").css("background-color",ye.blue),fe(".deposit-money-btn").removeClass("deposit-removing"),fe("#deposit-remove").css("background-color",ye.red),fe("#deposit-remove").removeClass("deposit-removing")):(fe(".deposit-money-btn").css("background-color",ye.red),fe(".deposit-money-btn").addClass("deposit-removing"),fe("#deposit-remove").css("background-color",ye.salmon),fe("#deposit-remove").addClass("deposit-removing"))}),fe("#deposit-self").click(()=>{fe("input#money-user").val(x()).addClass("chosen")}),n.forEach((t,e)=>{fe(`#deposit${e}`).click(()=>{if(fe(`#deposit${e}`).hasClass("deposit-removing")){let t=n;return t.splice(e,1),Jt(a,o,t),void r()}i.children(".inputs-wrap").children(".input-money-group").addClass("success").children("input").attr("value",t["button-value"]),i.children(".inputs-wrap").children(".radio-wp").children(".btn-wrap").children(".btn").children().attr("disabled",!1).removeClass("disabled"),i.children(".inputs-wrap").children(".radio-wp").find("#give-money").click()})}),fe("#deposit-all").click(()=>{const e=fe("#money-user").val();if(""===e)alert("全取请先输入玩家ID");else{let t=g(e);var a;t<0&&"string"==typeof e&&!xe.error&&xe.data&&((a=e.match(/\[(\d+)\]$/))&&(a=a[1],a=xe.data[a]||0,t+=a)),0${fe("#money-user").val()}`);var n=g(i);0<=n?(fe("#before-value").css("background-color","var(--default-green-color)").html(`
${Bt(n)}
`),fe("#before-title").css("color","var(--default-green-color)")):(fe("#before-value").css("background-color","var(--default-red-color)").html(`
${Bt(n)}
`),fe("#before-title").css("color","var(--default-red-color)"));e=Rt(fe(".money-wrap").find(".count.input-money").first().val()),n=n-e;0<=n?(fe("#after-value").css("background-color","var(--default-green-color)").html(`
${Bt(n)}
`),fe("#after-title").css("color","var(--default-green-color)")):(fe("#after-value").css("background-color","var(--default-red-color)").html(`
${Bt(n)}
`),fe("#after-title").css("color","var(--default-red-color)"));let t=0<=n;!xe.error&&xe.data?(e=xe.data[a]||0,-n<=e?(t=!0,fe("#loan-value").css("background-color","var(--default-green-color)").html(`
${Bt(e)}
`),fe("#loan-title").css("color","var(--default-green-color)")):(fe("#loan-value").css("background-color","var(--default-red-color)").html(`
${Bt(e)}
`),fe("#loan-title").css("color","var(--default-red-color)"))):xe.error?(fe("#loan-value").css("background-color","var(--default-red-color)").html(`
加载失败: ${xe.error}
`),fe("#loan-title").css("color","var(--default-red-color)")):(fe("#loan-value").css("background-color","var(--default-blue-color)").html('
正在加载
'),fe("#loan-title").css("color","var(--default-blue-color)")),"checked"!==fe(".money-wrap .give-block .inputs-wrap .radio-wp #give-money").attr("checked")&&(t=!0),xe.whitelist.has(a)&&(t=!0),fe(".money-wrap .give-block .action-confirm .btn-wrap button").attr("disabled",!t),t?fe("#bw-check-loan").hide():fe("#bw-check-loan").show().attr("data-uid",a)}}}},1e3);function _(e,a,n){let i=Bt(a);if(0<=a){let t=100*a/n;"准备金率"==e&&(t=Math.min(100*a,100),i=(100*a).toFixed(2)+"%"),fe("#faction_balance_li").append(`
${Yt(22,0,"var(--default-green-color)","var(--default-bg-panel-color)",e)}
${Yt(22,t,"var(--default-green-color)","var(--default-bg-panel-color)",i)}
`)}else{n=100*a/n+100;fe("#faction_balance_li").append(`
${Yt(22,n,"var(--default-bg-panel-color)","var(--default-red-color)",e)}
${Yt(22,0,"var(--default-red-color)","var(--default-bg-panel-color)",i)}
`)}}let e=new MutationObserver(function(t,e){!function(){const t=fe("div#money-user-cont").find("li.ui-custom-item");!fe("input#money-user")||"."!=fe("input#money-user").val()&&" "!=fe("input#money-user").val()||(fe("input#money-user").val(x()).addClass("chosen"),console.log(x()),v(t.children(),x())),0{e=parseInt(fe(e).find("span.money").attr("data-value"));0 `),_("帮派余额",o,r),_("所有存款总和",e,r),_("帮派公共资金",i,r),_("正存款总和",a,r),_("负存款总和",n,r),_("准备金率",parseFloat(o/a),r)}}(),function(){const t=fe(".money-wrap").children(".give-block");0
收款人
取款前余额
取款后余额
贷款额度
`)}(),function(){const t=fe(".money-wrap .give-block .action-confirm");0===t.length||0手工检查贷款'),fe("#bw-check-loan").click(function(){var t=fe(this).attr("data-uid");t&&xe.whitelist.add(t)}))}(),fe(".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 ve="bingwa_bust";class t{constructor(t){this.refresh_callback=t;t=Ut(ve);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(){var t,e;t=ve,e={info:this.info,conf:this.conf,version:"3.0.5"},void 0===window.localStorage||window.localStorage.setItem(t,JSON.stringify(e))}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=${b}`;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 i=n.faction_perks.find(t=>t.match(/bust success chance/i));this.info.faction_perk=i?parseInt(i.match(/\d+/)[0]):0,this.info.job_perk=0<=n.job_perks.indexOf("+ Easier to bust more people at once");const o=n.education_perks.find(t=>t.match(/Busting skill/i));this.info.edu_perk=o?parseInt(o.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 we=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(fe(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])}(fe(t))+180)*function(t){t=t.find("span.level").text().match(/\d+/g);return t?parseInt(t[0]):0}(fe(t));if(0==e)return!1;e=``;return fe(t).find("span.reason").append(e),fe(t).removeClass("gray"),!0}(n)||e:fe(n).text().match(/You busted .* out of jail/i)&&(e=!0,we.increasePenalty());e&&I()});function k(t){const e=t.find("a.faction").attr("href");return e?e.substring(30):0}function $(){const t=fe("ul.user-info-list-wrap").children("li");t.each(function(){if(0!==fe(this).find("b.bust-score").length){var e=parseFloat(fe(this).find("b.bust-score").attr("bust-prob"));let t=!1;isNaN(e)||(null!==we.conf.prob_min&&ewe.conf.prob_max&&(t=!0));e=k(fe(this))in me;"PIN"===we.conf.friend&&e&&(t=!1),t?fe(this).addClass("bw-hidden"):fe(this).removeClass("bw-hidden"),we.conf.friend&&e?fe(this).css("background-color","rgba(110, 160, 55, 0.15)"):fe(this).css("background-color","");const a=fe(this).children("a.bust");"ON"===we.conf.quick_bust||"ON_BOTH"===we.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=fe(this).children("a.bye");"ON_BAIL"===we.conf.quick_bust||"ON_BOTH"===we.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"))}}),we.conf.order&&(t.sort(function(t,e){var a=parseInt(fe(t).find("b.bust-score").attr("bust-score")),n=parseInt(fe(e).find("b.bust-score").attr("bust-score")),t=k(fe(t))in me,e=k(fe(e))in me;return"PIN"===we.conf.friend&&t!=e?Number(e)-Number(t):"ASC"===we.conf.order?a-n:n-a}),t.detach().appendTo("ul.user-info-list-wrap"))}function I(){const n=we.info,t=fe(".info-msg-cont").first();var e;t.css("background","var(--default-bg-panel-color)"),t.css("font-size","12px"),t.html(`

`),null!==we.conf.prob_min&&fe("#bust-conf-prob-min").val(we.conf.prob_min),null!==we.conf.prob_max&&fe("#bust-conf-prob-max").val(we.conf.prob_max),fe("#bust-conf-order").val(we.conf.order),fe("#bust-conf-friend").val(we.conf.friend),fe("#bust-conf-quick-bust").val(we.conf.quick_bust),Qt(fe("#bust-conf-prob-min"),t=>/^\d*$/.test(t)),Qt(fe("#bust-conf-prob-max"),t=>/^\d*$/.test(t)),fe("#bust-conf input").change(D),fe("#bust-conf select").change(D),"loading"===n.error?fe("#bust-info").html("正在读取 Bust 历史,请稍等。若 5 秒内未出结果,请刷新页面重试。"):"Access level of this key is not high enough"===n.error?fe("#bust-info").html(` 权限不足,无法读取 Bust 惩罚! 请使用 Full Access 类型的 API Key `):n.error?fe("#bust-info").html(`出错啦!${n.error}`):(e=n.job_perk?"惩罚效果减半":"无",fe("#bust-info").html(` Bust 惩罚: ${n.penalty.toFixed(2)} Bust 技能: ${we.getBustSkill().toFixed(2)} 工作特技: ${e} `),fe("#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}`}})),fe("#bust-info").append('显示选项'),S(we.conf.hidden),fe("#bust-info-toggle-conf").click(function(){we.conf.hidden=!we.conf.hidden,we.save(),S(we.conf.hidden)}),fe("b.bust-score").each(function(){var e=fe(this).attr("bust-score");if(e){let t="t-red";if(n.error)fe(this).text(` ${e}`),fe(this).removeAttr("bust-prob");else{const a=we.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",fe(this).html(` ${e}  ${a.toFixed(1)}%`),fe(this).attr("bust-prob",a.toFixed(1))}fe(this).attr("class",`bust-score ${t}`)}}),$()}function S(t){t?(fe("#bust-info-toggle-conf").text("显示选项"),fe("#bust-conf").hide()):(fe("#bust-info-toggle-conf").text("隐藏选项"),fe("#bust-conf").show())}function D(){var t=fe("#bust-conf-prob-min").val();we.conf.prob_min=t?parseInt(t):null;t=fe("#bust-conf-prob-max").val();we.conf.prob_max=t?parseInt(t):null,we.conf.order=fe("#bust-conf-order").val(),we.conf.friend=fe("#bust-conf-friend").val(),we.conf.quick_bust=fe("#bust-conf-quick-bust").val(),we.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=fe(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 o){var a=e===n?"t-green":"t-gray-c";t.after(`${e}%`)}}}()},1e3),gym_show_ratio&&0<=window.location.href.indexOf("gym.php")){const ke={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}},$e={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 fe("#gymroot").after(`
锻炼比例推荐

按照当前健身房效果一枪25E超过多少钱可以放弃GYM吃SE
Strength$0
Defense$0
Speed$0
Dexterity$0
`),fe("#se-table").find("td").attr("style","font-size: 18px; border: 4px solid darkgray; padding:6px; text-align:center;"),ke)fe("#gym-ratio").append(``);function A(t,e,a,n){const i=fe("[class^='gymContent___']").children("[class^='properties___']").children("li");var o=fe("#strength-val").text().split(",").join(""),r=fe("#defense-val").text().split(",").join(""),s=fe("#speed-val").text().split(",").join(""),l=fe("#dexterity-val").text().split(",").join(""),d=Math.max(o/t,r/e,s/a,l/n),t=Math.abs(d*t-o)<=1?o: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-o,e-r,a-s,n-l];let h=0;fe(".gym-goal").remove(),i.each(function(){const t=fe(this).children("[class^='propertyContent___']").children("[class^=description___]").children("p:first");0==t.children(".gym-perks").length?t.html(`还差:${Lt(p[h])} `):t.prepend(`还差:${Lt(p[h])} `),h++})}setInterval(function(){const e=fe("[class^='gymContent___']").children("[class^='properties___']").children("li");"1"!=e.first().attr("hasdone")&&0{var t=`https://api.torn.com/user/?selections=perks&key=${b}`;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,i,o,r=e.split("_")[0];for(let t=0;ta(t))}).then(function(i){console.log(i);var t=$e[function(){for(let t=1;t<32;t++){const e=fe("#gym-"+t).attr("class");if(void 0===e)return 33;if(0<=e.indexOf("active"))return t}}()];const o=[(t.strength/10).toFixed(1),(t.defense/10).toFixed(1),(t.speed/10).toFixed(1),(t.dexterity/10).toFixed(1)];console.log(o);let r=0;e.each(function(){var t,e=(100*(i[r].total-1)).toFixed(2),a=(i[r].total*o[r]).toFixed(3);let n="健身房系数: +"+o[r];for(t in n+="
系数外总加成: +"+e+"%",i[r])"total"!=t&&(n+="
"+t+": +"+i[r][t]+"%");fe(this).children("[class^='propertyContent___']").children("[class^=description___]").children("p:first").append(`实际系数: ${a} `);a=function(t,e,a,n,i){let o=5e7;t<5e7&&(o=t);n=a*i*((3.480061091e-7*Math.log(n+250)+3091619094e-15)*o+682775184551527e-19*(n+250)-.0301431777),t*=.01;return e/t*n}(fe(this).children("[class^='propertyTitle___']").children("[class^='propertyValue___']").text().split(",").join(""),45e7,a,5025,25);fe("#se-table").children().children(":eq("+r+")").children(".value").text(Bt(parseInt(a))),r++})}).catch(t=>console.log("getGymPerks "+t)))},2e3);const Ie=Xt("gym-ratio","ratio_number");null!==Ie&&void 0!==Ie&&(fe("#gym-ratio").children("[value="+Ie+"]").attr("selected","true"),fe("#gym-ratio-info").text(`Str : Def : Spd : Dex = ${ke[Ie].str} : ${ke[Ie].def} : ${ke[Ie].spd} : ${ke[Ie].dex}`),setInterval(()=>{0i||(e=66<=(i=t)?"green":"red",a=66<=t?"高":"低",fe("#stealth-value").remove(),n=fe("#log-header").children(":first").attr("class"),fe("#log-header").children(":first").after(` 隐身几率:  ${a}  Stealth:  ${t}% `)))}},500)}{function M(){const t=fe("#defender_Primary").siblings().last(),e=fe("#defender_Secondary").siblings().last(),a=fe("#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=fe("[class^='playersModelWrap___']").find("[class^='topWrap___']");2==t.length&&(clearInterval(a),t.each(function(){fe(this).children(":first").after('')}))}0<=window.location.href.indexOf("loader.php?sid=attack&user2ID")&&(a=setInterval(M,1e3),setInterval(function(){const t=fe(".bw-hp-percent");2==t.length&&t.each(function(){var t=fe(this).siblings("span[class^='userName___']").text();const e=fe(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&&fe(this).text(` (${a}%)`)})},1e3))}if(0<=window.location.href.indexOf("loader.php?sid=attack&user2ID")){const Ce=setInterval(function(){0
检测中
检测中
刷新
`),fe("#"+a+"-refresh-btn").click(()=>{location.reload()}),Zt(e,function(t){var e;null!=t&&"last_action"in t?("Online"==(e=t.last_action.status)?fe("#"+a+"-online").css("background-color",ye.green):"Idle"==e?fe("#"+a+"-online").css("background-color",ye.yellow):fe("#"+a+"-online").css("background-color",ye.gray),fe("#"+a+"-online").children().text(e),fe("#"+a+"-last").children().text(t.last_action_details)):"error"in t&&fe("#"+a+"-last").children().text("API读取失败")},function(t){fe("#"+a+"-last").children().text("蛙蛙探测 "+e+" 失败 "+t)})}(fe("[class^=playerWindow___]"),"lower-layer"),clearInterval(Ce))},500)}if(nurse_suggestion&&0<=window.location.href.indexOf("item.php")&&pe(".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(()=>{he(this)})}async load(){try{var t,e,a=await te("https://bingwa-api.tornsmth.website/faction-armory/armory.json"),n=await(await fetch(`https://api.torn.com/faction/?selections=basic&key=${b}`)).json(),i=JSON.parse(a),o=i.expire,r=Math.floor((new Date).getTime()/1e3);if(!o||o
OC准备就绪 点击前往执行
`),fe("#oc-btn").click(function(){fe(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小时 可尽情飞翔
`):fe("#tab-menu4").after(`
DRUG CD 为零 是不是忘吃药了
`),async function(){try{var t=await(await fetch(`https://api.torn.com/user/?selections=icons&key=${b}`)).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 o=function(t){var e={day:86400,hour:3600,minute:60,second:1};let a=0;for(const i of Object.keys(e)){var n=t.match(new RegExp(`(\\d+) *${i}`,"i"));n&&(a+=parseInt(n[1])*e[i])}return a}(n);fe(".travel-wrap").each(function(){if(0!==fe(this).find(".flight-time").length){const a=fe(this).find(".flight-time").text().split("-")[1];var[t,e]=a.trim().split(":"),t=3600*parseInt(t)+60*parseInt(e),e=o-2*t;if(!(7200<=e)){const n=fe(this).find(".travel-confirm .travel-info-btn");t=0注意 OC`);e<=0&&i.attr("data-confirm",!0),n.hide(),i.insertBefore(n).click(ge)}}});const i=new MutationObserver(async function(t){for(const e of t)fe(e.addedNodes).find("button.bw-oc-reminder-btn").click(ge)});i.observe(fe(".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(){fe("div.title").children("div.id").text("BS");const t=fe("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 Me=new t;function F(t){return fe(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=fe("[class^='status-wrap territoryBoxWp___']"),e=t.children(".ttwar-time");0c&&(t=o-5e4),0${p}
${h}
`),fe(this).find(".ttwar-end").text(`(${new Date(1e3*t).format("dd日hh:mm")})`)})},1e3);let n=0;function E(){const t=fe("[class^='status-wrap territoryBoxWp___']");if(0
'),0`):fe(this).append(`
`)})}}function P(){0===fe("[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=fe(".recent-attacks"),i=parseInt((new Date).getTime()/1e3);if(0${0<=t?"+":""}${Rt(t)}
)`))}(fe(this))})}},1e3),0<=window.location.href.indexOf("page.php?sid=log")){const Te=setInterval(function(){const t=fe(".panel > div[class^=title]");0!==t.length&&(clearInterval(Te),t.prepend(''),fe("#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{fe(this).prop("disabled",!0),fe(this).text("正在导出,请耐心等待");var e=await(await fetch(`https://api.torn.com/user/?selections=basic&key=${b}`)).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{fe(this).text(`正在导出,请耐心等待 (第 ${e+1}/${s} 批 ${new Date(1e3*t).format("yyyy-MM-dd")})`)};for await(const d of ee(a,n.slice(10*e,10*(e+1)),t.from,t.to,i))l.push(d)}l.sort((t,e)=>e.timestamp-t.timestamp);var o={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(o))}`;fe(this).replaceWith(`导出完毕,点击保存`)}catch(t){console.trace(t),"Access level of this key is not high enough"===t.message?fe(this).replaceWith('权限不足!请使用 Full Access 类型的 API Key'):(fe(this).text("出错啦!请刷新重试"),alert(`出错啦!${t}`))}}else alert("请选择日志类型")}))},1e3)}if(0<=window.location.href.indexOf("preferences.php")){let i=setInterval(B,2e3),o=0;function R(){var t=fe("[class^=api___]"),e=fe("#name").attr("aria-expanded"),a=fe("#name").attr("aria-hidden");0
冰蛙APIKey设置
你拥有的APIKey个数为
冰蛙当前使用的APIKey为
`);const n=fe("[class^=keyRow]");fe("#apikey-number").text(`${n.length}`),fe("#apikey-current").text(`${window.localStorage.getItem("APIKey")}`),0
`),t==window.localStorage.getItem("APIKey")?(fe("#"+t).children("button").text("已使用").attr("disabled","true"),fe("#"+t).children(".key-level").html(`
${e}
`).css("background-color",ye.red),fe("#"+t).children(".key-value").html(`
${t}
`).css("background-color",ye.red)):(fe("#"+t).children(".key-level").html(`
${e}
`),fe("#"+t).children(".key-value").html(`
${t}
`))}),fe(".key-btn").click(function(){fe(".key-btn").each(function(){fe(this).text("未使用").removeAttr("disabled"),fe(this).siblings().css("background-color","#333")}),window.localStorage.setItem("APIKey",fe(this).parent().attr("id")),fe(this).text("已使用").attr("disabled","true"),fe(this).siblings().css("background-color",ye.red),fe("#apikey-current").text(`${window.localStorage.getItem("APIKey")}`)})):fe("#apikey-wrapper").text("没有已存在的APIKEY,请先创建一个然后刷新页面")}else console.log("apikey node heartbeat")}}else if(null==b||""==b)fe("body").prepend(``);else{const Fe=fe("#sidebarroot").find("[class^='status-icons___']"),Oe=fe("#top-page-links-list").children("a");if(0');Oe.last().after('宝鉴'),fe(".a_click_view_api_info").click(function(){if(fe("#bwm").length<1){var e=fe("#mainContainer")[0].clientWidth;let t=985;e<985&&(t=e);e=` `;fe("#sidebarroot").hide(),fe(".content-wrapper").hide(),fe("#mainContainer").prepend(e);function l(t){const e=fe("#bwm-nav [id^=bwm-]");e.attr("style","cursor: pointer; display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none;"),fe(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` `}fe("#bwm").append(a()),fe("#bwm-version").click(function(){fe("#bwm").children(":last").remove(),fe("#bwm").append(a()),l("#bwm-version")}),fe("#bwm-api").click(function(){fe("#bwm").children(":last").remove(),fe("#bwm").append(function(){let t="";for(var e in n)t+=''+e+"  ";t+='

    ';let a='
'+t+'