Lichess easy rematch

Press the R key twice "r r" to automatically resign and rematch, or seek after 5 seconds

目前为 2016-07-13 提交的版本,查看 最新版本

// ==UserScript==
// @name         Lichess easy rematch
// @namespace    http://github.com/flugsio
// @version      0.2
// @description  Press the R key twice "r r" to automatically resign and rematch, or seek after 5 seconds
// @author       flugsio
// @include        /\.l\.org\/\w{12}$/
// @grant none
// ==/UserScript==

Mousetrap.bind(['r r'], function() {
  lichess.socket.send('resign');
  lichess.socket.send('rematch-yes');
  window.setTimeout(function() {
    lichess.socket.send('rematch-no');
    window.setTimeout(function() {
      $("a.button[href^='/?hook_like='")[0].click();
    }, 200);
  }, 5000);
});