Author |
Topic: Keyboard shortcuts (tampermonkey script) (Read 12484 times) |
|
harvestsnow
Forum Guru
Gender:
Posts: 88
|
|
Keyboard shortcuts (tampermonkey script)
« on: Mar 21st, 2013, 5:59pm » |
Quote Modify
|
Hello, This is a tampermonkey script that makes a few minor modifications to the js game client. http://pastebin.com/b3u0b4zD My first idea was to add a keyboard shortcut to send the move (space by default), saving the precious half-second needed to target and click the send button. Mostly intended for blitzers. I also added navigation keys: up and down arrows to go one move back or forward, page-up and page-down to go at the beginning and end of the game; "U" and "R" to undo/redo one step; backspace to undo the whole move; "G" to prompt for a particular move to go to, in the usual format; "P" to open a plan window, "M" to open the move list. Plus an option to automatically turn the sound off. All of these are easily modifiable. I'm not sure to what extent this kind of client modifications complies with the tournament rules. I'd advise to use it with caution anyway, since it adds another possibility of accidental failure (hitting the send key by mistake). I hope someone will find it helpful. This works with chromium + tampermonkey, and should work with firefox + greasemonkey although I haven't tested it. I used this page to check the keyboard codes. *** Added the possibility to control the pieces with the WASD keys (loosely following an idea presented here). To move a piece, click on it first, then either click on the arrow or press a key to move it. (very buggy, disabled by default)
|
« Last Edit: Jan 30th, 2014, 10:52am by harvestsnow » |
IP Logged |
|
|
|
browni3141
Forum Guru
Arimaa player #7014
Gender:
Posts: 385
|
|
Re: Client modification (tampermonkey script)
« Reply #1 on: Mar 21st, 2013, 11:31pm » |
Quote Modify
|
Awesome! I wish I had done this. It works for me using Scriptish on Firefox. Thanks a lot!
|
« Last Edit: Mar 21st, 2013, 11:58pm by browni3141 » |
IP Logged |
|
|
|
harvestsnow
Forum Guru
Gender:
Posts: 88
|
|
Re: Keyboard shortcuts (tampermonkey script)
« Reply #2 on: Apr 28th, 2013, 11:21am » |
Quote Modify
|
I've added two things: - predefined setups; it should be clear enough how to add your own. Currently used keys are 0 (random), 1-2-3-4, and TAB to mirror the setup horizontally. - replay a game: F8 will ask for the game history (starting with the current move) and hopefully will play your moves for you, waiting for your opponent to do the same. Wait until all your pieces are visible before calling it, and don't interact with the game board while it's working. If it gets stuck for more than 10 seconds, there certainly is a bug somewhere. Reload the client and play without it; consider making a bug report here. Bug reports and suggestions are welcome.
|
« Last Edit: Jul 8th, 2013, 3:58pm by harvestsnow » |
IP Logged |
|
|
|
harvestsnow
Forum Guru
Gender:
Posts: 88
|
|
Re: Keyboard shortcuts (tampermonkey script)
« Reply #3 on: Jan 30th, 2014, 10:59am » |
Quote Modify
|
Added a button to switch the animations off. The new position will be displayed immediately when the opponent moves, as if the "next move" button had been pressed. + "win/lose" labels are now hidden. Hit "l" to bring them back, or set the "NO_WINLOSE" var to true in the script. To view a WC game without spoiling the result: copy the url of the scheduled game before it starts, and use it later.
|
« Last Edit: Feb 3rd, 2014, 3:48pm by harvestsnow » |
IP Logged |
|
|
|
harvestsnow
Forum Guru
Gender:
Posts: 88
|
|
Re: Keyboard shortcuts (tampermonkey script)
« Reply #4 on: Feb 3rd, 2014, 3:46pm » |
Quote Modify
|
This bit should remove all indications of the outcome of a game from the client window: http://pastebin.com/f4msCRRj (I removed the corresponding part in the other script)
|
|
IP Logged |
|
|
|
harvestsnow
Forum Guru
Gender:
Posts: 88
|
|
Re: Keyboard shortcuts (tampermonkey script)
« Reply #5 on: Jun 2nd, 2014, 9:52pm » |
Quote Modify
|
The "Current" button prompts the current move for a quick copy (ctrl+c and escape). The "Range" button takes as input two move numbers separated by a hyphen (-), both optionnal (eg. 10g-12s, 20g-, -5s), and prompts a slash-separated move list. This also works with the plan window in firefox, I haven't tested it yet with chromium.
|
« Last Edit: Jun 4th, 2014, 11:40pm by harvestsnow » |
IP Logged |
|
|
|
|