say-unknown.pl
1 # this is a just an adaption of dispatch.pl script by Sebastian 'yath' Schmidt
2 # to say the line instead of sending to the server if it is not recognized as
3 # a command
4
5 use strict;
6 use warnings;
7 use Irssi qw( settings_get_bool active_win signal_stop
8 settings_add_bool signal_add_first );
9 use Irssi::Irc;
10 use vars qw($VERSION %IRSSI);
11
12 $VERSION = '0.5';
13 %IRSSI = (
14 authors => 'Mathieu Doidy',
15 name => 'say-unknown',
16 description => 'just say the line if it starts by a / and is not recognized as a command',
17 license => 'GNU GPL v2',
18 url => 'http://irssi.roulaize.net',
19 changed => '10/10/2003'
20 );
21
22 sub event_default_command {
23 my ($command, $server) = @_;
24 return if (settings_get_bool("say-unknown_commands") == 0 || !$server);
25 active_win->command("/say /$command");
26 signal_stop();
27 }
28
29 settings_add_bool("misc", "say-unknown_commands", 1);
30 signal_add_first("default command", "event_default_command");