Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Onpublic Trigger
- if (my ($showtime = $msg =~ /^\!blueplz (.+)/) {
- if ($irc->is_channel_operator($channel, $nick)) {
- $irc->yield(privmsg => $channel => '' . $nick . 'has activated blue plz timer, once it works');
- $irc->yield(notice => $nick => 'Countdown started for ' . $showtime . ' GMT');
- blueplz($showtime);
- }
- #Subroutine
- sub blueplz {
- my $showtime=shift;
- my $gmt = 'true';
- my ($cyear,$cmonth,$cday, $chour,$cmin,$csec) = Today_and_Now([$gmt]);
- my ($Dd,$Dh,$Dm,$Ds) = Delta_DHMS($cyear,$cmonth,$cday, $chour,$cmin,$csec, $cyear,$cmonth,$cday, $showtime,'0','0');
- if ($Dh == '0') {
- if ($Dm =~ /.{1}0/) {
- if ($oldtime != $Dm) {
- if ($Dm =< '10'){
- my $topic = $irc->channel_topic($channel);
- $topic = s/\| Blue Plz Preshow starts in .* \|/\| Blue Plz Preshow starts in $Dm minutes/;
- $irc->yield(topic => '#cynicalbrit' => $topic);
- } else {
- my $topic = $irc->channel_topic($channel);
- $topic = s/\| Blue Plz Preshow starts in .* \|/\| Blue Plz Preshow starts in $Dm hours/;
- $irc->yield(topic => '#cynicalbrit' => $topic);
- my $oldtime = $Dm;
- sleep(15);
- blueplz($showtime);
- }
- } else {
- if ($oldtime != $Dh) {
- $hour = $Dh++;
- my $topic = $irc->channel_topic($channel);
- $topic = s/\| Blue Plz Preshow starts in .* \|/\| Blue Plz Preshow starts in $hour hours/;
- $irc->yield(topic => '#cynicalbrit' => $topic);
- my $oldtime = $Dh;
- sleep(15);
- blueplz($showtime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement