Last active
May 20, 2025 18:00
-
-
Save Tcip/5966aa8018e53e832d3118c30720b23e to your computer and use it in GitHub Desktop.
Embervale Bounties XP per Stamina Calculator (Best value only)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function()%7Bconst%20elements%20%3D%20document.querySelectorAll(%22.bounty-information-text-item%5Bdata-v-489b16b8%5D%22)%3Bconst%20titleContainers%20%3D%20document.querySelectorAll(%22.bounty-title-container%5Bdata-v-489b16b8%5D%22)%3Bconst%20styles%20%3D%20%7BmaxBountyRatio%3A%20'background%3A%23000%3Bcolor%3A%23fff%3Bpadding%3A1px%3Bborder%3A1px%20solid%20%23000%3Bborder-radius%3A3px%200%200%203px'%2CmaxTitle%3A%20'background%3A%23fff%3Bcolor%3A%23000%3Bpadding%3A1px%3Bborder%3A1px%20solid%20%23000%3Bborder-radius%3A0%203px%203px%200'%7D%3Bfunction%20logBountyInfo(index)%20%7Bconst%20rewardElement%20%3D%20elements%5Bindex%20*%206%20%2B%205%5D%3Bconst%20requirementElement%20%3D%20elements%5Bindex%20*%206%20%2B%202%5D%3Bif%20(!rewardElement%20%7C%7C%20!requirementElement%20%7C%7C%20!rewardElement.lastChild%20%7C%7C%20!requirementElement.lastChild)%20%7Bconsole.error(%60Invalid%20elements%20at%20index%20%24%7Bindex%7D%60)%3Breturn%20null%3B%7Dconst%20reward%20%3D%20parseFloat(rewardElement.lastChild.textContent)%3Bconst%20requirement%20%3D%20parseFloat(requirementElement.lastChild.textContent)%3Bif%20(isNaN(reward)%20%7C%7C%20isNaN(requirement))%20%7Bconsole.error(%60Invalid%20numerical%20values%20at%20index%20%24%7Bindex%7D%60)%3Breturn%20null%3B%7Dreturn%20reward%20%2F%20requirement%3B%7Dlet%20maxBountyRatio%20%3D%20-Infinity%3Blet%20maxTitle%20%3D%20%22%22%3Bfor%20(let%20i%20%3D%200%3B%20i%20%3C%20titleContainers.length%3B%20i%2B%2B)%20%7Bconst%20bountyInfo%20%3D%20logBountyInfo(i)%3Bif%20(bountyInfo%20!%3D%3D%20null%20%26%26%20bountyInfo%20%3E%20maxBountyRatio)%20%7BmaxBountyRatio%20%3D%20bountyInfo%3BmaxTitle%20%3D%20titleContainers%5Bi%5D.textContent.trim().replace(%22Humanoid%22%2C%20%22%22)%3B%7D%7Dconsole.log(%60%25c%20Max%20XP%20ratio%20%25c%20%24%7BmaxBountyRatio.toFixed(4)%7D%20%25c%60%2C%20styles.maxBountyRatio%2C%20styles.maxTitle%2C%20'background%3Atransparent'%2C%20maxTitle)%7D)() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function()%7Bconst%20infoTextItem%20%3D%20document.querySelectorAll(%22.bounty-information-text-item%5Bdata-v-489b16b8%5D%22)%3Bconst%20titleContainers%20%3D%20document.querySelectorAll(%22.bounty-title-container%5Bdata-v-489b16b8%5D%20span%5Bdata-v-489b16b8%5D%22)%3Bconst%20styles%20%3D%20%7BmaxBountyRatio%3A%20'background%3A%23000%3Bcolor%3A%23fff%3Bpadding%3A1px%206px%3Bborder%3A1px%20solid%20%23000%3Bborder-radius%3A3px%200%200%203px'%2CmaxTitle%3A%20'background%3A%23fff%3Bcolor%3A%23000%3Bpadding%3A1px%206px%3Bborder%3A1px%20solid%20%23000%3Bborder-radius%3A0%203px%203px%200'%7D%3Bfunction%20logBountyInfo(index)%20%7Bconst%20rewardElement%20%3D%20infoTextItem%5Bindex%20*%206%20%2B%205%5D%3Bconst%20requirementElement%20%3D%20infoTextItem%5Bindex%20*%206%20%2B%202%5D%3Bif%20(!rewardElement%20%7C%7C%20!requirementElement%20%7C%7C%20!rewardElement.lastChild%20%7C%7C%20!requirementElement.lastChild)%20%7Bconsole.error(%60Invalid%20elements%20at%20index%20%24%7Bindex%7D%60)%3Breturn%20null%3B%7Dconst%20reward%20%3D%20parseFloat(rewardElement.lastChild.textContent)%3Bconst%20requirement%20%3D%20parseFloat(requirementElement.lastChild.textContent)%3Bif%20(isNaN(reward)%20%7C%7C%20isNaN(requirement))%20%7Bconsole.error(%60Invalid%20numerical%20values%20at%20index%20%24%7Bindex%7D%60)%3Breturn%20null%3B%7Dreturn%20reward%20%2F%20requirement%3B%7Dlet%20maxBountyRatio%20%3D%20-Infinity%3Blet%20maxTitle%20%3D%20%22%22%3Bfor%20(let%20i%20%3D%200%3B%20i%20%3C%20titleContainers.length%3B%20i%2B%2B)%20%7Bconst%20bountyInfo%20%3D%20logBountyInfo(i)%3Bif%20(bountyInfo%20!%3D%3D%20null%20%26%26%20bountyInfo%20%3E%20maxBountyRatio)%20%7BmaxBountyRatio%20%3D%20bountyInfo%3BmaxTitle%20%3D%20titleContainers%5Bi%5D.textContent.trim().replace(%22Humanoid%22%2C%20%22%22)%3B%7D%7Dconsole.log(%60%25c%24%7BmaxTitle%7D%25c%24%7BmaxBountyRatio.toFixed(4)%7D%60%2C%20styles.maxBountyRatio%2C%20styles.maxTitle)%7D)() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const elements = document.querySelectorAll(".bounty-information-text-item[data-v-489b16b8]"); | |
| const titleContainers = document.querySelectorAll(".bounty-title-container[data-v-489b16b8]"); | |
| const styles = { | |
| maxBountyRatio: 'background:#000;color:#fff;padding:1px;border:1px solid #000;border-radius:3px 0 0 3px', | |
| maxTitle: 'background:#fff;color:#000;padding:1px;border:1px solid #000;border-radius:0 3px 3px 0' | |
| }; | |
| function logBountyInfo(index) { | |
| const rewardElement = elements[index * 6 + 5]; | |
| const requirementElement = elements[index * 6 + 2]; | |
| if (!rewardElement || !requirementElement || !rewardElement.lastChild || !requirementElement.lastChild) { | |
| console.error(`Invalid elements at index ${index}`); | |
| return null; | |
| } | |
| const reward = parseFloat(rewardElement.lastChild.textContent); | |
| const requirement = parseFloat(requirementElement.lastChild.textContent); | |
| if (isNaN(reward) || isNaN(requirement)) { | |
| console.error(`Invalid numerical values at index ${index}`); | |
| return null; | |
| } | |
| return reward / requirement; | |
| } | |
| let maxBountyRatio = -Infinity; | |
| let maxTitle = ""; | |
| for (let i = 0; i < titleContainers.length; i++) { | |
| const bountyInfo = logBountyInfo(i); | |
| if (bountyInfo !== null && bountyInfo > maxBountyRatio) { | |
| maxBountyRatio = bountyInfo; | |
| maxTitle = titleContainers[i].textContent.trim().replace("Humanoid", ""); | |
| } | |
| } | |
| console.log(`%c Max XP ratio %c ${maxBountyRatio.toFixed(4)} %c`, styles.maxBountyRatio, styles.maxTitle, 'background:transparent', maxTitle); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const infoTextItem = document.querySelectorAll(".bounty-information-text-item[data-v-489b16b8]"); | |
| const titleContainers = document.querySelectorAll(".bounty-title-container[data-v-489b16b8] span[data-v-489b16b8]"); | |
| const styles = { | |
| maxBountyRatio: 'background:#000;color:#fff;padding:1px 6px;border:1px solid #000;border-radius:3px 0 0 3px', | |
| maxTitle: 'background:#fff;color:#000;padding:1px 6px;border:1px solid #000;border-radius:0 3px 3px 0' | |
| }; | |
| function logBountyInfo(index) { | |
| const rewardElement = infoTextItem[index * 6 + 5]; | |
| const requirementElement = infoTextItem[index * 6 + 2]; | |
| if (!rewardElement || !requirementElement || !rewardElement.lastChild || !requirementElement.lastChild) { | |
| console.error(`Invalid elements at index ${index}`); | |
| return null; | |
| } | |
| const reward = parseFloat(rewardElement.lastChild.textContent); | |
| const requirement = parseFloat(requirementElement.lastChild.textContent); | |
| if (isNaN(reward) || isNaN(requirement)) { | |
| console.error(`Invalid numerical values at index ${index}`); | |
| return null; | |
| } | |
| return reward / requirement; | |
| } | |
| let maxBountyRatio = -Infinity; | |
| let maxTitle = ""; | |
| for (let i = 0; i < titleContainers.length; i++) { | |
| const bountyInfo = logBountyInfo(i); | |
| if (bountyInfo !== null && bountyInfo > maxBountyRatio) { | |
| maxBountyRatio = bountyInfo; | |
| maxTitle = titleContainers[i].textContent.trim().replace("Humanoid", ""); | |
| } | |
| } | |
| console.log(`%c${maxTitle}%c${maxBountyRatio.toFixed(4)}`, styles.maxBountyRatio, styles.maxTitle) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Embervale Bounties XP per Stamina Calculator
Displays the best XP per Stamina ratio for the Bounties in the game Embervale. If you want to display the ratio for all the Bounties use this one
Usage
Changelog
titleContainersfrom displaying the text HumanoidtitleContainersfrom displaying wrong children property. Which caused text from the parent element to be displayed (a lot of useless text)styles.maxBountyRatio,styles.maxTitleelementstoinfoTextItemBounties XP per Stamina Calculator (Bookmarklet) 2.jsis nowBounties XP per Stamina Calculator (Bookmarklet) Mini.jsBounties XP per Stamina Calculator 2.jsis nowBounties XP per Stamina Calculator Mini.js