-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinfobothelp.pl
More file actions
executable file
·55 lines (45 loc) · 1.61 KB
/
Copy pathinfobothelp.pl
File metadata and controls
executable file
·55 lines (45 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use strict;
use Irssi qw/signal_add get_irssi_dir/;
use Irssi::Irc;
use warnings;
use vars qw($VERSION %IRSSI);
$VERSION = "1";
%IRSSI = (
authors => 'Jaykob Ross',
contact => 'Mosai57@gmail.com',
name => 'Chatter',
description => 'IRC Quote script. Returns a random line from a provided log file.',
changed => 'yyyy-mm-dd hh:mm (UTC-8:00)',
);
my %botinfo = (
"heption" => 'Wouldnt you like to know.',
"droplet" => 'Droplet: !overlord, !mrwelch, !seen {name}, !beelab {equation}, !kjp, !zinit, !dcc',
"moberry" => 'Moberry: !chatter, !spell {name}, !rlh, !rps, !rpsls',
"eldora" => 'Eldora: !buh, !chioroll',
"camazotz" => 'Camazotz: !roll {#d#}, !draw, !random {bot will give further info}',
"mesril" => 'Mesril: !rroulette, !ddg {search term}',
);
sub help{
my ($server, $message, $nick, $address, $target) = @_;
my $me = $server->{nick};
my $chanobj = $server->channel_find($target);
my $lcme = lc($me);
if($message =~ /^!help \w+$/i){
my @mess = split(' ', $message);
#my $search = $mess[1];
$mess[1] = lc($mess[1]);
if( exists( $botinfo{$mess[1]} ) && $chanobj->nick_find($mess[1]) ){
$server->command("NOTICE $nick ! " . $botinfo{ $mess[1] } );
} elsif( $mess[1] eq "all" ){
my @bts = keys %botinfo;
for my $bts (keys %botinfo){
if($chanobj->nick_find($bts) && $bts ne $lcme){
$server->command("NOTICE $nick ! " . $botinfo{$bts});
}
}
} else{ $server->command("NOTICE $nick ! Error, cannot find that name in my list."); }
} elsif($message =~ /^!help(\s+)?$/i){
$server->command("NOTICE $nick ! Please search a bot by name.");
}
}
signal_add('message public', \&help);