Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use warnings;
- use Xchat ':all';
- Xchat:::hook_command('aways', 'aways');
- sub aways {
- my $buffer = 'I\'m going to listen to Music ((((((((IN-DOLBY-SURROUND-SOUND-AS-I-FALL-ASLEEP)))))))) - Time: ';
- my $time = '';
- my @local = localtime(time);
- my($hours,$suffix);
- $hours = $local[2];
- if($hours > 12) {
- $hours -= 12;
- $suffix = 'pm';
- }
- elsif( $hours == 0) {
- $hours = 12;
- $suffix = 'am';
- }
- else {
- $suffix = 'am';
- }
- $buffer .= $hours . ':' . $local[1] . ':' . $local[0] . $suffix;
- Xchat::command('AWAY ' . $buffer);
- Xchat::command('NICK ' . Xchat::get_info('nick') . '|sleep');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement