-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpoke.pl
More file actions
executable file
·110 lines (88 loc) · 2.17 KB
/
Copy pathpoke.pl
File metadata and controls
executable file
·110 lines (88 loc) · 2.17 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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 => 'poke',
description => 'Reacts to actions directed at the user.',
changed => 'yyyy-mm-dd hh:mm (UTC-8:00)',
);
my %ignore = (
"Mesril" => 1,
"Eldora" => 1,
"sugarass" => 1,
"Droplet" => 1,
"Camazotz" => 1,
);
my @verb = (
"smacks",
"hits",
"whacks",
"whops",
"assaults",
"strikes",
);
my @adj = (
"happy",
"sad",
"giant",
"tiny",
"colorful",
);
my @obj = (
"leek",
"brick",
"squeaky hammer",
"scissor sword",
"corgi",
"vocaloid",
"pikachu",
"tank",
"frying pan",
"vacuum",
"battleship",
"sandwich",
"chocolate chip muffin",
"gas powered stick",
"panda",
"Rule Breaker",
"Friendmaker",
);
sub poke{
my($server, $arguments, $nick, $address, $target) = @_;
{ no warnings 'uninitialized'; return if ($ignore{$nick} == 1); }
if($nick =~ /amiigo\|\d+/i){ return; }
my $me = $server->{nick};
if($arguments =~ /\S $me('s|\s|\w+|$)/i) {
return if $arguments =~ /unrelated/i;
$server->command("DESCRIBE $target $verb[int(rand(scalar(@verb)))] $nick with a $adj[int(rand(scalar(@adj)))] $obj[int(rand(scalar(@obj)))]");
}
}
sub mimic_droplet{
my($server, $arguments, $nick, $address, $target) = @_;
my $me = $server->{nick};
{ no warnings 'uninitialized'; return if ($ignore{$nick} == 1); }
if($nick =~ /amiigo\|\d+/i){ return; }
if($arguments =~ /\S $me('s|\s|\w+|$)/i) {
$arguments =~ s/^$nick //ig;
$arguments =~ s/\b$me\b/$nick/ig;
$server->command("ACTION $target $arguments");
}
}
sub explode{
my($server, $arguments, $nick, $address, $target) = @_;
{ no warnings 'uninitialized'; return if ($ignore{$nick} == 1); }
if($nick =~ /amiigo\|\d+/i){ return; }
my $me = $server->{nick};
if($arguments =~ /\be?xp(eldo|lod)es?\b/i){
my $aisle = int(rand(15))+1;
$server->command("MSG $target CLEANUP ON AISLE $aisle!");
}
}
signal_add('ctcp action', \&poke);
#signal_add('ctcp action', \&mimic_droplet);
signal_add('ctcp action', \&explode);