Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use warnings;
- use strict;
- use utf8;
- use Acme::LOLCAT;
- use Xchat ':all';
- Xchat::hook_command('fabulous', 'fabulous');
- Xchat::hook_command('fabface','fabface');
- Xchat::hook_command('bubble','bubble');
- Xchat::hook_command('ascii2fabulous','fabulous_wild');
- Xchat::hook_command('fantabulous','fantabulous');
- Xchat::hook_command('fantabface', 'fantabulousface');
- Xchat::hook_command('lolcat','lolcat');
- Xchat::hook_command('fabucat','fabucat');
- Xchat::hook_command('rainbowfabcat', 'rainbowfabcat');
- Xchat::hook_command('fabulous_type', 'set_type');
- my $text_type = 'fabulous';
- my @colors = qw[05 04 07 08 09 03 11 10 12 02 06 13 15 14];
- my $a = 97;
- my %start = (
- fabulous => 65313,
- bubble => 9424,
- sub_bold => 63329,
- super => 7468,
- douche => 120094
- );
- sub get_letter {
- my ($type, $letter) = (shift, shift);
- my $ord = (ord lc $letter) - $a;
- return $letter if $ord < 0 || $ord > 25;
- my $newletter = $start{$type} + $ord;
- chr $newletter
- }
- sub ascii2fabulous {
- my $type = shift;
- my @letters = split //, shift;
- my $str = q();
- foreach my $letter (@letters) {
- $str .= get_letter($type, $letter);
- }
- $str
- }
- sub fabulous_wild {
- my $type = (split(/\s/, $_[1][1], 2))[0];
- my $msg = (split(/\s/, $_[1][1], 2))[1];
- Xchat::command('SAY '.ascii2fabulous($type, $msg));
- }
- sub fabface {
- Xchat::command('SAY \( *¯∇¯)ノ ☆'.ascii2fabulous('fabulous', $_[1][1]).'~☆');
- }
- sub bubble {
- Xchat::command('SAY '.ascii2fabulous('bubble', $_[1][1]));
- }
- sub fabulous {
- Xchat::command('SAY '.ascii2fabulous('fabulous',$_[1][1]));
- }
- sub fantabulous {
- Xchat::command('SAY '.str2rainbow(ascii2fabulous($text_type,$_[1][1])));
- }
- sub fantabulousface {
- Xchat::command('SAY '.str2rainbow('\( *¯∇¯)ノ ☆').str2rainbow(ascii2fabulous($text_type,$_[1][1])).'~☆');
- }
- sub str2rainbow {
- my ($msg, $str) = (shift, '');
- foreach my $l (split //, $msg) {
- if (uc $l eq $l) {
- $l = "\2$l\2"
- }
- $l = "\x03".($colors[rand @colors]).$l;
- $str .= $l
- }
- return $str
- }
- sub lolcat {
- Xchat::command("SAY ".translate($_[1][1]));
- }
- sub set_type {
- if (exists $start{$_[1][1]}) {
- $text_type = $_[1][1];
- Xchat::print("text_type: $text_type");
- }
- else {
- Xchat::print("No such text_type");
- }
- }
- sub fabucat {
- Xchat::command("SAY ".ascii2fabulous($text_type,translate($_[1][1])));
- }
- sub rainbowfabcat {
- Xchat::command('SAY '.ascii2fabulous($text_type,str2rainbow(translate($_[1][1]))));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement