NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Classed Raider list // @namespace http://tampermonkey.net/ // @version 0.4 // @description try to take over the world! // @author You // @match http://armory.warmane.com/* // @grant none // ==/UserScript== (function() { 'use strict'; function extractRaiderList() { var ranksToSkip = ['Flex Raider', 'Officer', 'Guild Master', 'Alt', 'Social']; var constantRaiders = [ {name: 'Svartkuk', class: 'Priest'}, {name: 'Exai', class: 'Druid'}, {name: 'Redink', class: 'Warlock'}, {name: 'Masquadetv', class: 'Paladin'} ]; var raiders = []; jQuery('#data-table-list tr').each(function() { var tr = $(this); var rank = tr.find('td:eq(5)').text().trim(); if (ranksToSkip.some(r => r == rank)) { return; } var name = tr.find('td:eq(0) a').text(); var klass = tr.find('td:eq(2) img').attr('alt'); raiders.push({name: name, class: klass}); }); return raiders.concat(constantRaiders); } function createEmptyListHtml() { return ` <div class="stats"></div> <ul id="raider-list"> <li> <ul class="shaman"> </ul> </li> <li> <ul class="warlock"> </ul> </li> <li> <ul class="hunter"> </ul> </li> <li> <ul class="warrior"> </ul> </li> <li> <ul class="priest"> </ul> </li> <li> <ul class="druid"> </ul> </li> <li> <ul class="mage"> </ul> </li> <li> <ul class="paladin"> </ul> </li> <li> <ul class="rogue"> </ul> </li> </ul>`; } function createListStyle() { return ` <style> .stats { padding-left: 0px; color: #c1b575; } ul#raider-list { margin-top: 10px; margin-bottom: 0px; height: 100%; width: 100%; float: left; } ul#raider-list, ul#raider-list ul { list-style: none; height: 100%; padding: 10px; font-size: 16px; color: #ddd; } ul#raider-list li ul { height: 100%; display: inline-block; float: left; } ul#raider-list li ul.warrior a { color: #C79C6E; } ul#raider-list li ul.warlock a { color: #9482C9; } ul#raider-list li ul.shaman a { color: #0070DE; } ul#raider-list li ul.rogue a { color: #FFF569; } ul#raider-list li ul.priest a { color: #FFFFFF; } ul#raider-list li ul.paladin a { color: #F58CBA; } ul#raider-list li ul.mage a { color: #69CCF0; } ul#raider-list li ul.hunter a { color: #ABD473; } ul#raider-list li ul.druid a { color: #FF7D0A; } ul#raider-list li ul a:hover { opacity: 0.85; } ul#raider-list li ul li { padding: 0 0 5px 0; } </style>`; } function appendListToGuildInfo() { var listHtml = createEmptyListHtml(); var listStyle = createListStyle(); jQuery('head').append(listStyle); jQuery('#guild-sheet h3').after(jQuery(listHtml)); var raiders = extractRaiderList(); raiders.forEach(raider => { var listItemHtml = `<li><a href='/character/${raider.name}/Outland/profile'>${raider.name}</a></li>`; jQuery(`#raider-list ul.${raider.class.toLowerCase()}`).append(listItemHtml); }); jQuery('.stats').html(`<div class="stats">Total: ${raiders.length}</div>`); } if (jQuery('#guild-sheet .name').text() == 'Marbles') { appendListToGuildInfo(); } jQuery('.model').remove(); })();