1use strict; 2use Irssi; 3 4use vars qw($VERSION %IRSSI %HELP); 5$VERSION = "0.9"; 6%IRSSI = ( 7 authors => "Maciek \'fahren\' Freudenheim", 8 contact => "fahren\@bochnia.pl", 9 name => "Scripts help", 10 description => "Provides access to script\'s help", 11 license => "GNU GPLv2 or later", 12 changed => "Sat Apr 13 02:23:37 CEST 2002" 13); 14$HELP{scripthelp} = " 15Provides help for irssi's perl scripts. 16 17All what you have to do is to add 18\$HELP{commandname} = \" 19 your help goes here 20\"; 21to your script. 22"; 23 24sub cmd_help { 25 my ($args, $server, $win) = @_; 26 27 # from scriptinfo.pl 28 for (sort grep s/::$//, keys %Irssi::Script::) { 29 my $help = ${ "Irssi::Script::${_}::HELP" }{$args}; 30 if ($help) { 31 Irssi::signal_stop(); 32 Irssi::print("$help"); 33 return; 34 } 35 } 36} 37 38Irssi::command_bind("help", "cmd_help"); 39