Note: This script only works with Jin 2.12.1 (it might also work for later versions, but this is not guaranteed). It is not meant to be a full, working replacement of the arrows/circles functionality, as some things can't be done without server support. If you want true arrows/circles functionality, I suggest you message DAV on FICS and ask him to add it. Since this functionality is available with server support on the ICC, this script is only useful on FICS.
The Arrows and Circles manager script allows arrows and circles to be added to the board in examine mode. Once you've added the script, kibitz the following "commands" to add/remove arrows and circles:
arrow e2 e4 - adds an arrow from e2 to e4.
circle d5 - adds a circle at d5 (it looks more like a square :-)).
unarrow e2 e4 - removes the e2-to-e4 arrow.
uncircle d5 - removes the circle at d5.
cleararrows - removes all arrows.
clearcircles - removes all circles.
Here is the information you need to add the script:
import free.jin.board.*;
import free.jin.Game;
import free.chess.Square;
import java.awt.Color;
import free.util.StringTokenizer;
Game game = connection.getGame(gameNumber);
if (game.isPlayed())
return;
BoardManager bm = scripter.getPlugin("board");
JinBoard board = bm.getBoardPanel(game).getBoard();
StringTokenizer tokens = new StringTokenizer(message, " ");
String command = tokens.nextToken();
if (command.equalsIgnoreCase("arrow")){
Square from = Square.parseSquare(tokens.nextToken());
Square to = Square.parseSquare(tokens.nextToken());
board.addArrow(new Arrow(from, to, Color.blue));
}
else if (command.equalsIgnoreCase("circle")){
Square square = Square.parseSquare(tokens.nextToken());
board.addCircle(new Circle(square, Color.blue));
}
else if (command.equalsIgnoreCase("unarrow")){
Square from = Square.parseSquare(tokens.nextToken());
Square to = Square.parseSquare(tokens.nextToken());
board.removeArrowsAt(from, to);
}
else if (command.equalsIgnoreCase("uncircle")){
Square square = Square.parseSquare(tokens.nextToken());
board.removeCirclesAt(square);
}
else if (command.equalsIgnoreCase("cleararrows")){
board.removeAllArrows();
}
else if (command.equalsIgnoreCase("clearcircles")){
board.removeAllCircles();
}