diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/u.pl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/u.pl b/scripts/u.pl index a552da7..c5313ab 100644 --- a/scripts/u.pl +++ b/scripts/u.pl @@ -12,7 +12,6 @@ $VERSION = "1.2"; changed => "Thu Jun 3 11:04:27 CEST 2004", ); - sub cmd_u { my ($data, $server, $channel) = @_; @@ -21,12 +20,18 @@ sub cmd_u my $msg; my $match; my $nick; - + if ($channel->{type} ne "CHANNEL") { Irssi::print("You are not on a channel"); return; } + + eval { /$data/ } ; + if ($@) { + Irssi::print("Not a valid regexp given.",MSGLEVEL_CLIENTERROR); + return; + } @nicks = $channel->nicks(); @@ -60,7 +65,7 @@ sub cmd_u } $match = $nick->{nick}.'!'.$nick->{host}; # For regexp matching - + $channel->print($msg) if $match =~ /$data/i; } |
