alias fileread {
if (!$1) { echo -a 10ERROR - Enter the line number of the file being read as the first argument. | return }
var %file D:\leechme.txt, %line $1, %lines $lines(%file)
if ($isfile(%file)) {
if ($file(%file)) {
if (%line <= %lines) var %str $read(%file,nt,%line)
else echo -a 10ERROR - The file has fewer lines. Total: %lines
if (%str) msg #welcomechat $+(%line,.) %str
}
else echo -a 10ERROR - File is empty or an error occurred while reading: %file
}
else echo -a 10ERROR - File does not exist: %file
}