Last active
May 20, 2025 17:13
-
-
Save Tcip/0c6fc898075e660bd51ef397f298363b to your computer and use it in GitHub Desktop.
Embervale Bounties XP per Stamina Calculator (All value. Sorted best to worst)
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%20bountyInfoItems%20%3D%20document.querySelectorAll(%22.bounty-information-text-item%5Bdata-v-489b16b8%5D%22)%2CtitleContainers%20%3D%20document.querySelectorAll(%22.bounty-title-container%5Bdata-v-489b16b8%5D%20span%5Bdata-v-489b16b8%5D%22)%2Cstyles%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%20getBountyInfo(t)%20%7Bconst%20n%20%3D%20titleContainers%5Bt%5D%2Co%20%3D%20bountyInfoItems%5B6%20*%20t%20%2B%205%5D%2Ce%20%3D%20bountyInfoItems%5B6%20*%20t%20%2B%202%5D%3Bif%20(!n)%20return%20console.warn(%60Title%20element%20at%20index%20%24%7Bt%7D%20not%20found.%60)%2C%20null%3Bif%20(!o%20%7C%7C%20!e)%20return%20console.warn(%60Bounty%20ratio%20or%20amount%20element%20at%20index%20%24%7Bt%7D%20not%20found.%60)%2C%20null%3Blet%20r%2C%20a%3Btry%20%7Br%20%3D%20parseFloat(o.lastChild.textContent.trim())%2C%20a%20%3D%20parseFloat(e.lastChild.textContent.trim())%7D%20catch%20(n)%20%7Breturn%20console.error(%60Error%20parsing%20bounty%20values%20at%20index%20%24%7Bt%7D%3A%60%2C%20n)%2C%20null%7Dif%20(isNaN(r)%20%7C%7C%20isNaN(a)%20%7C%7C%200%20%3D%3D%3D%20a)%20return%20console.warn(%60Invalid%20bounty%20values%20at%20index%20%24%7Bt%7D.%20%20Ratio%3A%20%24%7Br%7D%2C%20Amount%3A%20%24%7Ba%7D%60)%2C%20null%3Bconst%20i%20%3D%20r%20%2F%20a%3Breturn%20%7Btitle%3A%20n.textContent.replace(%22Humanoid%22%2C%20%22%22)%2CbountyPerUnit%3A%20i%7D%7Dconst%20bountyData%20%3D%20%5B%5D%3Bfor%20(let%20t%20%3D%200%3B%20t%20%3C%20titleContainers.length%3B%20t%2B%2B)%20%7Bconst%20n%20%3D%20getBountyInfo(t)%3Bn%20%26%26%20bountyData.push(n)%7DbountyData.sort(((t%2C%20n)%20%3D%3E%20n.bountyPerUnit%20-%20t.bountyPerUnit))%2C%20bountyData.forEach((t%20%3D%3E%20%7Bconsole.log(%60%25c%24%7Bt.title%7D%25c%24%7Bt.bountyPerUnit.toFixed(4)%7D%60%2C%20styles.maxBountyRatio%2C%20styles.maxTitle)%7D))%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 bountyInfoItems = document.querySelectorAll(".bounty-information-text-item[data-v-489b16b8]"), | |
| titleContainers = document.querySelectorAll(".bounty-title-container[data-v-489b16b8] span[data-v-489b16b8]"), | |
| 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 getBountyInfo(t) { | |
| const n = titleContainers[t], | |
| o = bountyInfoItems[6 * t + 5], | |
| e = bountyInfoItems[6 * t + 2]; | |
| if (!n) return console.warn(`Title element at index ${t} not found.`), null; | |
| if (!o || !e) return console.warn(`Bounty ratio or amount element at index ${t} not found.`), null; | |
| let r, a; | |
| try { | |
| r = parseFloat(o.lastChild.textContent.trim()), a = parseFloat(e.lastChild.textContent.trim()) | |
| } catch (n) { | |
| return console.error(`Error parsing bounty values at index ${t}:`, n), null | |
| } | |
| if (isNaN(r) || isNaN(a) || 0 === a) return console.warn(`Invalid bounty values at index ${t}. Ratio: ${r}, Amount: ${a}`), null; | |
| const i = r / a; | |
| return { | |
| title: n.textContent.replace("Humanoid", ""), | |
| bountyPerUnit: i | |
| } | |
| } | |
| const bountyData = []; | |
| for (let t = 0; t < titleContainers.length; t++) { | |
| const n = getBountyInfo(t); | |
| n && bountyData.push(n) | |
| } | |
| bountyData.sort(((t, n) => n.bountyPerUnit - t.bountyPerUnit)), bountyData.forEach((t => { | |
| console.log(`%c${t.title}%c${t.bountyPerUnit.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 all the XP per Stamina ratio in a sorted list by Best to Worst for the Bounties in the game Embervale. If you want to display only the best ratio 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.maxTitleBounties XP per Stamina Calculator (Bookmarklet) 3.jsis nowBounties XP per Stamina Calculator (Bookmarklet).jsBounties XP per Stamina Calculator 3.jsis nowBounties XP per Stamina Calculator.js