diff options
| author | Alexander Færøy | 2014-05-31 13:10:46 +0200 |
|---|---|---|
| committer | Alexander Færøy | 2014-05-31 13:10:46 +0200 |
| commit | 2d0759e6ca5767b48bcc85bf38c2c43d5f0b63b1 (patch) | |
| tree | 1c5e6d817c88e67b46e216a50e0aef5428bf63df /scripts/oops.pl | |
| parent | 2d080422d79d1fd49d6c5528593ccaaff9bfc583 (diff) | |
| download | scripts.irssi.org-2d0759e6ca5767b48bcc85bf38c2c43d5f0b63b1.tar.bz2 | |
Import scripts from scripts.irssi.org
Diffstat (limited to 'scripts/oops.pl')
| -rw-r--r-- | scripts/oops.pl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/oops.pl b/scripts/oops.pl new file mode 100644 index 0000000..d72f59f --- /dev/null +++ b/scripts/oops.pl @@ -0,0 +1,33 @@ +use strict;
+use vars qw($VERSION %IRSSI);
+
+use Irssi;
+$VERSION = '20071209';
+%IRSSI = (
+ authors => '',
+ contact => '',
+ name => 'oops',
+ description =>
+'turns \'ls\' in the beginning of a sent line into the names or whois commands',
+ license => 'Public Domain',
+);
+
+sub send_text {
+
+ #"send text", char *line, SERVER_REC, WI_ITEM_REC
+ my ( $data, $server, $witem ) = @_;
+ if ( $witem
+ && ( $witem->{type} eq "CHANNEL" )
+ && ( $data =~ /(^ls |^ls$)/ ) )
+ {
+ $witem->command("names $witem->{name}");
+ Irssi::signal_stop();
+ }
+ if ( $witem && ( $witem->{type} eq "QUERY" ) && ( $data =~ /(^ls |^ls$)/ ) )
+ {
+ $witem->command("whois $witem->{name}");
+ Irssi::signal_stop();
+ }
+}
+
+Irssi::signal_add 'send text' => 'send_text'
|
