// ==UserScript== // @name 체섭 집합 도우미 // @namespace https://hided.net // @version 0.933 // @author Hide_D // @updateURL https://hided.net/gs_script/62che/plugin_troop.tamper.js // @description 부대 편성에서 암행부를 연동해 편리하게 볼 수 있습니다. // @match http://62che.com/sam/*/b_troop.php // @match http://www.62che.com/sam/*/b_troop.php // @match http://222.122.81.157/sam/*/b_troop.php // @match http://sam-tm.com/che/*/b_troop.php // @match http://www.sam-tm.com/che/*/b_troop.php // @copyright 2014+, HideD // @require http://code.jquery.com/jquery-1.11.1.min.js // ==/UserScript== //바뀐건 없다 $(function(){ var userList = {}; var groupList = {}; var tGroup = []; var basicPath = document.location.pathname.substr(0,9); var $userFrame; if(unsafeWindow){ unsafeWindow.$ = $; unsafeWindow.groupList = groupList; unsafeWindow.userList = userList; } var aGroup = {}; $('table:eq(1) tr:gt(0):lt(-1)').each(function(idx){ var $this = $(this); //console.log(this); //console.log($this); if(idx%3 == 0){ aGroup = { turn : '77:77', turnTime : 5555, 부대장 : '에러-집합장없음', 부대명 : '에러-부대명없음', srclist : [], 도시 : '없지롱', list: [], trs:[] }; aGroup.trs.push($this); var $children = $this.children(); var names = $.trim($children.eq(1).text()).split('【'); var 부대명 = $.trim(names[0]); var 도시 = $.trim(names[1].substr(0,names[1].length-1)); aGroup.도시 = 도시; aGroup.부대명 = 부대명; aGroup.obj = $this; aGroup.$users = $children.eq(3); var lists = $.trim($children.eq(3).text()).split(', '); lists.pop(); aGroup.srcList = lists; } else if(idx%3 == 1){ aGroup.trs.push($this); var turnBase = $this.children().eq(0).text().split('】')[1]; //console.log(turnBase); var userName = $this.children().eq(1).text(); var turn = turnBase; var turnMS = turnBase.split(':'); var turnM = parseInt(turnMS[0]); var turnS = parseInt(turnMS[1]); var turnTime = turnM*60+turnS; aGroup.turn = turn; aGroup.turnTime = turnTime; aGroup.부대장 = userName; aGroup.obj2 = $this; groupList[aGroup.부대명] = aGroup; tGroup.push(aGroup); } else{ if($this.find('input').length==0){ $this.detach(); } } }); $.each(tGroup,function(idx,val){ console.log(val); for(var i=0;i'); }); $tbody.find('tr:eq(-1)').detach(); $tbody.append($last); var runAnalysis = function(){ $.each(groupList,function(idx,val){ val.list = []; }); userList = []; var $content = $('#on_mover .content'); $content.html(''); $.get(basicPath+'b_genList.php',function(rawData){ try{ $html = $(rawData); var cnt =0; var tmpUsers = {}; $html.each(function(idx){ if(this.tagName == "TABLE"){ cnt+=1; if(cnt==2){ tmpUsers = $(this); return false; } } }); tmpUsers.find("tr:gt(0)").each(function(idx){ var $this = $(this); var $부대 = $this.children().eq(2); var 부대 = $.trim($부대.text()); if(부대 == '-'){ //부대 안탔음! return true; } $부대.remove(); var $name = $this.children('td:eq(0)'); $name.addClass('nameplate'); var name = $name.html(); var $tmpFont = $name.find('font'); if($tmpFont.length>0){ name = $tmpFont.text(); } else{ name = $.trim(name.substr(0,name.indexOf('
Lv '))); } var $도시 = $this.children().eq(4); var 도시 = $.trim($도시.text()); var $턴 = $this.children().eq(12); //console.log($턴); var 턴0 = $턴.text().split(':'); var 턴 = parseInt(턴0[0])*60 + parseInt(턴0[1]); var userInfo = { 이름 : name, 부대 : 부대, 도시 : 도시, 턴 : 턴, obj : $this }; groupList[부대].list.push(userInfo); userList[name] = userInfo; $this.hide(); $content.append($this); }); $.each(groupList,function(부대명,aGroup){ aGroup.$users.html(''); $.each(aGroup.list,function(idx,userInfo){ var $user = $(''); var $userName = $user.children('.name'); if(userInfo.이름 == aGroup.부대장){ $userName.html('*'+userInfo.이름+'*'); $userName.css('color','lightgreen'); } else{ $userName.html(userInfo.이름); } if(userInfo.도시 != aGroup.도시){ $userName.css('color','red'); $user.children('.other').html('【'+userInfo.도시+'】'); } $user.hover(function(){ var top = aGroup.obj2.offset().top + aGroup.obj2.outerHeight(); $userFrame.css('top',top); userInfo.obj.show(); $userFrame.show(); console.log('올림!'+userInfo.이름); },function(){ $userFrame.hide(); userInfo.obj.hide(); console.log('내림!'+userInfo.이름); }); $user.append(', '); aGroup.$users.append($user); }); aGroup.$users.append('('+aGroup.list.length+'명)'); }); } catch(err){ console.log(err); } }); }; var $frame = $('table:eq(0) td:eq(0)'); $frame.find('br:last').remove(); var $btn = $(''); $btn.click(function(){ runAnalysis(); }); $frame.append($btn); $userFrame = $('
'+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
이 름통무지자 금군 량도시병 종병 사훈련사기명 령삭턴
'); $userFrame.find('thead td').css('background-image','url(http://jwh1807.vipweb.kr/images/back_green.jpg)'); $userFrame.css('width','900px').css('margin','0').css('padding','0').css('left','50%').css('margin-left','-450px'); $userFrame.hide(); $('body').append($userFrame); });