Melvor Remove 8 Keybind

Prevents the 8 key from creating 8 items. Tested Melvor 22.1 (1209)

  1. // ==UserScript==
  2. // @name Melvor Remove 8 Keybind
  3. // @version 1.0
  4. // @author koolioolio
  5. // @description Prevents the 8 key from creating 8 items. Tested Melvor 22.1 (1209)
  6. // @match https://*.melvoridle.com/*
  7. // @exclude-match https://wiki.melvoridle.com/*
  8. // @noframes
  9. // @grant none
  10. // @inject-into page
  11. // @run-at document-idle
  12. // @namespace https://gf.qytechs.cn/users/808226
  13. // ==/UserScript==
  14. function removeEightKeybind() {
  15. var eventsToRemove = []; //first remove the document-wide keypress bind which does nothing but 8
  16. $._data(document, "events").keypress.forEach(function append(e){if (e.handler.toString().includes("(e.keyCode==56)")) eventsToRemove.push(e);});
  17. eventsToRemove.forEach(function remove(e){$(document).unbind("keypress", e.handler);});
  18. eventsToRemove = []; //then remove the searchTextbox keyup bind which has other purposes
  19. $._data($("#searchTextbox")[0], "events").keyup.forEach(function append(e){if (e.handler.toString().includes("if(!eightSeconds)")) eventsToRemove.push(e);});
  20. eventsToRemove.forEach(function remove(e){$($("#searchTextbox")[0]).unbind("keyup", e.handler);});
  21. //finally, re-add a copy of the keyup bind that has no 8 code so we don't break searching and wherearemylemons
  22. $("#searchTextbox").keyup(function(){let search=$("#searchTextbox").val();updateBankSearch(search);if(search==="wherearemylemons")addItemToBank(CONSTANTS.item.Lemon,1);});
  23. }
  24. var load = setInterval(function() {
  25. if (isLoaded) {
  26. clearInterval(load);
  27. removeEightKeybind();
  28. }
  29. }, 300);

QingJ © 2025

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