#!/usr/bin/perl -w ############################################ # This script allows you to op people who # send you a CTCP OP #channel request, for # further information just type /aboutop # after loading the script into x-chat. ############################################ $scriptname = "Op-on-request script"; $scriptver = "0.1"; IRC::print "\n"; IRC::print "\002\00311,12+----------------------------------------------- \003\002\n"; IRC::print "\002\00311,12| Registering $scriptname $scriptver \003\002\n"; IRC::print "\002\00311,12+----------------------------------------------- \003\002\n"; IRC::print "\n"; IRC::register ($scriptname, $scriptver, "", ""); IRC::add_message_handler("PRIVMSG", "privmsg_handler"); IRC::add_command_handler("aboutop", "aboutop_handler"); sub privmsg_handler { $_ = join(' ', shift(@_)); if ($_ =~ /\001OP/) { $_ = split(/ /, $_); chop($chan = $_[4]); $hostmask = $_[0]; $nick = $hostmask; # This part was happily ripped $nick =~ /!/g; # from http://www.xchat.org/files/scripts/xserv.pl $endofnick = pos($nick); # I admit it $nick = substr($nick, 1, $endofnick-2); # :> IRC::print "\002\0032,8$nick \003\0030,8requested ops on \003\0032,8$chan \003\0030,8- let's try to!\003\002\n"; IRC::command "/mode $chan +o $nick"; return 1; } } sub aboutop_handler { IRC::print "\n"; IRC::print "\002\0030,8+----------------------------------------------- \003\002\n"; IRC::print "\002\0030,8| $scriptname $scriptver \003\002\n"; IRC::print "\002\0030,8| by Jollino - 27 september 2000 \003\002\n"; IRC::print "\002\0030,8+------------------------------------------- \003\002\n"; IRC::print "\002\0030,8| This little script allows you to automatically \003\002\n"; IRC::print "\002\0030,8| op people who send you a CTCP op #channel re- \003\002\n"; IRC::print "\002\0030,8| quests. I wrote this because I often need to \003\002\n"; IRC::print "\002\0030,8| get op'd from my x-chat client at home when I \003\002\n"; IRC::print "\002\0030,8| am on IRC from other places. \003\002\n"; IRC::print "\002\0030,8| I don't think i'll add userlists because there \003\002\n"; IRC::print "\002\0030,8| are already many perl scripts which do that. \003\002\n"; IRC::print "\002\0030,8+------------------------------------------- \003\002\n"; IRC::print "\002\0030,8| Feel free to use it and spread it around; drop \003\002\n"; IRC::print "\002\0030,8| me a note at \003\0032,8jollino\@e-fre.8m.com\003\0030,8 if you find \003\002\n"; IRC::print "\002\0030,8| it somehow useful. I know the code is lame, \003\002\n"; IRC::print "\002\0030,8| but it was my -very- first attempt in writing \003\002\n"; IRC::print "\002\0030,8| something in perl! \003\002\n"; IRC::print "\002\0030,8+------------------------------------------- \003\002\n"; IRC::print "\002\0030,8| A very special kiss to the meaning of my life: \003\002\n"; IRC::print "\002\0030,8| Ti amo da morire, Francesca! =* \003\002\n"; IRC::print "\002\0030,8+----------------------------------------------- \003\002\n"; IRC::print "\n"; return 1; }