更新主页

更新版本号,发布
This commit is contained in:
woohoo 2021-11-04 21:47:15 +08:00
parent 5497c8139f
commit 810f8b070b

View File

@ -47,7 +47,7 @@
$('#skip-to-content')[0].firstChild.nodeValue += '飞行中'; $('#skip-to-content')[0].firstChild.nodeValue += '飞行中';
//飞行提示小文章 //飞行提示小文章
document.querySelector("#mainContainer > div.content-wrapper.logged-out.left.autumn.travelling > div.travel-agency-travelling > div.popup-info > div.inner-popup").textContent = '\nOne of the main requirements for a wedding to take place in Torn is the procurement of a ring. You may either purchase one from the Jewellery Store, or you can choose the more romantic option of stealing one, which requires far more effort if you think about it.\t' //document.querySelector("#mainContainer > div.content-wrapper.logged-out.left.autumn.travelling > div.travel-agency-travelling > div.popup-info > div.inner-popup").textContent = '\nOne of the main requirements for a wedding to take place in Torn is the procurement of a ring. You may either purchase one from the Jewellery Store, or you can choose the more romantic option of stealing one, which requires far more effort if you think about it.\t'
document.querySelector("#mainContainer > div.content-wrapper.logged-out.left.autumn.travelling > div.travel-agency-travelling > div.popup-info > div.inner-popup").textContent = document.querySelector("#mainContainer > div.content-wrapper.logged-out.left.autumn.travelling > div.travel-agency-travelling > div.popup-info > div.inner-popup").textContent =
tipsDict[document.querySelector("#mainContainer > div.content-wrapper.logged-out.left.autumn.travelling > div.travel-agency-travelling > div.popup-info > div.inner-popup").textContent]; tipsDict[document.querySelector("#mainContainer > div.content-wrapper.logged-out.left.autumn.travelling > div.travel-agency-travelling > div.popup-info > div.inner-popup").textContent];
@ -136,6 +136,8 @@
$('#pointsMerits')[0].firstChild.nodeValue = '[使用]'; $('#pointsMerits')[0].firstChild.nodeValue = '[使用]';
if ($('#pointsPoints').length !== 0) if ($('#pointsPoints').length !== 0)
$('#pointsPoints')[0].firstChild.nodeValue = '[使用]'; $('#pointsPoints')[0].firstChild.nodeValue = '[使用]';
if ($('#pointsLevel').length !== 0)
$('#pointsLevel')[0].firstChild.nodeValue = '[升级]';
clearInterval(sidebarInterval); clearInterval(sidebarInterval);
}, 1000); }, 1000);
@ -179,11 +181,39 @@
}, 500); }, 500);
/** /**
* 主页 * 主页 todo
*/ */
if (window.location.href.indexOf('index.php') >= 0 && if (window.location.href.indexOf('index.php') >= 0 &&
$('h4#skip-to-content').text().indexOf('Home') >= 0) { $('h4#skip-to-content').text().indexOf('Home') >= 0) {
const homeDict = {
'General Information': '基本信息',
'Property Information': '房产信息',
'Battle Stats': '战斗能力BS',
'Working Stats': '工作能力WS',
'Equipped Armor': '已装防具',
'Equipped Weapons': '已装武器',
'Skill Levels': '技能等级',
'Latest Messages': '近期信息',
'Job Information': '工作信息',
'Latest Events': '近期通知',
'Latest Attacks': '近期攻击',
'Faction Information': '帮派信息',
'Criminal Record': '犯罪记录',
'Personal Perks': '个人加成',
};
let homeEvents=null;
$('h5.box-title').each((i, e) => {
if (!homeDict[e.firstChild.nodeValue]) return;
if(e.firstChild.nodeValue==='Latest Events') {
homeEvents = $(e).parent().next().find('span');
//console.log($(e).parent().next().children().children().children().find('span'));
//console.log($(e).parent().next().find('span'));
}
e.firstChild.nodeValue = homeDict[e.firstChild.nodeValue];
});
eventsTrans(homeEvents);
} }
@ -191,10 +221,10 @@
* 通知 * 通知
*/ */
if (window.location.href.indexOf('events.php') >= 0) { if (window.location.href.indexOf('events.php') >= 0) {
let events;// = $('span.mail-link'); let events;
const eventMutation = new MutationObserver(() => { const eventMutation = new MutationObserver(() => {
events = $('span.mail-link'); events = $('span.mail-link');
eventsTrans(); eventsTrans(events);
}); });
//初始化中内容未加载 //初始化中内容未加载
@ -205,12 +235,14 @@
} }
clearInterval(eventInterval); clearInterval(eventInterval);
eventMutation.observe($('div#events-main-wrapper')[0], {childList: true, subtree: true}); eventMutation.observe($('div#events-main-wrapper')[0], {childList: true, subtree: true});
eventsTrans(); eventsTrans(events);
}, 1000); }, 1000);
}
function eventsTrans() { function eventsTrans(events) {
if (events.length === 0) return; if (events.length === 0) return;
events.each((i, e) => { events.each((i, e) => {
//console.log($(e).text());
/** /**
* 赛车 * 赛车
* You finished 5th in the Hammerhead race. Your best lap was 01:14.87. * You finished 5th in the Hammerhead race. Your best lap was 01:14.87.
@ -299,11 +331,10 @@
* You were sent a Diamond Bladed Knife from charapower * You were sent a Diamond Bladed Knife from charapower
*/ */
if ($(e).text().indexOf('sent') >= 0) { if ($(e).text().indexOf('sent') >= 0) {
if ($(e).text().indexOf('someone') >= 0) return; // todo 收到匿名发来的物资
const isWithMsg = $(e).text().indexOf('message') >= 0; const isWithMsg = $(e).text().indexOf('message') >= 0;
const msg = isWithMsg ? $(e).text().split(' with the message: ')[1] : null; const msg = isWithMsg ? $(e).text().split(' with the message: ')[1] : null;
const wordsList = e.firstChild.nodeValue.split(' '); const wordsList = e.firstChild.nodeValue.split(' ');
console.log(wordsList);
// 发送的数量 // 发送的数量
let number; let number;
if (wordsList[3] === 'some' || wordsList[3] === 'a') // 收到一个可数的不可堆叠或不可数的东西 if (wordsList[3] === 'some' || wordsList[3] === 'a') // 收到一个可数的不可堆叠或不可数的东西
@ -313,7 +344,6 @@
else else
number = null; number = null;
const item = number === null ? wordsList.slice(3, wordsList.length - 2) : wordsList.slice(4, wordsList.length - 2); const item = number === null ? wordsList.slice(3, wordsList.length - 2) : wordsList.slice(4, wordsList.length - 2);
console.log(item);
// 你收到了来自someone的【数量】物品附带信息xxx。 // 你收到了来自someone的【数量】物品附带信息xxx。
e.firstChild.nodeValue = '你收到了来自 '; e.firstChild.nodeValue = '你收到了来自 ';
@ -432,7 +462,7 @@
*/ */
if ($(e).text().indexOf('mugged') >= 0) { if ($(e).text().indexOf('mugged') >= 0) {
const spl = $(e).text().trim().split(' '); const spl = $(e).text().trim().split(' ');
if (spl.length > 7) return; // 多人运动暂时跳过 if (spl.length > 7) return; // todo 多人运动暂时跳过
const money = spl[spl.length - 2]; const money = spl[spl.length - 2];
if (spl[0] === 'Someone') { // 被匿名mug if (spl[0] === 'Someone') { // 被匿名mug
e.firstChild.nodeValue = '有人打劫了你 ' + money + ' ['; e.firstChild.nodeValue = '有人打劫了你 ' + money + ' [';
@ -546,12 +576,47 @@
return; return;
} }
if ($(e).text().indexOf('organized crime') >= 0) { // oc开启 /**
* oc开启
* You have been selected by
* <a href="profiles.php?XID=2537542" class="h" i-data="i_346_233_63_14">endlessway</a>
* to participate in an organized crime. You, along with 2 others will make up the team to
* <a href="organisedcrimes.php" i-data="i_312_248_107_14">make a bomb threat</a>
* in 72 hours.
*
* 你被endlessway选中参与一项有组织的犯罪活动你和另外两个人将组成一个团队在72小时内进行炸弹威胁
*/
if ($(e).text().indexOf('organized crime') >= 0) {
const time = e.childNodes[4].nodeValue.split(' ')[2];
const OCName = e.childNodes[3].firstChild.nodeValue; // todo 汉化
let others = e.childNodes[2].nodeValue.split(' ')[10];
others = others === 'one' ? '1' : others;
e.firstChild.nodeValue = '你被 ';
e.childNodes[2].nodeValue = ' 选中参与一项组织犯罪OC。你和另外' + others + '人将组成一个团队,在' + time + '小时后进行';
e.childNodes[4].nodeValue = '。';
return; return;
} }
if ($(e).text().indexOf('You and your team') >= 0) { // oc结束
/**
* oc结束
* - You and your team tried to make a bomb threat but failed! View the details
* - You and your team successfully blackmailed someone! View the details
* <a href="organisedcrimes.php?step=log&amp;ID=9404419" i-data="i_595_234_24_14">here</a>
* !
*/
if ($(e).text().indexOf('You and your team') >= 0) {
let rs = '成功';
let OCName = e.firstChild.nodeValue.slice(31, -19);
if ($(e).text().indexOf('fail') >= 0) {
rs = '失败';
OCName = e.firstChild.nodeValue.slice(27, -30);
}
e.firstChild.nodeValue = '你和团队的组织犯罪OC' + OCName + ' ' + rs + '了!';
e.childNodes[1].firstChild.nodeValue = '点此查看详情';
e.childNodes[2].nodeValue = '';
return; return;
} }
/** /**
* bust 捞人 * bust 捞人
* <a href="profiles.php?XID=2208715">Spookyt</a> * <a href="profiles.php?XID=2208715">Spookyt</a>
@ -566,6 +631,37 @@
return; return;
} }
/**
* 保释
*/
if ($(e).text().indexOf('bailed') >= 0) {
const cost = e.childNodes[1].nodeValue.trim().slice(27, -1);
e.childNodes[1].nodeValue = ' 花费 ' + cost + ' 保释了你。';
return;
}
/**
* 人物升级
* <span class="mail-link" id="event-865162632">Congratulations! You upgraded your level to 31!
</span>
*/
if ($(e).text().indexOf('upgraded') >= 0) {
const level = e.firstChild.nodeValue.slice(44, -2);
e.firstChild.nodeValue = '恭喜!你已升至' + level + '级!';
return;
}
/**
* 开新健身房
* <span class="mail-link" id="event-855834754">You have successfully purchased membership in Deep Burn.</span>
* 你已成功购买Deep Burn的健身房会员卡
*/
if ($(e).text().indexOf('membership') >= 0) {
const gymName = e.firstChild.nodeValue.slice(46, -2);
e.firstChild.nodeValue = '你已成功购买 ' + gymName + ' 的健身房会员卡。';
return;
}
/** /**
* new virus病毒 * new virus病毒
* You completed the Simple Virus which is now in your inventory. You can begin programming a new virus * You completed the Simple Virus which is now in your inventory. You can begin programming a new virus
@ -585,8 +681,25 @@
if ($(e).text().indexOf('doorstep') >= 0) { // 蓝星奖励 if ($(e).text().indexOf('doorstep') >= 0) { // 蓝星奖励
return; return;
} }
/**
* 加入帮派结果
*/
if ($(e).text().indexOf('join the faction') >= 0) {
const virusName = e.childNodes[2].nodeValue.trim().split(' ')[2];
const rsDict = {'accepted': '通过', 'declined': '拒绝',};
e.firstChild.nodeValue = '加入帮派 ';
e.childNodes[2].nodeValue = ' 的申请已' + rsDict[virusName] + '。';
return;
}
}); });
} }
/**
* 升级页面
*/
if (window.location.href.indexOf('level2.php') >= 0) {
} }
})(); })();