An unexamined life is not worth living.

Showing posts with label scripting. Show all posts
Showing posts with label scripting. Show all posts

Thursday, November 25, 2010

Scripting Your Chess Database

Scripting is a relatively common feature in many software packages (think of Excel Macros), so it is unfortunate that no chess software package has ever exposed it – until now! When staring at databases with my games, I’ve often had desire to do things like

  • Create a diagram right before every move that has a question mark, if that blunder was made by a player with a give name
  • Export games to a different format
  • Add a diagram for all games after every 5th move for convenient printout and practice of visual replay
  • Calculate an average number of blunders per game, compare the average between two sets of games (e.g. my blitz games and my slow games)
  • Find out in how many games do I stay in my repertoire until move 15?
  • Find out who of the top 10 players has an opening repertoire most similar to mine

These are features similar to what’s available in ChessBase’s and Chess Assistant’s of this world, but not quite the same. If you are a programmer, with access to the code of the tool - adding them this is not too hard. But if you are a mere user, without source code, you are out of luck completely. With scripting however, you at least have a chance. In addition to being able to do some new things, your powers multiply in other ways:

  • It is easier to interoperate between programs and use the power of multiple packages – e.g. you can export data into Excel
  • It becomes possible to automate several repeated UI manipulations and tie them into one script
  • Users can share their scripts between each other and you get features added to your tool added more often and for free

Aquarium Scripter is coming out very soon (rumour is - tomorrow) and I can’t wait to read reviews and if those are good - get an official copy of it. The features are described here, and I have to imagine (from the first blurry screenshot) that instead of a plain list of games
image

we now still have a plain list of games, but also an ability to run scripts against selected games!
image 

Now we are getting somewhere!

Sunday, July 27, 2008

Added "Replay Game" link - using powershell

Now every post under "Annotated Game" label is going to have a link to a separate page where you can replay through the game in the Palview viewer. Unfortunately Blogger does not allow javascript to be embedded into posts, so I have to generate one palview page with only diagrams, but no replay option, and then another palview html page with replay buttons, which gets uploaded to a separate site via FTP. I already had a way to automate the annoying process of creating two slightly different pages, but running some FTP GUI-ish tool to upload a single file every time I just want to post a couple of diagrams to the blog was too much for my lazy nature so I just stopped bothering generating re-playable pages ... until now! I used this FTP powershell script and finally even the FTP upload step is automated - one click creates both pages, uploads the static palview diagrams to the blog post via Google Blogger API, and a dynamic page to my FTP site. The process is somewhat fragile though, so I am still to see how well all this works over time. And yes, I still can't decide if I primarily created this blog so that I can post chess games, or just to be able to hack around with my little scripts.

Hit Counter