tools: Add helper scripts for WeeChat and XChat as well.

The irssi script is also renamed and now has OSET as well.
This commit is contained in:
JD Horelick 2011-05-15 19:02:09 -04:00
parent 1117974490
commit 50ee317107
4 changed files with 93 additions and 21 deletions

View File

@ -14,9 +14,11 @@ mkpasswd.c - makes password for O lines
rsa_respond/ - a tool to generate an RSA response to the challenge asked
by the server, and a tool to generate a keypair for the
C/R system
shadow_help.pl - an irssi script which adds a OHELP command so you do not
have to type /quote help everytime you want to view the
IRCd's helpfiles.
shadow_help_irssi.pl - an irssi script which adds OHELP and OSET commands so
you do not have to prefix the commands with /quote to
run them.
shadow_help weechat.pl - same as above but for WeeChat 0.3.0 or later.
shadow_help_xchat.pl - same as above but for XChat 2.x.
untabify - converts tab characters to a specific number of spaces
viconf.c - edit your conf file without having to chdir su etc. etc.
also locks the file if file locking is used.

View File

@ -9,7 +9,7 @@ $VERSION = "1.0";
authors => 'JD Horelick',
contact => 'jdhore1@gmail.com',
name => 'shadow_help.pl',
description => 'Adds a OHELP command so that you do not need to type /quote help',
description => 'Adds an OHELP and OSET command to make using the IRCd-side HELP and SET commands easier',
license => 'GNU General Public License',
url => 'http://shadowircd.net/',
);
@ -25,5 +25,17 @@ sub cmd_ohelp {
$server->send_raw("HELP $data");
}
sub cmd_oset {
my ($data, $server) = @_;
if (!$server || !$server->{connected}) {
Irssi::print("Not connected to server");
return;
}
$server->send_raw("SET $data");
}
Irssi::command_bind('ohelp', \&cmd_ohelp);
Irssi::command_bind('oset', \&cmd_oset);
# vim: ts=4

View File

@ -0,0 +1,40 @@
# This script is something just thought up by me (jdhore) and ported from irssi to WeeChat
weechat::register("shadow_help", "jdhore", "1.0", "BSD", "Make life easier when using various oper commands", "", "");
weechat::hook_command("ohelp", "Rewriting the IRCd's HELP command for fun and profit",
"[params]",
"" .
"",
"", "ohelp", "");
weechat::hook_command("oset", "Rewriting the IRCd's SET command for fun and profit",
"[params]",
"" .
"",
"", "oset", "");
sub ohelp {
my ($data, $buffer, $param) = @_;
if ($param) {
weechat::command($buffer, "/quote help $param");
}
else {
weechat::command($buffer, "/quote help");
}
return weechat::WEECHAT_RC_OK;
}
sub oset {
my ($data, $buffer, $param) = @_;
if ($param) {
weechat::command($buffer, "/quote set $param");
}
else {
weechat::command($buffer, "/quote set");
}
return weechat::WEECHAT_RC_OK;
}

View File

@ -0,0 +1,18 @@
package IRC::Xchat::Shadow_Help;
IRC::register("Shadow Help", "1.0", "", "");
sub ohelp {
$_ = shift @_;
IRC::command ("/quote help $_");
return 1;
}
sub oset {
$_ = shift @_;
IRC::command ("/quote set $_");
return 1;
}
IRC::add_command_handler("ohelp", "IRC::Xchat::Shadow_Help::ohelp");
IRC::add_command_handler("oset", "IRC::Xchat::Shadow_Help::oset");