Target Corruption

Reroll to whatever corruption you want!

当前为 2021-04-02 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Target Corruption
  3. // @namespace http://tampermonkey.net
  4. // @match https://melvoridle.com
  5. // @match https://melvoridle.com/*
  6. // @match https://www.melvoridle.com/*
  7. // @match https://test.melvoridle.com/*
  8. // @grant none
  9. // @version 1.02
  10. // @author Gardens#3738
  11. // @description Reroll to whatever corruption you want!
  12. // ==/UserScript==
  13.  
  14. window.targetReroll = function(equipmentSlot, targetMods, rollsLeft = 100, lastMods = "default") {
  15. let cost = getRandomModifierCost(equipmentSlot);
  16. let element = document.getElementById("corruption-equipment-slot-" + equipmentSlot);
  17. // if modding possible
  18. if (rollsLeft > 0 && gp >= cost && equippedItems[equipmentSlot] > 0) {
  19. // let currentText;
  20. // get current mods
  21. if (lastMods == "default")
  22. lastMods = element.innerHTML;
  23.  
  24. // reroll
  25. getEquipmentCorruption(equipmentSlot);
  26.  
  27. let modHTML = element.innerHTML;
  28. // if same mods or bad mods, reroll
  29. let goodMod = false;
  30. for (let child of element.children) {
  31. if (child.outerHTML.indexOf("success") != -1) {
  32. for (let targetMod of targetMods) {
  33. if (child.innerHTML.toLowerCase().indexOf(targetMod) != -1) {
  34. goodMod = true;
  35. }
  36. }
  37. }
  38. }
  39.  
  40. if (goodMod == false || modHTML == lastMods) {
  41. setTimeout(() => {
  42. targetReroll(equipmentSlot, targetMods, rollsLeft - 1, modHTML)
  43. }, 50);
  44. } else
  45. return;
  46. }
  47. }
  48.  
  49. // usage:
  50. // targetReroll(2, ["mining", "doubling", "preservation", "smithing"], 200)

QingJ © 2025

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