Melvor Better Tooltips

Adds extra useful information to some of the game's tooltips.

  1. // ==UserScript==
  2. // @name Melvor Better Tooltips
  3. // @description Adds extra useful information to some of the game's tooltips.
  4. // @version 1.3
  5. // @author OldAbblis#6012
  6. // @namespace http://tampermonkey.net/
  7. // @match https://melvoridle.com/*
  8. // @match https://www.melvoridle.com/*
  9. // @match https://test.melvoridle.com/*
  10. // @noframes
  11. // @grant none
  12. // ==/UserScript==
  13. /* jshint esversion: 6 */
  14.  
  15. ((main) => {
  16. var script = document.createElement('script');
  17. script.textContent = `try { (${main})(); } catch (e) { console.log(e); }`;
  18. document.body.appendChild(script).parentNode.removeChild(script);
  19. })(() => {
  20. 'use strict';
  21.  
  22. function betterTooltips() {
  23. createItemInformationTooltip = (itemID, showStats = false) => {
  24. let potionCharges = "", description = "", spec = getItemSpecialAttackInformation(itemID), hp = "", passive = "", html = "", baseStats = "", totalPrice = "", remainingCharges = "";
  25. const item = items[itemID];
  26.  
  27. if (showStats && item.isEquipment)
  28. baseStats = getItemBaseStatsBreakdown(itemID);
  29. if (item.isPotion)
  30. potionCharges = "<small class='text-warning'>" + templateString(getLangString("MENU_TEXT", "POTION_CHARGES"), {charges: `${items[itemID].potionCharges}`}) + "</small><br>";
  31. if (item.description !== undefined)
  32. description = "<small class='text-info'>" + items[itemID].description + "</small><br>";
  33. if (isFood(item))
  34. hp = "<img class='skill-icon-xs ml-2' src='" + CDNDIR + "assets/media/skills/hitpoints/hitpoints.svg'><span class='text-success'>+" + player.getFoodHealing(item) + "</span>";
  35. if (isEquipment(item) && item.validSlots.includes("Passive") && equipmentSlotData.Passive.unlocked)
  36. passive = '<br><small class="text-success">' + getLangString("MENU_TEXT", "PASSIVE_SLOT_COMPATIBLE") + "</small>";
  37. if (isEquipment(item) && item.validSlots.includes("Gloves") && item.name.includes("ing Gloves"))
  38. remainingCharges = '<small class="badge badge-info">' + formatNumber(glovesTracker[items[itemID].gloveID].remainingActions) + " Charges</small>";
  39. if (getBankQty(itemID) !== 1)
  40. totalPrice = "(" + numberWithCommas(getItemSalePrice(itemID) * getBankQty(itemID)) + ")";
  41.  
  42. html += `<div class="text-center">
  43. <div class="media d-flex align-items-center push">
  44. <div class="mr-3">
  45. <img class="bank-img m-1" src="${getItemMedia(itemID)}">
  46. </div>
  47. <div class="media-body">
  48. <div class="font-size-sm">
  49. ${remainingCharges}
  50. </div>
  51. <div class="font-w600">
  52. ${items[itemID].name} <span style="font-weight: 400 !important">
  53. (ID: ${itemID})
  54. </span>
  55. </div>
  56. ${potionCharges}
  57. ${description}
  58. ${spec}
  59. <div class="font-size-sm">
  60. <img class="skill-icon-xs" src="${CDNDIR}assets/media/main/coins.svg"> ${numberWithCommas(getItemSalePrice(itemID))} ${totalPrice}
  61. <br>
  62. ${hp}
  63. ${passive}
  64. <br>
  65. </div>
  66. ${baseStats}
  67. </div>
  68. </div>
  69. </div>`;
  70.  
  71. return html;
  72. }
  73. }
  74.  
  75. function loadScript() {
  76. if (typeof confirmedLoaded !== 'undefined' && confirmedLoaded) {
  77. clearInterval(interval);
  78. console.log('Loading Melvor Better Tooltips script');
  79. betterTooltips();
  80. }
  81. }
  82.  
  83. const interval = setInterval(loadScript, 500);
  84. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址