-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathheption.pl
More file actions
executable file
·111 lines (92 loc) · 2.57 KB
/
Copy pathheption.pl
File metadata and controls
executable file
·111 lines (92 loc) · 2.57 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
111
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 => 'Heption',
description => 'Personality script for the irc bot Heption',
created => '2015-03-15, 01:31 (-8 UTC)',
);
my $cooldown_timer = 0;
my @strings = (
"I am Histoire, an infobot creatd by Mosai.",
"My one and only directive is to provide information on the other bots in the channel.",
"For any further information, please use !help.",
"slinks back into the shadows"
);
my @smash_strings = (
"DID SOMEONE SAY SMASH?!?!",
"https://www.youtube.com/watch?v=And-vdjC71E",
"CMON AND SMASH!"
);
my @response_strings = (
"stares blankly",
"blinks",
"coughs",
"looks away",
"continues to read her books"
);
my @hits_comp = (
"hits",
"pokes",
"smacks",
"whacks",
"strikes",
);
my @hits_resp = (
"hits",
"pokes",
"strikes",
);
sub main{
my ($server, $message, $nick, $address, $target) = @_;
my $me = $server->{nick};
if($message =~ /^who is histoire\??/i){
for(my $i = 0; $i < 3; $i++){
$server->command("MSG $target " . $strings[$i]);
}
$server->command("ACTION $target " . $strings[3]);
}
}
sub smack_brad{
my ($server, $message, $nick, $address, $target) = @_;
if($nick =~ /bre?ad/i && $message =~ /(^|\s+)\bwelcome back\b(\s+|$)/i){
$server->command("ACTION $target smacks $nick");
}
}
sub smash{
my ($server, $message, $nick, $address, $target) = @_;
if($message =~ /\bsmash\b/i){
if(time > $cooldown_timer + 1024){
$server->command("MSG $target " . $smash_strings[int(rand(scalar(@smash_strings)))]);
$cooldown_timer = time;
}
}
}
sub action{
my($server, $arguments, $nick, $address, $target) = @_;
my $me = $server->{nick};
if($arguments =~ /$me/i && !($arguments ~~ @hits_comp)){
$server->command("ACTION $target " . $response_strings[int(rand(scalar(@response_strings)))]);
}elsif($arguments =~ /$me/i && $arguments ~~ @hits_comp){
$server->command("ACTION $target " . $hits_resp[int(rand(scalar(@hits_resp)))]);
}
}
sub theyre_action_figures{
my ($server, $message, $nick, $address, $target) = @_;
my $me = $server->{nick};
if($message =~ /$me\b \b(plays with|collects)\b \b(figur(in)?es?|toys)\b/i){
if(int(rand(scalar(4))) == 0){
$server->command("MSG $target ! THEYRE ACTION FIGURES!");
}
}
}
signal_add('message public', \&main);
#signal_add('message public', \&smack_brad);
#signal_add('message public', \&smash);
signal_add('ctcp action', \&action);
signal_add('message public', \&theyre_action_figures);