此脚本已于Github上维护 NTwiki - Hide the got ship.user.js
怎么办,好像又写了个很无聊的脚本。。。
看介绍就知道了。。。
(对,图鉴中没有开的还有这么多船QAQ ←对,所以我要开始打捞了
// ==UserScript==
// @name Hide the got ship in ntwiki
// @namespace http://blog.rhilip.info
// @version 20170126
// @description 在舰少数据库中隐藏已经打捞到的船只(had)
// @author Rhilip
// @match http://js.ntwikis.com/jsp/apps/cancollezh/maps/detailnew.jsp?detailid=*
// ==/UserScript==
nothave = [6,14,15,17,78,79,89,
101,102,103,104,113,114,115,116,118,119,120,121,127,145,148,151,155,160,169,172,174,181,184,187,188,196,197,199,
203,207,211,214,218,220,221,222,226,229,237,247,249,261,267,271,272,277,280,289,
302,303,306,308];
$.getJSON("http://static.jianrmod.cn/ShortShipInfo.json",function (json) {
var origin = json;
cidlist = {};
for (var i=0;i<origin.length;i++) {
cidlist[origin[i].pic_id] = origin[i];
}
});
function wrapship() {
var ship = $("ul#map-detail-dropinfos > li > p > a:even");
var ship_rep = ship.next("a");
for(var i=0;i<ship.length;i++){
var ship_id = ship_rep.eq(i).attr("onclick").match(/,'(\d+)',/)[1];
ship_rep.eq(i).attr("href","http://www.jianrmod.cn/data/shipGetInfo.html?type=0&cid=" + cidlist[ship_id].cid).attr("target",'_blank');
var ship_class = "<span class='ship_" + ship_id +"'></span>";
$([ship[i],ship[i].nextSibling,ship_rep[i],ship_rep[i].nextSibling]).wrapAll(ship_class);
}
}
function hideship() {
$("ul#map-detail-dropinfos > li.ui-li-divider.ui-bar-inherit.ui-first-child")
.append("<div style=\"display:inline-block;float:right\" id='hidehave'>隐藏已捞出船只</div>");
$("div#hidehave").click(function () {
if ($(this).text().match(/隐藏已捞出船只/)){
wrapship();
for (var i=0;i<nothave.length;i++){
$("span[class=ship_"+nothave[i]+"]").addClass("nothave");
}
$("span[class^=ship_]:not(.nothave)").hide();
$(this).text("显示已隐藏的船只");
}else {
$("span[class^=ship]:hidden").show();
$(this).text("隐藏已捞出船只");
}
}).click();
}
function check() {
if (!$("div#hidehave").html()) {
hideship();
}
}
$(document).ready(function(){
setInterval(check,1000);
});
/**
* Created by Rhilip on 01/25/17.
*/
其实上没写完啦,准备把jianrmod的打捞数据给联动起来,到时候再看情况修改吧~