Welcome, Guest. Please Login or Register.
Oct 29th, 2020, 11:59am

Home Home Help Help Search Search Members Members Login Login Register Register
Arimaa Forum « Keyboard shortcuts (tampermonkey script) »


   Arimaa Forum
   Arimaa
   Site Discussion
(Moderator: supersamu)
   Keyboard shortcuts (tampermonkey script)
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Keyboard shortcuts (tampermonkey script)  (Read 9826 times)
harvestsnow
Forum Guru
*****





   


Gender: male
Posts: 88
Keyboard shortcuts (tampermonkey script)
« on: Mar 21st, 2013, 5:59pm »
Quote Quote Modify 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: male
Posts: 380
Re: Client modification (tampermonkey script)
« Reply #1 on: Mar 21st, 2013, 11:31pm »
Quote Quote Modify 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: male
Posts: 88
Re: Keyboard shortcuts (tampermonkey script)
« Reply #2 on: Apr 28th, 2013, 11:21am »
Quote Quote Modify 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: male
Posts: 88
Re: Keyboard shortcuts (tampermonkey script)
« Reply #3 on: Jan 30th, 2014, 10:59am »
Quote Quote Modify 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: male
Posts: 88
Re: Keyboard shortcuts (tampermonkey script)
« Reply #4 on: Feb 3rd, 2014, 3:46pm »
Quote Quote Modify 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: male
Posts: 88
Re: Keyboard shortcuts (tampermonkey script)
« Reply #5 on: Jun 2nd, 2014, 9:52pm »
Quote Quote Modify 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
Brendan_M
Forum Full Member
***



Arimaa player #8106

   


Gender: male
Posts: 21
Re: Keyboard shortcuts (tampermonkey script)
« Reply #6 on: Mar 31st, 2016, 3:11am »
Quote Quote Modify Modify

Thanks for making this harvestsnow
 
I changed the script so hovering the mouse over a piece and pressing arrow keys moves the piece, and spacebar to make the move
 
https://gist.github.com/brendanator/a7b1c2035d7065bd3c1b5497e0cf3f96
 
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.