Greasy Fork 支持简体中文。

WASD tp for BETA

allows to tp in beta of brofist.io

  1. // ==UserScript==
  2. // @name WASD tp for BETA
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description allows to tp in beta of brofist.io
  6. // @author CiNoP & ARCH
  7. // @match https://brofist.io/beta/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=brofist.io
  9. // @license GPL-3.0-only
  10. // @grant none
  11. // ==/UserScript==
  12. /* jshint esversion: 11 */
  13.  
  14. var c = Function.prototype.call;
  15.  
  16. Function.prototype.call = function(...a) {
  17. a[0]?.[0]?._name == 'Ref' && cinop(a[0][0]._components[0]?.mapManager)
  18. return c.apply(this, a)
  19. };
  20.  
  21. function cinop(temp1) {
  22. document.body.onkeydown = (event) => {
  23. if (event.key.toLowerCase() == 'a') {
  24. temp1.characters[0].node.setPosition(temp1.characters[0].node.getPosition().x-300,
  25. temp1.characters[0].node.getPosition().y,0
  26. )
  27. }
  28. if (event.key.toLowerCase() == 'w') {
  29. temp1.characters[0].node.setPosition(temp1.characters[0].node.getPosition().x,
  30. temp1.characters[0].node.getPosition().y+300,0
  31. )
  32. }
  33. if (event.key.toLowerCase() == 'd') {
  34. temp1.characters[0].node.setPosition(temp1.characters[0].node.getPosition().x+300,
  35. temp1.characters[0].node.getPosition().y,0
  36. )
  37. }
  38. if (event.key.toLowerCase() == 's') {
  39. temp1.characters[0].node.setPosition(temp1.characters[0].node.getPosition().x,
  40. temp1.characters[0].node.getPosition().y-300,0
  41. )
  42. }
  43. }
  44. }