Gats.io right click for spacebar

This script allows you to use your right click for the abilities you usually use with spacebar. However it wont work for shield yet (working on it).

À partir de 2022-09-16. Voir la dernière version.

  1. // ==UserScript==
  2. // @name Gats.io right click for spacebar
  3. // @version 2.0.10.3
  4. // @description This script allows you to use your right click for the abilities you usually use with spacebar. However it wont work for shield yet (working on it).
  5. // @author Rayan223
  6. // @match https://gats.io
  7. // @icon none
  8. // @grant none
  9. // @license MIT
  10. // @namespace https://greasyfork.org/users/825882
  11. // ==/UserScript==
  12.  
  13. var play = 0
  14.  
  15. function checkPlaying() {
  16. var menu = document.getElementById('slct');
  17. if (menu.style == "display: none;"){
  18. document.getElementById('canvas').width = 886
  19. play = 1
  20. }else{
  21. document.getElementById('canvas').width = 884
  22. play = 0
  23. }
  24. setTimeout(checkPlaying,100)
  25. }
  26.  
  27. document.addEventListener('mousedown', function(event){
  28. if (play == 1){
  29. if(event.which == 2){
  30. RF.list[0].socket.send('k,5,1');
  31. }
  32. }
  33. });
  34.  
  35. document.addEventListener('mouseup', function(event){
  36. if (play == 1){
  37. if(event.which == 2){
  38. RF.list[0].socket.send('k,5,0');
  39. }
  40. }
  41. });
  42.  
  43. checkPlaying()
  44. //window.oncontextmenu = function ()
  45. //{
  46. // dash();
  47. // setTimeout(afterdash,50);
  48. // return false;
  49. //}
  50.  
  51. //function dash(){
  52. // RF.list[0].socket.send('k,5,1');
  53. //}
  54.  
  55. //function afterdash(){
  56. // RF.list[0].socket.send('k,5,0');
  57. //}