// ==UserScript== // @name MouseHunt - SEH Loot Counter for Hunting Log // @author Jia Hao (Limerence#0448 @Discord) // @author plasmoidia#7296 // @namespace https://greasyfork.org/en/users/165918-jia-hao // @version 1.2 // @description Counts the number of unique loot you have in your daily hunting log. // @include https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js // @include http://www.mousehuntgame.com/* // @include https://www.mousehuntgame.com/* // @downloadURL https://update.greasyfork.icu/scripts/381058/MouseHunt%20-%20SEH%20Loot%20Counter%20for%20Hunting%20Log.user.js // @updateURL https://update.greasyfork.icu/scripts/381058/MouseHunt%20-%20SEH%20Loot%20Counter%20for%20Hunting%20Log.meta.js // ==/UserScript== //Appends loot count into the journal entry itself function countLoot() { var logEntry = $("a:contains('More details')"); if (logEntry.length == 0) return; //Find the JSON string for the loot obtained. Parse into JSON and iterate to count the loot var lootRawString = logEntry.attr('onclick').match(/{.*?}/gm)[2]; var lootJSON = JSON.parse(lootRawString); var counter = 0; for (var loot in lootJSON) counter++; //compute total number of hunts var parentTr = logEntry.parent().parent(); const journalLog = parentTr.parent()[0]; const values = journalLog.getElementsByClassName('value'); const catches = parseInt(values[0].childNodes[0].data); const fta = parseInt(values[1].childNodes[0].data); const misses = parseInt(values[2].childNodes[0].data); const hunts = catches + misses + fta; //HTML magic var htmlString = `