Slither.io simple zoom

Press z to zoom in, x to zoom out, and c to let zoom drift with game.

当前为 2019-05-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Slither.io simple zoom
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Press z to zoom in, x to zoom out, and c to let zoom drift with game.
  6. // @author Thor Lancaster
  7. // @match http://slither.io/
  8. // @grant none
  9. // @comment Press z to zoom in, x to zoom out, and c to let zoom drift with game.
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. setInterval(500, function(){
  15. if(window.desiredGSC !== undefined){
  16. window.gsc = window.desiredGSC;
  17. }
  18. });
  19.  
  20. addEventListener('keydown', function (e) {
  21. if (e.key == 'z') {
  22. e.preventDefault();
  23. window.desiredGSC = window.gsc * 0.9;
  24. window.gsc = window.desiredGSC;
  25. }
  26. if(e.key == 'c') {
  27. e.preventDefault;
  28. window.desiredGSC = undefined;
  29. }
  30. if (e.key == 'x') {
  31. e.preventDefault();
  32. window.desiredGSC = window.gsc * 1.11;
  33. window.gsc = window.desiredGSC;
  34. }
  35. });
  36. })();