mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-08 05:15:41 -04:00
fun
This commit is contained in:
parent
50def2b8a6
commit
e166ae6bd8
1 changed files with 33 additions and 11 deletions
|
@ -1,7 +1,27 @@
|
||||||
sub {
|
sub {
|
||||||
my( $said ) = @_;
|
my( $said ) = @_;
|
||||||
|
|
||||||
my @a=("Outlook good",
|
my $ors =()= $said->{body}=~m/\bor\b/g;
|
||||||
|
my $commas =()= $said->{body}=~m/,(?=.*\bor\b)/g;
|
||||||
|
|
||||||
|
my @a;
|
||||||
|
|
||||||
|
if ($ors == 1)
|
||||||
|
{
|
||||||
|
if ($commas > 0)
|
||||||
|
{
|
||||||
|
@a = split(/\bor\b/, $said->{body});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@a = split(/(?:\bor\b|\s*,\s*)/, $said->{body});
|
||||||
|
}
|
||||||
|
|
||||||
|
s/^\s*//, s/\s*$// for @a; #trim them up
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@a=("Outlook good",
|
||||||
"Outlook not so good",
|
"Outlook not so good",
|
||||||
"My reply is no",
|
"My reply is no",
|
||||||
"Don't count on it",
|
"Don't count on it",
|
||||||
|
@ -9,17 +29,19 @@ sub {
|
||||||
"Ask again later",
|
"Ask again later",
|
||||||
"Most likely",
|
"Most likely",
|
||||||
"Cannot predict now",
|
"Cannot predict now",
|
||||||
"Yes","Yes, definitely",
|
"Yes",
|
||||||
|
"Yes, definitely",
|
||||||
"Better not tell you now",
|
"Better not tell you now",
|
||||||
"It is certain",
|
"It is certain",
|
||||||
"Very doubtful",
|
"Very doubtful",
|
||||||
"It is decidedly so",
|
"It is decidedly so",
|
||||||
"Concentrate and ask again",
|
"Concentrate and ask again",
|
||||||
"Signs point to yes",
|
"Signs point to yes",
|
||||||
"My sources say no",
|
"My sources say no",
|
||||||
"Without a doubt",
|
"Without a doubt",
|
||||||
"Reply hazy, try again",
|
"Reply hazy, try again",
|
||||||
"As I see it, yes");
|
"As I see it, yes");
|
||||||
|
}
|
||||||
|
|
||||||
print $a[rand@a]."."
|
print $a[rand@a]."."
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue