// ==UserScript== // @name Soulforged Skill Decimals // @description Changes the skill level display to show decimal places // @version 1 // @include *://soulforged.net:8443/* // @namespace soulforged.net // @grant none // @author Zap // @downloadURL none // ==/UserScript== //assuming there is just the one window.addEventListener("click", waitDecimalizeSkills); function waitDecimalizeSkills() { //hope the DOM and all the required content is updated after a bit setTimeout(decimalizeSkills, 25); } function decimalizeSkills() { var indicators = document.getElementsByClassName("skill-indicator"); //iterate all skill indicators for(var indicator of indicators) { //find the bar element and extract the fill percentage var width = indicator.getElementsByClassName("skill-meter")[0].getElementsByClassName("meter-clip")[0].style.width; var percentage = width.substring(0, width.length - 1); //eliminate percentage sign var skillDecimal = parseInt(indicator.getElementsByClassName("skill-level")[0].innerHTML) + (percentage / 100) indicator.getElementsByClassName("skill-level")[0].innerHTML = skillDecimal.toFixed(3); indicator.getElementsByClassName("skill-level")[0].style.fontSize = "35%"; } }