// ==UserScript== // @name Macro Combat Compacter // @namespace kol.interface.unfinished // @description Compacts the divisions shown when using fight macros in KoL, displaying only the last. // @include http://*kingdomofloathing.com/fight.php* // @include http://127.0.0.1:*/fight.php* // @version 0.0.1.20140812160455 // @downloadURL https://update.greasyfork.icu/scripts/4144/Macro%20Combat%20Compacter.user.js // @updateURL https://update.greasyfork.icu/scripts/4144/Macro%20Combat%20Compacter.meta.js // ==/UserScript== //Version 1.1 // - also now shows effect gains/losses //Version 1.0 function compact() { var hrs = document.evaluate( '//hr', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null); var stuff = []; var ids = 1; // gather contents for (var i=hrs.snapshotLength-1;i>=0;i--) { var hr2 = hrs.snapshotItem(i); var itemids = ""; stuff[i] = document.createElement('div'); stuff[i].setAttribute('class','compactDiv'); while (hr2.previousSibling && hr2.previousSibling.tagName!='HR' && hr2.previousSibling.tagName!='BR') { var n = hr2.previousSibling; n.parentNode.removeChild(n); if (stuff[i].firstChild) stuff[i].insertBefore(n,stuff[i].firstChild); else stuff[i].appendChild(n); } stuff[i].setAttribute('style','display:none'); hr2.parentNode.insertBefore(stuff[i],hr2); hr2.addEventListener('click',expandDivH,true); hr2.setAttribute('title','click to display round '+(i+1)); var r = findAcquires(stuff[i]); if (r.length>0) { for (var j=0;j0) { for (var i=0;i0) { for (var i=0;i