It's always fun to try and sound all evil by talking in Old English and saying lots of fun evil stuff, so I decided to make a command that generates evil sentences randomly.
Usage: !evil
Examples:
Quote:
Kirsle: !evil sign my guestbook CodyCKS: Sign my guestbook, slave, or be glued to the ground when Hell freezeth over. To escape thee my wrath, sign my guestbook! Kirsle: !evil bow down to your new ruler CodyCKS: Bow down to your new ruler, mortal, or suffer an eternity of pain and torture such as no mortal hath ever experienced before or shalt ever experience again. To avoid thee this horrible punishment, bow down to your new ruler! Kirsle: !evil make sure Tyler doesn't live past 25 CodyCKS: Make sure tyler doesn't live past 25, thou puny human, or be sentenced thee to a life of everlasting bankruptcy. To be spared thee this inhumane destiny, make sure tyler doesn't live past 25!
The Code:
Code:
# . . <Leviathan><br /># .:...:: Command Name // !evil<br /># .:: ::. Description // Evil way to issue commands.<br /># ..:;;. ' .;;:.. Usage // !evil<br /># . ''' . Permissions // Public.<br /># :;,:,;: Listener // All<br /># : : Copyright // 2005 AiChaos Inc.<br /><br />sub evil {<br /> my ($self,$client,$msg) = @_;<br /><br /> # Needs a message.<br /> return "Give me an order when using this command, i.e.\n\n"<br /> . "!evil Sign my guestbook" if length $msg == 0;<br /><br /> $msg = lc($msg);<br /> my $first = ucfirst($msg);<br /><br /> # Arrays.<br /> my @start = (<br /> "<first>, mortal, ",<br /> "<first>, thou puny mortal, ",<br /> "<first>, thou mortal, ",<br /> "<first>, human, ",<br /> "<first>, slave, ",<br /> "<first>, thou puny human, ",<br /> "<first>, thou human, ",<br /> );<br /> my @main = (<br /> "or suffer an eternity of pain and torture such as no mortal hath ever experienced before or shalt ever experience again. ",<br /> "or be sentenced thee to a life of everlasting bankruptcy. ",<br /> "or live for six hundred and sixty six years the life of a flea. ",<br /> "or be sentenced to forty years on the Island of Perpetual Tickling. ",<br /> "or be glued to the ground when Hell freezeth over. ",<br /> "or feel the full weight of the humans' sins upon thy shoulders. ",<br /> "or abandon thy life thou hast known, and live eternally as my minion. ",<br /> "and conform to my will. ",<br /> "and abandon thee the very thing that makes thee human. ",<br /> );<br /> my @last = (<br /> "To avoid thee this insufferable fate, <order>!",<br /> "To be spared thee this inhumane destiny, <order>!",<br /> "So <order> if thou wanteth but to live.",<br /> "To avoid thee this horrible punishment, <order>!",<br /> "To escape thee my wrath, <order>!",<br /> "If thou expecteth to see the light of day, follow my orders and <order>!",<br /> );<br /><br /> # Generate the sentence parts.<br /> my $a = $start [ int(rand(scalar(@start))) ];<br /> my $b = $main [ int(rand(scalar(@main))) ];<br /> my $c = $last [ int(rand(scalar(@last))) ];<br /><br /> my $final = join ("", $a, $b, $c);<br /> $final =~ s/<first>/$first/ig;<br /> $final =~ s/<order>/$msg/ig;<br /><br /> return "<font color=\"#FF0000\">$final";<br />}<br />{<br /> Category => 'Fun Stuff',<br /> Description => 'Evil way to issue commands.',<br /> Usage => '!evil <order>',<br /> Listener => 'All',<br />};
Net::oscar=hash(0x19d2064), human, and conform to my will. To avoid thee this horrible punishment, net::oscar=hash(0x19d2064)!
insted of what it should be
When it filters in your command, it gets its data from your message.
$first (the first one it filters in) is your exact message, except formalized -- the first letter is capital. The second one it filters in, IS your message.
It appears in your case that it thinks that $self (the Net::OSCAR reference) is your message.
The correct order that variables are received in this, and any other Leviathan command, is:
Code:
my ($self,$client,$msg) = @_;
$self = Net::OSCAR object -- always comes first $client = username -- always comes second $msg = their message -- always comes last.
The order of the variables is important. The user's message is always the third thing that any command receives, never the first. _________________ Current Site (2008) http://www.cuvou.com/
# . . <Leviathan>
# .:...:: Command Name // !evil
# .:: ::. Description // Evil way to issue commands.
# ..:;;. ' .;;:.. Usage // !evil
# . ''' . Permissions // Public.
# :;,:,;: Listener // All
# : : Copyright // 2005 AiChaos Inc.
my $msg = $1;
# Needs a message.
return "Give me an order when using this command, i.e.\n\n"
. "!evil Sign my guestbook" if length $msg == 0;
$msg = lc($msg);
my $first = ucfirst($msg);
# Arrays.
my @start = (
"<first>, mortal, ",
"<first>, thou puny mortal, ",
"<first>, thou mortal, ",
"<first>, human, ",
"<first>, slave, ",
"<first>, thou puny human, ",
"<first>, thou human, ",
);
my @main = (
"or suffer an eternity of pain and torture such as no mortal hath ever experienced before or shalt ever experience again. ",
"or be sentenced thee to a life of everlasting bankruptcy. ",
"or live for six hundred and sixty six years the life of a flea. ",
"or be sentenced to forty years on the Island of Perpetual Tickling. ",
"or be glued to the ground when Hell freezeth over. ",
"or feel the full weight of the humans' sins upon thy shoulders. ",
"or abandon thy life thou hast known, and live eternally as my minion. ",
"and conform to my will. ",
"and abandon thee the very thing that makes thee human. ",
);
my @last = (
"To avoid thee this insufferable fate, <order>!",
"To be spared thee this inhumane destiny, <order>!",
"So <order> if thou wanteth but to live.",
"To avoid thee this horrible punishment, <order>!",
"To escape thee my wrath, <order>!",
"If thou expecteth to see the light of day, follow my orders and <order>!",
);
# Generate the sentence parts.
my $a = $start [ int(rand(scalar(@start))) ];
my $b = $main [ int(rand(scalar(@main))) ];
my $c = $last [ int(rand(scalar(@last))) ];