NAME
Chess::ICClib - Perl interface to Internet Chess Server commands
SYNOPSIS
use Chess::ICClib;
my $icc = Chess::ICClib->new([-prompt=>$ICC],
[-host=>$host,-port=>$port]
[-user=>$user,-pass=>$password]);
$icc->ICCCommand("finger romm");
DESCRIPTION
Chess::ICClib - Perl interface to Internet Chess Server commands. Provides a tool able to connect, login and send commands to an Internet Chess Server as well as return responses from the server. Can be used as a basis for information retrieval tool as well as for a player or a chess program interface.
Since ICS [Internet Chess Server] (any, commercial and free alike) are built upon the telnet protocol, this module is built upon the Net::Telnet module where the telnet connection serves as the read/write socket.
This module has been tested against ICC (Internet Chess Club, http://www.chessclub.com, telnet king.chessclub.com 5000) but it should work fine against other chess servers unless they propose another "more" preprompt. More about prompts see in ICCCommand
method section.
The following methods are available:
Constructor
-
$icc = Chess::ICClib->new([-prompt=>$ICC], [-host=>$host,-port=>$port] [-user=>$user,-pass=>$password]);
Creates an ICC object, then connects and logins into the ICS. All parameters are optional.
-prompt
-
The ICS prompt. The default is the ICC prompt 'aics%'. Several other popular servers' prompt are provided - see the
EXPORT
section. -host
,-port
-
The ICS host and port. The defaults are the ICC host 204.178.125.65 and the ICC port 5000. In later versions hosts and ports for most popular ICS will be added for export.
-user
,-pass
-
The ICS user name and password. There are no defaults. 'guest' login is sufficient on most of the servers (USChessLive and FreeICS are not supporting guest logins!) The module tries to look up the file '~/.icsrc' to read the username and password from it.
ICCCommand
-
my $response = $icc->ICCCommand($icccommand)
This method performs an ICC Command $icccommand and sets the output into $response. The interface of ICC (and supposedly of other ICS) pages the output automatically with preprompt 'Type "more" to see more' and the output unpages it scrolling with issuing the "more" command consecutively until the preprompt disappears. Please note that ICS is case-insensitive while Perl is.
EXPORT
VARIOUS ICS PROMPTS
$FICS $ICC $USCHESSLIVE $CHESSANYTIME $CHESSNET $DNCS $AUSTRALIANCS $BRAZILIANCSDefault host and port for ICC
-
$ICSHOST $ICSPORT =back
CAVEATS
This module does not implement the timeseal feature which avoids the effect of network lag on the chess clock therefore in its current condition the modules is not weel suitable to playing. But, it seems that various ICS use different timeseal protocols so implementing them would take time.
SEE ALSO
Chess::FIDE Net::Telnet and various Chess-Server related sites.
FILES
~/.icsrc
AUTHOR
Roman M. Parparov, <romm@empire.tau.ac.il>
COPYRIGHT AND LICENSE
Copyright (C) 2004 by Roman M. Parparov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.
The Internet Chess Servers are copyrighted separately by their owners.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 203:
You forgot a '=back' before '=head1'