<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">use strict;
use vars qw($VERSION %IRSSI);
use Irssi 20010920.0000 ();
$VERSION = "2.01";
%IRSSI = (
    authors     =&gt; 'From irssi source, modified by Brian Ponnampalam (dg)',
    name        =&gt; 'mquotes',
    description =&gt; '/MQUOTES - Display a random quote',
    license     =&gt; 'Same as Irssi',
    url         =&gt; 'https://magical.ddns.net/software/irssi/',
);

sub cmd_quotes {
   
 my ($data, $server, $channel) = @_;

 if (!$channel || $channel-&gt;{type} ne 'CHANNEL') {
    Irssi::print('No active channel in window');
    return;
  }

 my $home = $ENV{"HOME"};
 my $myfile = $home."/.irssi/quotes.txt";
 open my $fh,'&lt;',$myfile or die $!;
 my $size = -s $fh;
 seek $fh, rand($size) , 0;
 &lt;$fh&gt;; #throw away current line;
   
 my $randomline = &lt;$fh&gt;;

 close $fh;
 $channel-&gt;print($randomline);
}
Irssi::command_bind('mquotes', 'cmd_quotes');
</pre></body></html>