> I found no easy way to do this. FICS is an human readable protocol, > not easily parsed. If I asked for the moves from the beginning I > don't know when I will read them on the socket, I am not sure some > other info will not slip in between, and I don't know when moves > list will be complete.
FICS provides solution for that (and in general to matching responses with requests). iset block. In general it works so: a) after logging in (it is possible even before, but let's leave it) you issue the command iset block 1 b) since then, you must issue command differently, for example instead of games you issue 1 games giving some small number (it is up to you to ensure that if you issue a few commands simultaneously, those numbers are different) c) every reply to your command is wrapped by FICS in a special block, so you may easily recognize where it starts, where it ends and to which command it is related. Those replies look so: ^U1^V43^Vnormal multiline command reply goes here^W In the text above: - ^U is char(21), - ^V is char(22), - ^W is char(23), - 1 (the number after ^U) is the number matching the number you gave while issuing the command) - 43 is the code of the command (see link below, 43 means "games") So, while working in block mode, you just label all issued commands and (before parsing anything else) watch for ^U characters. If they happen, you eat everything up to ^W, make simple split and have full control. More info: http://www.freechess.org/Help/HelpFiles/iv_block.html (and yes, it works, I use it heavily in WatchBot) Btw, ICC has very similar mechanism although differently named (level1 or sth like that, I am not playing on ICC so I never used it) > I guess this is why Jin don't get the moves as Scid... No, this is just ideology. Jin don't get the moves because Jin author considers current behaviour to be a FICS bug and refuses to workaround it in Jin. -- ---------------------------------------------------------------------- | Marcin Kasperski | Systems built by humans are always subject | http://mekk.waw.pl | to human error. (Parnas) | | ---------------------------------------------------------------------- ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Scid-users mailing list Scid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scid-users