仓库清理

This commit is contained in:
woohoo 2022-06-18 21:00:21 +08:00
parent d24f4e9464
commit bdcdb5babb
12 changed files with 10310 additions and 11489 deletions

View File

@ -1 +0,0 @@
# torncity-zhcn-translate

View File

@ -1,12 +0,0 @@
{
"latest": [
{
"ver": "2.9.0",
"name": "冰蛙宝鉴_2.9.0.user.js.txt",
"replace": {
"with": "https://www.torn.com/*.php*",
"to": "https://www.torn.com/*"
}
}
]
}

View File

@ -1,93 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0"
name="viewport">
<title>冰蛙复制</title>
<script>
window.onload = () => {
const load = document.querySelector('#load')
load.disabled = true;
const copy = document.querySelector('#copy')
copy.disabled = true;
const cont = document.querySelector('#container p')
const status = document.querySelector('#status')
let latest;
let scriptCont;
let replace;
fetch(`conf.json?${performance.now()}`)
.then(response => response.json())
.then(data => {
latest = data['latest'];
replace = latest[0]['replace'];
status.innerHTML = `配置加载完成`;
cont.innerHTML = `最新版本:${latest[0].ver}`;
cont.innerHTML += `<br/>文件名:${latest[0].name}`;
load.disabled = false;
})
load.onclick = () => {
if (!latest) return;
load.disabled = true;
status.innerHTML = '正在加载脚本文件';
fetch(`${latest[0].name}?${performance.now()}`)
.then(response => response.text())
.then(text => {
status.innerHTML = '脚本加载完成';
scriptCont = replace ? text.replace(replace['with'], replace['to']) : text.replace('https://www.torn.com/*.php*', 'https://www.torn.com/*');
copy.disabled = false;
load.disabled = false;
})
};
copy.onclick = () => {
if (!scriptCont) return;
copy.disabled = true;
const clipboardObj = navigator.clipboard;
if (!clipboardObj) {
status.innerHTML = '脚本复制出错';
copy.disabled = false;
return;
}
clipboardObj.writeText(scriptCont);
status.innerHTML = '脚本复制完成';
copy.disabled = false;
};
};
</script>
<style>
* {
margin: 0;
padding: 0;
border: 0;
}
body {
max-width: 600px;
margin: 0 auto;
}
button {
background-color: black;
color: white;
width: 100%;
padding: 16px;
font-size: 16px;
}
button[disabled] {
background-color: gray;
}
</style>
</head>
<body>
<div id="container"><p></p></div>
<div id="status">正在加载配置文件</div>
<div>
<button id="load">加载脚本</button>
</div>
<div>
<button id="copy">复制脚本</button>
</div>
</body>
</html>

View File

@ -1,43 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
<title>更新页面</title>
<script>
window.onload = () => {
const origin = {};
let intervalID;
const container = document.querySelector('.container p');
const btn = document.querySelector('.container button');
window.addEventListener("message", (e) => {
console.log(e.data);
origin.origin = e.origin;
origin.source = e.source;
if (e.data === 'connect') e.source.postMessage('connected', '*')
}, false);
intervalID = window.setInterval(() => {
if (origin.origin) {
clearInterval(intervalID);
intervalID = null;
container.innerHTML = '成功与翻译助手建立连接';
btn.disabled = false;
}
}, 1000);
btn.onclick = (e) => {
e.target.blur();
origin.source.postMessage('测试', '*');
origin.source.focus();
// window.close();
};
};
</script>
</head>
<body>
<h1>更新页面</h1>
<div class="container">
<p>正与翻译助手建立连接...</p>
<button disabled>测试</button>
</div>
</body>
</html>

View File

@ -1,35 +0,0 @@
Premier Fitness
Average Joes
Woody's Workout Club
Beach Bods
Silver Gym
Pour Femme
Davies Den
Global Gym
Knuckle Heads
Pioneer Fitness
Anabolic Anomalies
Core
Racing Fitness
Complete Cardio
Legs, Bums and Tums
Deep Burn
Apollo Gym
Gun Shop
Force Training
Cha Cha's
Atlas
Last Round
The Edge
George's
Balboas Gym
Frontline Fitness
Gym 3000
Mr. Isoyamas
Total Rebound
Elites
The Sports Science Lab
The Jail Gym

View File

@ -1,96 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8"/>
<meta content="width=device-width, initial-scale=1 user-scalable=0" name="viewport"/>
<script type="text/javascript">
window.onload = () => {
const url = 'https://jjins.github.io/fyfuzhi/torn-trans-zhcn.user.js';
const $textarea = document.querySelector('textarea');
const $text = document.getElementById('text');
const $btn = document.querySelector('button');
const $refresh = document.getElementById('refresh');
fetch(url, {cache: 'no-cache'})
.catch(e => console.error(e))
.then(data => data.text())
.then(text => {
$textarea.value = text;
const iStart = 37;
const dtimeStr = text.slice(iStart, iStart + 12);
const last = {
year: dtimeStr.slice(0, 4),
month: dtimeStr.slice(4, 6),
day: dtimeStr.slice(6, 8),
h: dtimeStr.slice(8, 10),
m: dtimeStr.slice(10)
};
$text.innerText = `加载完成,更新时间${last.year}年${last.month}月${last.day}日${last.h}:${last.m}`;
$btn.disabled = false;
});
$btn.onclick = () => {
$textarea.select();
document.execCommand('Copy');
$text.innerText = "已复制";
$textarea.blur();
};
$refresh.onclick = () => {
location.reload();
};
};
</script>
<style>html, body, p {
margin: 0;
padding: 0;
}
p {
font-size: 16px;
text-align: center;
padding: 2em 0;
}
textarea {
position: absolute;
top: 0;
left: 0;
opacity: 0;
z-index: -10;
}
button {
-webkit-appearance: none;
display: block;
border-radius: 0;
border: 0;
width: 100%;
padding: 2em 0;
margin: 0;
background-color: #32CD32;
color: white;
font-size: 16px;
}
button[disabled] {
background-color: grey;
}
a {
display: block;
padding: 1.5em 0;
text-align: center;
}
</style>
<title>翻译助手快捷复制</title>
</head>
<body>
<p id="text">请稍后,正在加载...</p>
<textarea></textarea>
<button disabled>点击复制</button>
<!--<a>备用链接</a>-->
<a id="refresh">刷新页面</a>
</body>
</html>

View File

@ -1,316 +0,0 @@
const MISSION_HINTS = {
a_good_day_to_get_hard: {
task: "Achieve a killstreak of 3 - 10.",
hint: "Buying losses is a valid strategy.",
},
a_kimpossible_task: {
task: "Defeat (P) using only melee and temporary weapons.",
hint: "Guns can stay equipped.",
},
a_problem_at_the_tracks: {
task: "Defeat 3 (P) without using any guns.",
hint: "Guns can stay equipped. Using a gun will fail this mission!",
},
a_thor_loser: {
task: "Use Duke's hammer to hit 8 - 16 unique body parts",
hint: "Stalemating is a good way to achieve this.",
},
against_the_odds: {
task: "Defeat 2 (P).",
},
an_honorary_degree: {
task: "Defeat (P) without using any guns",
hint: "Guns can stay equipped. Using a gun will fail this mission!",
},
army_of_one: {
task: "Attack (P) 3 times with various masks.",
hint: "Duke will send you the two masks to wear. Make sure that one of the attacks is without any mask.",
},
bakeout_breakout: {
task: "Combine a fruitcake and the lock pick, and send 'special fruitcake' to someone in jail.",
},
bare_knuckle: {
task: "Defeat (P) with no weapons or armor equipped.",
hint: "Unequip everything. Residual effects from previous fights will fail this mission!",
},
batshit_crazy: {
task: async () => {
await requireSidebar();
const max = parseInt(document.find("#barLife [class*='bar-value___']").textContent.split("/")[1]);
return `Inflict ${formatNumber(max * 0.5, { decimals: 0 })} - ${formatNumber(max * 4, {
decimals: 0,
})} (based on your maximum life) damage with Penelope.`;
},
hint: "You'll receive Penelope from Duke.",
},
battering_ram: {
task: "Attack (P) 3 times.",
},
big_tub_of_muscle: {
task: "Defeat (P) despite their gargantuan strength.",
},
birthday_surprise: {
task: "Obtain and send a specific item as a present to Duke.",
hint: "Place the item in an empty box, then gift wrap it to get it as a parcel.",
},
bonnie_and_clyde: {
task: "Defeat (P), and their spouse.",
},
bountiful: {
task: "Successfully claim 2 - 5 bounties",
hint: "Make sure to hospitalize the target.",
},
bounty_on_the_mutiny: {
task: "Bounty (P) and wait for the bounty to be claimed.",
hint: "You cannot claim your own bounties.",
},
bring_it: {
task: "Defeat Duke in a group attack",
hint: "Unlike other missions, you'll have a week to finish this one. Doesn't have to be the finishing hit, so just join when people try to loot him.",
},
candy_from_babies: {
task: "Collect $50,000 - $250,000 in bounties.",
hint: "Doesn't have to be in a single bounty. Make sure to hospitalize the target(s).",
},
charity_work: {
task: "Mug 2 (P)",
hint: "Must be a successful mug. Sending them a small amount will guarantee a mug.",
},
cracking_up: {
task: "Defeat and interrogate (P) for the code to unlock Duke's safe and send the content to Duke after opening it.",
hint: "Can take a few times to get the code.",
},
critical_education: {
task: "Achieve 3 - 9 critical hits",
},
cut_them_down_to_size: {
task: "Defeat any player of your level or higher.",
},
dirty_little_secret: {
task: "Put a bounty on (P), then attack the person who claimed it.",
hint: "If the claimer is anonymous, their ID # still shows up in the mission screen.",
},
double_jeopardy: {
task: "Defeat (P) and put a bounty on them.",
hint: "Bounty can be any amount as it doesn't have to be claimed.",
},
drug_problem: {
task: "Defeat 4 - 7 (P).",
},
emotional_debt: {
task: "Hit (P) with tear gas or pepper spray.",
hint: "Will count as long as it isn't blocked. Tear gas is blocked by an hazmat suit. Most helmets block pepper spray.",
},
estranged: {
task: "Injure one of (P)'s legs.",
},
family_ties: {
task: "Hospitalize (P) 3 times",
},
field_trip: {
task: "Win $100 - $1,000,000 on 3 casino games.",
},
fireworks: {
task: "Expend 250 - 1250 rounds of ammunition",
},
forgotten_bills: {
task: "Defeat (P)",
},
frenzy: {
task: "Defeat any 5 - 15 players.",
},
get_things_jumping: {
task: "Deal 2,000 - 50,000 and receive 1,000 - 25,000 damage based your max life.",
hint: "Values are apparently based on your max life.",
},
graffiti: {
task: "Hit (P) with pepper spray.",
},
guardian: {
task: "Defeat (P).",
},
hammer_time: {
task: "Defeat (P) with a hammer.",
hint: "Guns can stay equipped. Dual hammers don't count.",
},
hands_off: {
task: "Defeat 3 - 5 (P).",
},
hare_meet_tortoise: {
task: "Defeat (P) despite their lightning fast speed.",
hint: "Flash and smoke grenades will reduce their speed.",
},
hide_and_seek: {
task: "Find (P) from 3 - 5 listed and defeat them.",
hint: "Given clues make it easy to identify the target.",
},
hiding_in_plain_view: {
task: "Defeat (P) in a random country.",
},
high_fliers: {
task: "Defeat 3 (P) in random countries",
},
hobgoblin: {
task: "Defeat a player of your choice 5 times",
},
immovable_object: {
task: "Defeat (P) despite their impenetrable defense.",
},
inside_job: {
task: "Attack (P) and secrete an item on them.",
},
introduction_duke: {
task: "Complete 10 Duke contracts.",
},
keeping_up_appearances: {
task: "Mug (P) and send them back the money.",
hint: "Must be a successful mug. Sending them a small amount will guarantee a mug.",
},
kiss_of_death: {
task: "Defeat (P) and use the kiss option.",
},
lack_of_awareness: {
task: "Defeat (P).",
},
lost_and_found: {
task: "Put (P) in the hospital for 12 hours.",
},
loud_and_clear: {
task: "Use 3 - 11 explosive grenades.",
hint: "Grenades must be a type that causes damage.",
},
loyal_customer: {
task: "Defeat (P).",
},
make_it_slow: {
task: "Defeat (P) in no fewer than 5 - 9 turns in a single attack.",
hint: "Survive for at least 7 or 9 turns then defeat the target. You can keep retrying if it fails.",
},
marriage_counseling: {
task: "Defeat (P)'s spouse.",
},
massacrist: {
task: "Defeat (P).",
},
meeting_the_challenge: {
task: "Mug people for a total of $10,000 - $16,000,000.",
},
motivator: {
task: "Lose or stalemate to (P) on the first attempt.",
hint: "Timing out doesn't fail this mission, so if you're about to win, let it time out. You can get your health low by using the wrong blood bag. Make yourself weak by unequipping armor and equip a rusty sword.",
},
new_kid_on_the_block: {
task: "Defeat 5 players.",
},
no_man_is_an_island: {
task: "Mug 2 out of 3 (P).",
hint: "You can select which of the targets to hit, as long as you mug 2 different ones.",
},
no_second_chances: {
task: "Defeat (P) on the first attempt.",
},
out_of_the_frying_pan: {
task: "Go to the jail, use Felovax to go to the hospital, then use Zylkene.",
},
painleth_dentitht: {
task: "Defeat (P) with a baseball bat.",
hint: "Other weapons can stay equipped. Using any other weapon will fail this mission!",
},
party_tricks: {
task: "Defeat (P) despite their nimble dexterity.",
},
pass_the_word: {
task: "Send a message including keyword to (P).",
hint: "It's easy to achieve this by copying the mission description.",
},
peak_experience: {
task: "Defeat (P).",
},
proof_of_the_pudding: {
task: "Use a specific weapon on (P), then send the weapon to them.",
hint: "You don't have to send the exact same gun you used to attack with, just same type.",
},
rabbit_response: {
task: "Defeat 3 (P) within 30 - 10 minutes.",
hint: "Timer starts after attacking one of the targets, so make sure they are all out of the hospital.",
},
reconstruction: {
task: "Equip kitchen knife and leather gloves, defeat (P) then dump both items.",
hint: "Don't have to actually use the kitchen knife.",
},
red_faced: {
task: "Defeat (P) with a trout on the finishing hit.",
},
rising_costs: {
task: "Hit (P) with a brick.",
hint: "Brick has to hit, a miss won't count.",
},
rolling_in_it: {
task: "Mug (P).",
hint: "Must be a successful mug. Sending them a small amount will guarantee a mug.",
},
safari: {
task: "Defeat (P) with a rifle in South Africa.",
},
scammer: {
task: "Defeat (P).",
hint: "Target might have some nice cash on him, mugging could be beneficial.",
},
sellout_slayer: {
task: "Buy a gun, use the gun on any 2 - 6 players, then sell it again.",
},
sending_a_message: {
task: "Defeat (P).",
},
show_some_muscle: {
task: "Attack (P).",
hint: "You just need to attack the target, defeating them isn't a requirement.",
},
sleep_aid: {
task: "Defeat (P).",
},
some_people: {
task: "Send any item as a parcel to (P).",
},
standard_routine: {
task: "Defeat (P) with a clubbed weapon, fists or kick.",
},
stomach_upset: {
task: "Injure (P)'s stomach.",
},
swan_step_too_far: {
task: "Get an item from the dump and defeat its previous owner.",
hint: "You can keep searching till you find an item previously owned by someone you can actually defeat.",
},
the_executive_game: {
task: "Defeat (P) using only fists or kick.",
hint: "Weapons can stay equipped.",
},
the_tattoo_artist: {
task: "Defeat (P) using only a slashing or piercing weapon.",
hint: "Guns can stay equipped.",
},
three_peat: {
task: "Leave any player, mug any player and hospitalize any player.",
},
training_day: {
task: "Use 250 - 1,250 energy in the gym.",
},
tree_huggers: {
task: "Defeat 5 - 8 (P).",
},
undercutters: {
task: "Defeat 3 (P).",
},
unwanted_attention: {
task: "Hospitalize 4 (P).",
},
withdrawal: {
task: "Injure (P)'s both arms.",
hint: "Hands count as arms in this case.",
},
wrath_of_duke: {
task: "Defeat 4 (P).",
},
};

9
package.json Normal file
View File

@ -0,0 +1,9 @@
{
"name": "wuhu-torn-helper",
"version": "",
"dependencies": {
},
"scripts": {
"uglifyjs": "uglifyjs wuhu-torn-helper.js -o release.min.user.js.js"
}
}

View File

@ -1,256 +0,0 @@
// ==UserScript==
// @name Torn圣诞小镇掉落物品坐标显示
// @namespace WH
// @version 0.2.2
// @description 在地图界面上方显示附近的宝箱、物品、钥匙坐标兼容手机APP Torn PDA及Alook
// @author Woohoo[2687093]
// @match https://www.torn.com/*
// @grant none
// ==/UserScript==
(function () {
'use strict';
const ___window___ = window || window.unsafeWindow;
if (___window___.WHLOOTPOS||___window___.WHTRANS) return;
___window___.WHLOOTPOS = true;
const $ = ___window___.jQuery;
if (/christmas_town\.php/.test(window.location.href)) {
let $root = document.querySelector('#christmastownroot');
const chestTypeDict = {'1': '金', '2': '银', '3': '铜',};
const chestTypeColorDict = {'1': 'gold', '2': 'silver', '3': 'sandybrown',};
const lootTypeDict = {'chests': '钥匙箱', 'gifts': '礼物', 'combinationChest': '密码箱', 'keys': '钥匙',};
const keyTypeDict = {'b': '铜', 's': '银', 'g': '金',};
let dropHist = localStorage.getItem('wh-loot-store')
? JSON.parse(localStorage.getItem('wh-loot-store'))
: {};
const alertSettings = localStorage.getItem('wh-loot-setting')
? JSON.parse(localStorage.getItem('wh-loot-setting'))
: {blink: 'y', sound: 'y', chest: 'y'};
let $ct_wrap;
let soundLoopFlag = false;
const getDOMOb = new MutationObserver(() => {
$ct_wrap = $root.querySelector('#ct-wrap');
if ($ct_wrap) {
getDOMOb.disconnect();
const insert_html = `<div id="wh-loot-container" class="m-bottom10">
<audio src="https://www.torn.com/js/chat/sounds/Chirp_3.mp3" style="display:none"></audio>
<div class="title-black"><span>附近物品</span></div>
<div id="wh-loot-container-main" class="cont-gray">
<b>物品</b><span id="wh-loot-item-count"></span>
<div id="wh-loot-container-items"></div>
<b>箱子</b><span id="wh-loot-chest-count"></span>
<div id="wh-loot-container-chests"></div>
</div>
<div id="wh-loot-container-ex" class="cont-gray wh-hide">
<div><label><input type="checkbox" id="wh-loot-setting-blink" ${alertSettings.blink === 'y' ? 'checked' : ''} /> 闪烁提示</label></div>
<div><label><input type="checkbox" id="wh-loot-setting-sound" ${alertSettings.sound === 'y' ? 'checked' : ''} /> 声音提示 <del>(iOS)</del></label></div>
<div><label><input type="checkbox" id="wh-loot-setting-chest" ${alertSettings.chest === 'y' ? 'checked' : ''} /> 不记录需要钥匙的宝箱</label></div>
<div id="wh-hist">
<div id="wh-hist-clear">
<p><button>清空数据</button>- </p>
</div>
<table><thead><tr><th colspan="5">历史记录</th></tr><tr><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody></tbody></table>
</div>
</div>
<div id="wh-loot-btn" class="cont-gray"><button>设置</button></div>
</div>
<style>
#wh-loot-container-main{padding: 0.5em;}
#wh-loot-container-main div{overflow-x: auto;overflow-y: hidden;white-space: nowrap;min-height: 4em;}
#wh-loot-container-main div span{display: inline-block;background-color: #2e8b57;color: white;margin: 0 1em 0 0;border-radius: 4px;padding: 0.5em;}
#wh-loot-container-main div span img{height: 1em; width: 1em;}
#wh-loot-container-ex{padding: 0.5em;}
#wh-loot-container-ex.wh-hide{display: none;}
#wh-loot-container-ex #wh-hist{overflow-x: auto;}
#wh-loot-container-ex table {margin-top: 0.5em;}
#wh-loot-container-ex tbody {background-color: antiquewhite;}
#wh-loot-container-ex table, #wh-loot-container-ex th, #wh-loot-container-ex td {
padding: 5px;
border: 1px solid black;
height: auto;
}
#wh-loot-container-ex th:nth-child(1) {min-width: 5em;}
#wh-loot-container-ex th:nth-child(2) {min-width: 8em;}
#wh-loot-container-ex th:nth-child(3) {min-width: 4em;}
#wh-loot-container-ex th:nth-child(4) {min-width: 9em;}
#wh-loot-container-ex th:nth-child(5) {min-width: 3em;}
#wh-loot-container-ex thead {
background-color: #2e8b57;
color: white;
}
@keyframes lootFoundAlert {
0% {background: #f2f2f2}
50% {background: #2e8b57}
100% {background: #f2f2f2}
}
</style>`;
$($ct_wrap).before(insert_html);
const $wh_loot_container = $root.querySelector('#wh-loot-container');
const $btn = $wh_loot_container.querySelector('#wh-loot-btn button');
const $clear_btn = $wh_loot_container.querySelector('#wh-hist-clear button');
const $ex = $wh_loot_container.querySelector('#wh-loot-container-ex');
const $tbody = $wh_loot_container.querySelector('tbody');
const $blink = $wh_loot_container.querySelector('#wh-loot-setting-blink');
const $sound = $wh_loot_container.querySelector('#wh-loot-setting-sound');
const $chest = $wh_loot_container.querySelector('#wh-loot-setting-chest');
const $audio = $wh_loot_container.querySelector('audio');
$btn.onclick = e => {
e.target.innerText = e.target.innerText === '设置' ? '收起' : '设置';
$($ex).toggleClass('wh-hide');
e.target.blur();
};
$clear_btn.onclick = e => {
e.target.blur();
dropHist = {};
$tbody.innerHTML = '';
localStorage.setItem('wh-loot-store', JSON.stringify(dropHist));
};
$blink.onchange = e => {
if (e.target.checked) {
alertSettings.blink = 'y';
if ($wh_loot_container.querySelector('#wh-loot-item-count').innerText !== '(0)') {
$wh_loot_container.querySelector('#wh-loot-container-main').style.animation = 'lootFoundAlert 2s infinite';
}
} else {
alertSettings.blink = 'n';
$wh_loot_container.querySelector('#wh-loot-container-main').style.animation = '';
}
localStorage.setItem('wh-loot-setting', JSON.stringify(alertSettings));
};
$sound.onchange = e => {
if (e.target.checked) {
alertSettings.sound = 'y';
if ($wh_loot_container.querySelector('#wh-loot-item-count').innerText !== '(0)') {
soundLoopFlag = true;
}
} else {
alertSettings.sound = 'n';
soundLoopFlag = false;
}
localStorage.setItem('wh-loot-setting', JSON.stringify(alertSettings));
};
$chest.onchange = e => {
alertSettings.chest = e.target.checked ? 'y' : 'n';
localStorage.setItem('wh-loot-setting', JSON.stringify(alertSettings));
};
const soundIntervalID = window.setInterval(() => {
if (soundLoopFlag) $audio.play().then();
}, 1200);
ob.observe($root, {childList: true, subtree: true});
}
});
const ob = new MutationObserver(() => {
ob.disconnect();
// 页面刷新重新获取dom
$root = document.querySelector('#christmastownroot');
$ct_wrap = $root.querySelector('#ct-wrap');
if (!$ct_wrap) {
ob.observe($root, {childList: true, subtree: true});
return;
}
const $ct_title = $ct_wrap.querySelector('.status-title');
const $pos = $ct_wrap.querySelector('.map-title span[class^="position___"]') || $ct_wrap.querySelector('.status-title span[class^="position___"]');
if (!$pos) {
ob.observe($root, {childList: true, subtree: true});
return;
}
const $pos_spl = $pos.innerText.trim().split(',');
const player_position = {};
player_position.x = parseInt($pos_spl[0]);
player_position.y = parseInt($pos_spl[1]);
const $wh_loot_container = $root.querySelector('#wh-loot-container');
if (!$wh_loot_container) {
console.error('掉落助手未找到DOM容器');
ob.observe($root, {childList: true, subtree: true});
return;
}
const $blink = $wh_loot_container.querySelector('#wh-loot-setting-blink');
const $sound = $wh_loot_container.querySelector('#wh-loot-setting-sound');
const $chest = $wh_loot_container.querySelector('#wh-loot-setting-chest');
const $tbody = $wh_loot_container.querySelector('tbody');
const nearby_arr = [];
const items = $root.querySelectorAll('div.grid-layer div.items-layer div.ct-item');
// 附近的所有物品
items.forEach(el => {
const item_props = {x: 0, y: 0, name: '', type: '', url: '',};
item_props.x = parseInt(el.style.left.replaceAll('px', '')) / 30;
item_props.y = -parseInt(el.style.top.replaceAll('px', '')) / 30;
item_props.url = el.firstElementChild.src;
const srcSpl = item_props.url.trim().split('/');
item_props.name = srcSpl[6];
item_props.type = srcSpl[8].slice(0, 1);
nearby_arr.push(item_props);
});
const $wh_loot_container_items = $wh_loot_container.querySelector('#wh-loot-container-items');
const $wh_loot_container_chests = $wh_loot_container.querySelector('#wh-loot-container-chests');
let item_count = 0, chest_count = 0;
$wh_loot_container_items.innerHTML = '';
$wh_loot_container_chests.innerHTML = '';
nearby_arr.forEach(nearby_item => {
let path = '=';
if (nearby_item.x < player_position.x && nearby_item.y < player_position.y) path = '↙';
else if (nearby_item.x < player_position.x && nearby_item.y === player_position.y) path = '←';
else if (nearby_item.x < player_position.x && nearby_item.y > player_position.y) path = '↖';
else if (nearby_item.x === player_position.x && nearby_item.y > player_position.y) path = '↑';
else if (nearby_item.x > player_position.x && nearby_item.y > player_position.y) path = '↗';
else if (nearby_item.x > player_position.x && nearby_item.y === player_position.y) path = '→';
else if (nearby_item.x > player_position.x && nearby_item.y < player_position.y) path = '↘';
else if (nearby_item.x === player_position.x && nearby_item.y < player_position.y) path = '↓';
let item_name;
if (nearby_item.name === 'chests') {
chest_count++;
item_name = chestTypeDict[nearby_item.type] + lootTypeDict[nearby_item.name];
$wh_loot_container_chests.innerHTML += `<span style="background-color: ${chestTypeColorDict[nearby_item.type] || 'silver'};">${path}[${nearby_item.x},${nearby_item.y}] ${item_name}<img src="${nearby_item.url}" /></span>`
} else {
item_count++;
item_name = (nearby_item.name === 'keys' ? keyTypeDict[nearby_item.type] || '' : '') + lootTypeDict[nearby_item.name] || nearby_item.name;
$wh_loot_container_items.innerHTML += `<span>${path}[${nearby_item.x},${nearby_item.y}] ${item_name}<img src="${nearby_item.url}" /></span>`
}
// 确认地图坐标存在
if ($ct_title) {
const hist_key = `[${nearby_item.x},${nearby_item.y}]"${$ct_title.firstChild.nodeValue.trim()}"${item_name}`;
const el = dropHist[hist_key];
if (el) {
if (path === '=' && (nearby_item.name === 'keys' || nearby_item.name === 'gifts')) {
el.isPassed = true;
}
} else {
if (!(nearby_item.name === 'chests' && $chest.checked)) {
const now = new Date();
dropHist[hist_key] = {
pos: `[${nearby_item.x},${nearby_item.y}]`,
map: $ct_title.firstChild.nodeValue.trim(),
last: `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()} ${now.getHours()}:${now.getMinutes()}:${now.getSeconds()}`,
name: item_name,
id: Object.keys(dropHist).length,
};
}
}
}
});
$wh_loot_container.querySelector('#wh-loot-item-count').innerText = `(${item_count})`;
if (item_count === 0) {
$wh_loot_container_items.innerText = '暂无';
$wh_loot_container.querySelector('#wh-loot-container-main').style.animation = '';
soundLoopFlag = false;
} else {
if ($blink.checked) $wh_loot_container.querySelector('#wh-loot-container-main').style.animation = 'lootFoundAlert 2s infinite';
if ($sound.checked) soundLoopFlag = true;
}
$wh_loot_container.querySelector('#wh-loot-chest-count').innerText = `(${chest_count})`;
if (chest_count === 0) $wh_loot_container_chests.innerText = '暂无';
const history = Object.keys(dropHist).map(key => dropHist[key]).sort((a, b) => a.id - b.id);
let table_html = '';
history.forEach(e => {
table_html += `<tr><td>${e.pos}</td><td>${e.map}</td><td>${e.name}</td><td>${e.last}</td><td>${e.isPassed ? '已取得' : '不确定'}</td></tr>`;
});
$tbody.innerHTML = table_html;
localStorage.setItem('wh-loot-store', JSON.stringify(dropHist));
ob.observe($root, {childList: true, subtree: true});
});
getDOMOb.observe($root, {childList: true, subtree: true});
}
}());

View File

@ -1,324 +0,0 @@
// ==UserScript==
// @name Torn圣诞小镇解密攻略
// @namespace WH
// @version 0.1.1
// @description 显示解密攻略
// @author Woohoo[2687093]
// @match https://www.torn.com/*
// @grant none
// ==/UserScript==
(function () {
'use strict';
const ___window___ = window || window.unsafeWindow;
if (___window___.WHXMAS||___window___.WHTRANS) return;
___window___.WHXMAS = true;
const $ = ___window___.jQuery;
if (/christmas_town\.php/.test(window.location.href)) {
const $root = document.querySelector('#christmastownroot');
const $city_wrapper = $root.querySelectorAll('div[class^="core-layout__"]');
const insert_html = `<div id="wh-xmas-cont">
<div class="title-black"><span>水晶球解密地图攻略</span><span><button style="color: white">[]</button></span></div>
<div class="cont-gray">
<select>
<option value="None">未选择</option>
<option value="Christmas Town">Christmas Town</option>
<option value="Maltese Snow Globe">Maltese Snow Globe</option>
<option value="Long way from home">Long way from home</option>
<option value="Chedburn Towers">Chedburn Towers</option>
<option value="Kidnapped Santa">Kidnapped Santa</option>
<option value="Holiday terror">Holiday terror</option>
<option value="Among Us">Among Us</option>
<option value="Kiss My Festivus">Kiss My Festivus</option>
<option value="Stanley Hotel">Stanley Hotel</option>
<option value="DoggoQuest">DoggoQuest</option>
<option value="Pokemon CT">Pokemon CT v2.0</option>
<option value="Winter in Gatlin">Winter in Gatlin</option>
</select>
<div>
<p>来源Torn City公众号图文详情请查看公众号文章</p>
<div id="wt-content"></div>
</div>
</div>
<hr class="page-head-delimiter m-top10 m-bottom10 r1854">
</div>
<style>
#wh-xmas-cont .cont-gray{
padding: 0.5em;
}
#wh-xmas-cont p,#wh-xmas-cont select,#wh-xmas-cont li{
margin: 0 0 3px;
}
</style>`;
const wt_dict = {
"None": {title: '', wt: ``,},
"Christmas Town": {
title: '圣诞小镇', wt: `<ul>
<li>旧攻略提到的驯鹿车已被移除只能手动找一条蓝色的小路[94,3]</li>
<li>向南走然后上木桥沿着它向西走到达冰湖</li>
<li>在冰湖[55,7][61,64]附近找Labyrinth传送门进入迷宫</li>
<li>迷宫的出口在中间的方向[395,397]一个冰湖走进冰湖传送</li>
<li>走到企鹅</li>
</ul>`,
},
"Maltese Snow Globe": {
title: 'Maltese Snow Globe', wt: `<ul>
<li>1.想办法进入前几层的楼梯口</li>
<li>2.出来之后往南走 在码头找到天鹅船</li>
<li>3.按着数字1-12走过乐高博物馆</li>
<li>4.跟着大路走到天鹅船</li>
<li>5.走到901,486的银行</li>
<li>6.最左上的楼梯</li>
<li>7.B-D-C-E-F-G-C-A</li>
<li>8.</li>
<li>9.走到右上角铁路</li>
<li>10.小游戏:</li>
<li>移动1到最右移动2到中间移动1到2上面,移动3到最右,移动1到最左,移动2到3.上面移动1到2上面</li>
<li>11.往上走出铁丝网往左绕一个大圈走到300,476</li>
<li>12.走到363,406的隧道走到361,400的隧道 ,往南走</li>
<li>13.走到352,334的迷宫好像有好几条路,我说我的走法往左下走,走倒最下了往右走走到1个不一样的绿色的时候往上走</li>
<li>14.走到迷宫中间的小人后面就只有一条路走了完成</li>
</ul>`,
},
"Long way from home": {
title: 'Long way from home', wt: `<ul>
<li>1.随便动一下</li>
<li>2.左边的管道口</li>
<li>3.右走到十字路口往上往右从偏左的那个管道往上</li>
<li>3.出小门往右到底往上到底往右,进上面房间右上角的电脑电脑显示的是下面房间的走法任意移动退出</li>
<li>4.去下面房间右边橙色电力符号进入解密右下右下右上右上右下右下左下,左下</li>
<li>,左下左下进圈</li>
<li>5.进入新的房间按钮</li>
<li>6.一直左走走到有两个怪兽把手的桥那进上面的房间左上角的机器*是重输密码</li>
<li>作者随时改密码建议看纸条上的提示自己去数</li>
<li>7.桥上怪兽消失, 往左走到底按钮</li>
<li>8.右走走到雪地走大路按钮开铁门上darkforest的蓝车</li>
<li>9.右走十几步传送</li>
<li>10.右下走,看到铁丝网顺着铁丝网右走有个缺口进去</li>
<li>11.右走直到看见三颗倒下的圣诞树(记住这里)顺着血迹和脚印走,进山洞</li>
<li>12.顺着山洞走到一滩血原路出山洞</li>
<li>13.原路回到三颗倒下的圣诞树正上方有个红色仓库,进入</li>
<li>14.,,路就通了去拿到右上角的锯子原路出仓库</li>
<li>15.出来就在车下面上车再上车</li>
<li>16.左边的小橘人完成</li>
</ul>`,
},
"Chedburn Towers": {
title: 'Chedburn Towers', wt: `<ul>
<li>进入地图后使用附近的FAST的T下方的厕所传送到Chedburn Towers</li>
<li>进入大厅"之"字形上楼每层都是如此</li>
<li>最终会进入问答题区域通过在相应的数字上穿过来回答问题</li>
<li>答案是3 9 5 4 9 2 6 8</li>
<li>答题后进入Ched的办公室向西走然后一直走到左边的楼梯上</li>
<li>向南走下楼梯然后向东走沿着小楼梯到地下室</li>
<li>向东走到牢房区域</li>
<li>先踩下开关打开牢房门前往右上角的最后一个牢房</li>
<li>开关位于JAIL文字的左上方</li>
<li>沿着挖出来的隧道一直走岔路口向左走</li>
<li>到金库Chedburn NPC会给你本地图的水晶球</li>
</ul>`,
},
"Kidnapped Santa": {
title: 'Kidnapped Santa', wt: `<ul>
<li>出生在一个类似城镇的地方</li>
<li>沿着这条路向东走然后向南走</li>
<li>到达道路尽头的一个码头时向西走一段路踩在精灵的上面乘坐渡船[124, -30]</li>
<li>搭船来到了Fantasy Island</li>
<li>小心那个游荡的<span style="color: #32CD32">绿色NPC</span></li>
<li>向西走然后向北走再向西绕过岩石要非常小心不要踩到水里或掉下悬崖否则你会死</li>
<li>然后回到南边在那里你会看到一些门</li>
<li>走进蓝色的门(左二)[111-60]</li>
<li>过了蓝门后继续沿路向南</li>
<li>然后沿路向东再向南</li>
<li>再向东走会看到恐怖之家进入这栋楼[137, -84]</li>
<li>向北走进入洞口[164, -81]</li>
<li>穿过隧道到达另一端的洞穴口[142, -63]<b>避开所有怪物和NPC</b></li>
<li>来到另一个岛上</li>
<li>向南走然后向东绕过建筑物可以进入圣诞老人的洞穴[133, -2]</li>
<li>在建筑物内向西走再向北走在圣诞老人家work shop的东北角你会看到一个楼梯走下去[1694]</li>
<li>在这一区域<b>要避开所有出现破损或有异样的地砖</b>NPC</li>
<li>沿着地牢里的走廊向东走然后向南走避开所有看起来不同的瓷砖</li>
<li>它们上面有一些小裂缝和花纹如果你是用手机的话我建议你把亮度调高以防万一</li>
<li>最终会看到一个发绿光的小开关</li>
<li>走到开关上[165, 18]激活它然后进入向北打开的大门</li>
<li>走到<span style="color: gold">黄色精灵NPC</span>[16625]</li>
</ul>`,
},
"Holiday terror": {
title: 'Holiday terror', wt: `<ul>
<li>1. 从出生地沿着路向东然后向北过桥并沿着穿过城镇的小路继续前行避开任何明显的陷阱道路上的洞打开的井盖等</li>
<li>2. 继续向东和向北前进直到到达 Mansion's Labyrinth豪宅迷宫[121,29]</li>
<li>3. 豪宅入口在[131,41]</li>
<li>4. 进入豪宅后向北走你会看到一条由骷髅守卫的道路</li>
<li>5. 沿着棕色的小路走在黑色的<b>区域前</b></li>
<li>6. 按照如下的方式行进</li>
<li> 上3格左2上2右4下1右3上6左2下1左6下2左2上4右5上4</li>
<li>7. 来到一个区域在这里你必须在两个洞穴中做出选择</li>
<li>第一次选择答案是Christmas Miracle选择左边的洞窟</li>
<li>第二次选择答案是24/12/2019选择左边的洞窟</li>
<li>第三次选择答案是Hohoho Coldington选择右边的洞窟</li>
<li>第四次选择答案是Christmas Miracle Cave选择左边的洞窟</li>
<li>8. 出现在一个用糖果棒装饰的红色地板的房间里去地图的右上角一个冰洞的入口[101-74]</li>
<li>9. 进入冰洞向西走寻找叫Erik the last elf的黄色小NPC</li>
<li>10. 拿到水晶球</li>
</ul>`,
},
"Among Us": {
title: 'Among Us', wt: `<ul>
<li>出生点步行到传送点进入地图 1 [399,12]</li>
<li>到达地图1你出现在食堂往下走绕到红色按钮处[502-1]</li>
<li>答案D B A A D D B B B C A D D D 最终: B (Green)</li>
<li>然后你会被传送到地图2</li>
<li>在地图2中你需要沿着小路向南走然后向东进入通风口前往下一个部分[55624]</li>
<li>穿过通风口后进入食堂向南走到红色按钮所在的位置 [571,32]</li>
<li>答题阶段答案如下BBACBDC A</li>
<li>被传送到地图3</li>
<li>先直接向南走一点再沿着走廊走进入左边的一个通风口[345170]</li>
<li>会传送到办公室在那里找到最后一个红色按钮[356173]</li>
<li>答题阶段答案如下CCADABBCD</li>
<li>进入"PEEP SHOW"获得本地图的水晶球</li>
</ul>`,
},
"Kiss My Festivus": {
title: 'Kiss My Festivus', wt: `<ul>
<li>从起点出发沿着小路向北走到出租车处乘坐前往Dark Forest的出租车 [96,16]</li>
<li>沿着公路向东走继续向东进入雪地</li>
<li>沿着暗淡的蓝色轨迹向东南方向走穿过树林直到你到达一个铁栅栏[坐标为114,-89]</li>
<li>铁栅栏进不去有人会告诉你乘坐他们的雪地车</li>
<li>向西走到雪地车旁注意不要踩到任何<b>冬青树</b>()</li>
<li>被传送到锯木厂在伐木工那里获得钥匙</li>
<li>然后向南走然后向东走向东走很长一段路沿着小路返回铁栅栏处</li>
<li>来到一个炫酷的45°视角迷宫你要走到地图的东北部抵达另一个洞穴口[156,-74]</li>
<li>先往左下方走到岔路口然后往右上方走接下来将只有一条路</li>
<li>到达岛屿沿着小楼梯上去绕到正下方那艘天鹅船</li>
<li>到一个新的岛屿向南走几步踩在[12, -79]的蓝色火花上</li>
<li>被传送到另一个有几辆拖车的岛上</li>
<li>向北走进入一个新的山洞口</li>
<li>人被挡住了要在冰层下向西北方向一直走主要是向上和向左走</li>
<li>沿着这条路一直往上走然后在开阔的地方往东走你会看到一座房子[房子的入口在26,58]</li>
<li>进入房子向北走几步穿过闪闪发光的入口你就可以进入房子了</li>
<li>沿着东南方向走你会看到Evil-Duck NPC他将给你本地图的水晶球</li>
</ul>`,
},
"Stanley Hotel": {
title: 'Stanley Hotel', wt: `<ul>
<li>从起点开始你会看到正北方有一座房子向北走几步到门前进入房子</li>
<li>传送到一个有门的地方绕过并向上走激活位于[188,72]的大门开关</li>
<li>向东北方向前进沿着血迹穿过森林直到你到达一个山洞</li>
<li>依次使用使用防御踩盾牌标记然后攻击然后魔法闪亮的蓝色气泡来杀死怪物</li>
<li>最后你会来到工人Bob的房间他将给你本地图的水晶球</li>
</ul>`,
},
"DoggoQuest": {
title: 'DoggoQuest', wt: `<ul>
<li>你出现在一个房间里</li>
<li>向东走然后向南走沿着小走廊就可以离开这个房间</li>
<li>来到这个地牢的01层</li>
<li>首先向南走然后绕过墙攻击你看到的第一个怪物[101,1]</li>
<li>然后向西走到墙边向北攻击<span style="color: #32CD32">史莱姆</span></li>
<li>继续向北攻击下一个<span style="color: gold">怪物</span></li>
<li>向北走到拐角处然后向东走到楼梯处继续前进[坐标为101,1]</li>
<li>来到第二层直接向东走上楼梯[11-19]</li>
<li>来到了这个地牢的第03层</li>
<li>向东再向南走到墙边然后向东走与绿色<span style="color: #32CD32">史莱姆</span></li>
<li>继续向东走经过被打败的史莱姆然后向南和向西绕过墙向北走一格向西打败另一个<span style="color: #32CD32">史莱姆</span></li>
<li>向西南方向走下楼梯[53-49]</li>
<li>来到了第 04 </li>
<li>走到墙边撞右边两个镣铐之间的墙然后向北直接走到墙里[15-65]</li>
<li>直接向北走踏上红色的东西</li>
<li>沿着楼梯向南和东南方向走右边楼梯[39-69]</li>
<li>来到第5层</li>
<li>向北走然后向西绕过中间的十字架向南走到下一个楼梯[29-93]</li>
<li>来到第 6 </li>
<li>杀死那只<span style="color: #32CD32">大绿狗</span></li>
<li>回到刚才的楼梯来到05层[33-114]</li>
<li>在第05层你会看到原来的十字架位置附近出现了新的楼梯口</li>
<li>走上该楼梯[54, -99]</li>
<li>到达了最后的</li>
<li>沿着小路向下走然后沿着冰冷的台阶走到Rudolph NPC</li>
<li>在他身边来回走动</li>
<li>踩在他身上的次数足够多时Rudolph会把该图的水晶球交给你</li>
</ul>`,
},
"Pokemon CT": {
title: 'Pokemon CT', wt: `<ul>
<li>宝可梦新增了战斗系统路过高草丛会几率进入战斗</li>
<li>战斗系统为一个十字形界面技能/精灵球捕捉逃跑回血攻击</li>
<li>战斗守则攻击当你血量为33时回血</li>
<li>打败最终BOSS需要捕捉两只捕捉地点</li>
<li>把包裹交给大木博士后去常磐市的路上</li>
<li>进入森林后遇到的毛毛虫</li>
<li>捕捉时需要将其打到残血</li>
<li>最终BOSS打法</li>
<li>第一个敌方精灵毛虫进化的蝴蝶先放技能使其眩晕在眩晕期间攻击一旦醒过来就眩晕重复</li>
<li>第一个BOSS死后第二个BOSS会秒杀蝴蝶 此时用第二个精灵</li>
<li>第二个精灵打法:攻击看见它放absorbing技能就去回血(当然你没血了也要去回血)重复</li>
<li>游戏开始</li>
<li>出生在你房间的二楼</li>
<li>下楼梯离开房间走出家门从那里向东北方向进入高草丛将被传送到大木博士Professor Oak的实验室</li>
<li>踩大木博士</li>
<li>踏上桌子选择你的宝可梦</li>
<li>现在出门去常磐市Veridian City拿一个包裹</li>
<li>离开大木博士的实验室向北走穿过草地前往常磐市Veridian City</li>
<li>进入城市后前往 Poke Mart [134-3]</li>
<li>回到大木博士的实验室返回时可以跳下小路西侧的山崖避开高草丛</li>
<li>把包裹交给大木博士后回常磐市</li>
<li>在房子和两个精灵之间的小路上继续向北走穿过城市[79,-21]</li>
<li>过了精灵后一路向北</li>
<li>进入一所房子经过它才能进入常磐森林</li>
<li>穿过常磐森林才能到达尼比市</li>
<li>森林的入口向东走直到看到高草然后向北走直到下一片高草</li>
<li>绕过树木向东走然后向北走</li>
<li>现在绕过树木向西走然后向北走</li>
<li>然后穿过草地向西和向南走</li>
<li>沿着这条小路蜿蜒穿过高高的草丛</li>
<li>沿着小路穿过草地最终离开森林</li>
<li>离开森林后沿着草丛旁小路向北走到达 Pewter City向北向西绕到大房子处到达道馆</li>
<li>走到大胡桃夹子前挑战小刚</li>
<li>赢得这场战斗后你会被带到大木博士那里他会给本地图的水晶球</li>
</ul>`,
},
"Winter in Gatlin": {
title: 'Winter in Gatlin', wt: `<ul>
<li>从出生点出发</li>
<li>往右走到达树林往右上走跨过铁栅栏再往右走经过红车时从右边缝隙穿过往下走</li>
<li>沿公路向下走到第一个岔路向右走到废弃的小屋[14,80]</li>
<li>进入小屋时你会在一个黑色的小房间里走到亮起的圆圈处</li>
<li>在下一个房间里会有一连串的数字按以下顺序走到数字上</li>
<li>1,4,6,8,7,6,4</li>
<li>在最后一个房间Epic_Heasley NPC 会给你本图的水晶球</li>
</ul>`,
},
};
$city_wrapper.forEach(el => {
let $wh_container = $root.querySelector('#wh-xmas-cont');
if (!$wh_container) {
$(el).prepend(insert_html);
$wh_container = $root.querySelector('#wh-xmas-cont');
// 显示 隐藏
const jquery$wh_container = $($wh_container);
const $cont_gray = jquery$wh_container.find('.cont-gray');
jquery$wh_container.find('button').click(e => {
if (e.target.innerText === '[隐藏]') {
$cont_gray.hide();
e.target.innerText = '[显示]';
} else {
$cont_gray.show();
e.target.innerText = '[隐藏]';
}
});
// 内容
const $wt_content = jquery$wh_container.find('#wt-content');
jquery$wh_container.find('select').change(e => {
const selected = e.target.value;
$wt_content.html(`<p><b>${wt_dict[selected].title}</b></p><p>${wt_dict[selected].wt}</p>`)
});
}
});
}
}());

12
tpl.js
View File

@ -1,12 +0,0 @@
function template() {
if (window.location.href.contains(/[]/)) {
// 标题和右边的链接
const $cont_title = document.querySelector('.content-title');
initOB($cont_title, {childList: true, subtree: true},
() => {
titleTrans();
contentTitleLinksTrans();
});
return;
}
}

File diff suppressed because one or more lines are too long