DelugeRPG Movement Controller for Mobile UI

Adds keyboard controls for movement in DelugeRPG's mobile version.

当前为 2025-03-29 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name DelugeRPG Movement Controller for Mobile UI
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.5
  5. // @description Adds keyboard controls for movement in DelugeRPG's mobile version.
  6. // @license MIT
  7. // @author Your Name
  8. // @match https://m.delugerpg.com/map*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // This script was designed to enhance gameplay convenience by adding keyboard controls to DelugeRPG's mobile version.
  16. // While created with good intentions, I want to emphasize that I will promptly remove it if any functionality conflicts with the platform's Terms of Service.
  17. // Thank you for your understanding and support.
  18.  
  19. const movementKeys = {
  20. 'q': '#dr-nw',
  21. 'w': '#dr-n',
  22. 'e': '#dr-ne',
  23. 'a': '#dr-w',
  24. 's': '#dr-s',
  25. 'd': '#dr-e',
  26. 'z': '#dr-sw',
  27. 'x': '#dr-s',
  28. 'c': '#dr-se'
  29. };
  30.  
  31. document.addEventListener('keydown', function(e) {
  32. const selector = movementKeys[e.key];
  33. if (selector) {
  34. const button = document.querySelector(selector);
  35. if (button) {
  36. button.click();
  37. e.preventDefault();
  38. }
  39. }
  40. });
  41. })();