Melvor MakeX

Make X Crafts

  1. // ==UserScript==
  2. // @name Melvor MakeX
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.0.3
  5. // @description Make X Crafts
  6. // @author Breindahl#2660
  7. // @match https://*.melvoridle.com/*
  8. // @grant none
  9. // ==/UserScript==
  10. /* jshint esversion: 6 */
  11.  
  12. (main => {
  13. var script = document.createElement('script');
  14. script.textContent = `try {(${main})();} catch (e) {console.log(e);}`;
  15. document.body.appendChild(script).parentNode.removeChild(script);
  16. })(() => {
  17.  
  18. // Note that this script is made for MelvorIdle version 0.16.3
  19.  
  20. // Loading script
  21. console.log('Melvor MakeX Loaded');
  22.  
  23. // Function to send notifications
  24. function notify(msg) {
  25. One.helpers('notify', {
  26. type: 'dark',
  27. from: 'bottom',
  28. align: 'center',
  29. message: msg
  30. });
  31. }
  32.  
  33. // Funtion to check if task is complete
  34. function taskComplete() {
  35. if (window.makeLeft === 0) {
  36. notify("Task Done");
  37. console.log('task done');
  38. let ding = new Audio("https://www.myinstants.com/media/sounds/ding-sound-effect.mp3");
  39. ding.volume=0.1;
  40. ding.play();
  41. window.makeLeft = Infinity;
  42. }
  43. }
  44.  
  45. const skillVerbs = [
  46. // {name: 'Woodcutting', verb: 'Cut', selected: 'Log'},
  47. // {name: 'Fishing', verb: 'Fish', selected: 'Fish'},
  48. // {name: 'Cooking', verb: 'Cook', selected: 'Food'},
  49. // {name: 'Mining', verb: 'Mine', selected: 'Food'},
  50. {name: 'Smithing', verb: 'Smith', selected: 'Smith'},
  51. // {name: 'Thieving', verb: 'Thieve', selected: 'Thieve'},
  52. {name: 'Fletching', verb: 'Fletch', selected: 'Fletch'},
  53. {name: 'Crafting', verb: 'Craft', selected: 'Craft'},
  54. {name: 'Runecrafting', verb: 'Create', selected: 'Runecraft'},
  55. {name: 'Magic', verb: 'Cast', selected: 'AltMagic'},
  56. {name: 'Herblore', verb: 'Brew', selected: 'Herblore'}
  57. ];
  58.  
  59.  
  60. let TempContainerMakeX = ['<small class="mr-2" id="','"><button type="button" class="btn btn-warning m-3" onclick="setMakeX(',');">','</button></small>'];
  61. $("#craft-item-have").parent().parent().parent().children().last().children().first().children().first().after(TempContainerMakeX[0]+"CraftX"+TempContainerMakeX[1]+"'Crafting'"+TempContainerMakeX[2]+"Craft X"+TempContainerMakeX[3]);
  62. $("#smith-item-have").parent().parent().parent().children().last().children().first().children().first().after(TempContainerMakeX[0]+"SmithX"+TempContainerMakeX[1]+"'Smithing'"+TempContainerMakeX[2]+"Smith X"+TempContainerMakeX[3]);
  63. $("#fletch-item-have").parent().parent().parent().children().last().children().first().children().first().after(TempContainerMakeX[0]+"FletchX"+TempContainerMakeX[1]+"'Fletching'"+TempContainerMakeX[2]+"Fletch X"+TempContainerMakeX[3]);
  64. $("#runecraft-item-have").parent().parent().parent().children().last().children().first().children().first().after(TempContainerMakeX[0]+"CreateX"+TempContainerMakeX[1]+"'Runecrafting'"+TempContainerMakeX[2]+"Create X"+TempContainerMakeX[3]);
  65. $("#herblore-item-have").parent().parent().parent().children().last().children().first().children().first().after(TempContainerMakeX[0]+"BrewX"+TempContainerMakeX[1]+"'Herblore'"+TempContainerMakeX[2]+"Brew X"+TempContainerMakeX[3]);
  66. $("#magic-item-have").parent().parent().parent().children().last().children().first().children().first().after(TempContainerMakeX[0]+"CastX"+TempContainerMakeX[1]+"'Magic'"+TempContainerMakeX[2]+"Cast X"+TempContainerMakeX[3]);
  67. // $("#skill-cooking-food-selected-qty").after(TempContainer[0] + "timeLeftCooking" + TempContainer[1]);
  68. // $("#skill-fm-logs-selected-qty").after(TempContainer[0] + "timeLeftFiremaking" + TempContainer[1]);
  69.  
  70.  
  71.  
  72. window.makeLeft = Infinity;
  73.  
  74. function makeX(clicked,currentSkill) {
  75. let verb = skillVerbs.find( ({ name }) => name === currentSkill ).verb;
  76. if (eval("!is"+currentSkill) && clicked) {
  77. window.makeLeft = Infinity;
  78. $("#"+verb+"X").children().first().html(verb + " X");
  79. }
  80. if(makeLeft != Infinity && !clicked) {
  81. window.makeLeft -= 1;
  82. $("#"+verb+"X").children().first().html(makeLeft + " left");
  83. }
  84. console.log('makeLeft: '+ makeLeft);
  85. if (window.makeLeft === 0) {
  86. taskComplete();
  87. if(currentSkill==="Magic") {
  88. castMagicRef2(true);
  89. }
  90. else {
  91. eval("start"+currentSkill+"Ref2(true);");
  92. }
  93. $("#"+verb+"X").children().first().html(verb + " X");
  94. }
  95. }
  96.  
  97. window.setMakeX = function(currentSkill) {
  98. let verb = skillVerbs.find( ({ name }) => name === currentSkill ).verb;
  99. let selected = skillVerbs.find( ({ name }) => name === currentSkill ).selected;
  100. if (eval("selected"+selected) !== undefined) {
  101. if (makeLeft===Infinity) {
  102. let SetMakeX = prompt('How many would you like to make?');
  103. if (SetMakeX !== null) {
  104. window.makeLeft = SetMakeX;
  105. $("#"+verb+"X").children().first().html(makeLeft + " left");
  106. console.log('makeLeft: '+ makeLeft);
  107. }
  108. }
  109. else{
  110. window.makeLeft = Infinity;
  111. $("#"+verb+"X").children().first().html(verb+" X");
  112. }
  113. if(currentSkill==="Magic") {
  114. castMagic(true);
  115. }
  116. else {
  117. eval("start"+currentSkill+"(true);");
  118. }
  119. }
  120. };
  121.  
  122. // ## CRAFTING ##
  123. var startCraftingRef2 = startCrafting;
  124. window.startCrafting = function(...args) {
  125. startCraftingRef2(...args);
  126. makeX(arguments[0],"Crafting");
  127. };
  128.  
  129. // ## SMITHING ##
  130. var startSmithingRef2 = startSmithing;
  131. window.startSmithing = function(...args) {
  132. startSmithingRef2(...args);
  133. makeX(arguments[0],"Smithing");
  134. };
  135.  
  136. // ## RUNECRAFTING ##
  137. var startRunecraftingRef2 = startRunecrafting;
  138. window.startRunecrafting = function(...args) {
  139. startRunecraftingRef2(...args);
  140. makeX(arguments[0],"Runecrafting");
  141. };
  142.  
  143. // ## FLETCHING ##
  144. var startFletchingRef2 = startFletching;
  145. window.startFletching = function(...args) {
  146. startFletchingRef2(...args);
  147. makeX(arguments[0],"Fletching");
  148. };
  149.  
  150. // ## HERBLORE ##
  151. var startHerbloreRef2 = startHerblore;
  152. window.startHerblore = function(...args) {
  153. startHerbloreRef2(...args);
  154. makeX(arguments[0],"Herblore");
  155. };
  156.  
  157. // ## MAGIC ##
  158. var castMagicRef2 = castMagic;
  159. window.castMagic = function(...args) {
  160. castMagicRef2(...args);
  161. makeX(arguments[0],"Magic");
  162. };
  163.  
  164. });

QingJ © 2025

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