GC Double Or Nothing Keyboard Controls

Adds keyboard controls to GC's Double Or Nothing

当前为 2024-03-18 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name GC Double Or Nothing Keyboard Controls
  3. // @namespace https://greasyfork.org/en/users/1175371
  4. // @version 0.2
  5. // @description Adds keyboard controls to GC's Double Or Nothing
  6. // @author sanjix
  7. // @match https://www.grundos.cafe/medieval/doubleornothing/
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=grundos.cafe
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. var coin = document.querySelector('form#playagain, form.input[alt="Click to toss the coin"]');
  13. var collect = document.querySelector('button.form-control[type="submit"]');
  14.  
  15. document.addEventListener('keydown', (event) => {
  16. if (event.keyCode == '13') {
  17. coin.submit();
  18. }
  19. if (event.keyCode == '87') {
  20. collect.click();
  21. }
  22. });