home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Killer
/
Game_Killer.bin
/
095.PARSEETH.INC
< prev
next >
Wrap
Text File
|
1992-07-04
|
3KB
|
105 lines
procedure EtherprobeEntered( s : string; var m : scannermap );
var
currsector : sector;
error : integer;
begin
s := copy( s, 11, 255 );
s := copy( s, 1, pos(' ', s) - 1);
val( s, currsector, error );
if error <> 0 then
begin
writeln('programmer error (sigh)');
writeln('etherprobe entered called with "', s, '"');
readln;
halt;
end;
if m[ currsector ] = open then
begin
m[ currsector ] := scanned;
writeln('probed ', currsector );
end;
end;
procedure AutowarpedThrough( s : string; var m : scannermap );
var
currsector : sectorindex;
error, dummy : integer;
begin
s := copy( s, 23, 255 );
val( s, currsector, error );
if error <> 0 then
begin
writeln('programmer error (sigh)');
writeln('autowarped through called with "', s, '"');
readln;
halt;
end;
if m[ currsector ] <> visited then
begin
write('visited ', currsector );
scan( currsector, m, dummy );
writeln;
end;
end;
procedure WarpedThrough( s : string; var m : scannermap );
var
currsector : sectorindex;
error, dummy : integer;
begin
s := copy( s, 18, 255 );
s := copy( s, 1, length(s) - 1);
{ kill extra space }
val( s, currsector, error );
if error <> 0 then
begin
writeln('programmer error (sigh)');
writeln('Warped Through called with "', s, '"');
readln;
halt;
end;
if m[ currsector ] <> visited then
begin
write('visited ', currsector );
scan( currsector, m, dummy );
writeln;
end;
end;
procedure parselog( var log : text; var map : scannermap );
{ log is an ascii capture. Look for certain strings, and update map. }
var
line : string;
begin
while not eof( log ) do
begin
readln( log, line );
if pos( 'Sector :', line) = 1 then
EtherprobeEntered( line, map )
else if pos('Auto Warping to sector', line) = 1 then
AutowarpedThrough( line, map )
else if pos('Warping to Sector',line) = 1 then
WarpedThrough( line, map );
end; {while}
end; {parse}
procedure ParseCapturedText;
{ the user has stored a log file, i.e. ascii capture of output from the
game. We are going to read info from it to develop a map. }
var
m : scannerMap;
ch : char;
f : text;
begin
write('Start with <F>resh map, or <R>ead in map from disk? ');
readln( ch );
if upcase( ch ) = 'R' then
InitMapFromDisk( m )
else
InitToOpen( m );
assign( f, GetOldFileName( 'Name of captured text file? ',
BBSname + '.ETH'));
reset( f );
parselog( f, m );
saveMapToDisk( m );
end;