# Type: Input # Category: Admin # Description: Shows schedule items # Author: Andriy Lesyuk new Orangutan::Context( response => [ '^Show schedule!*\.*$' ], handler => sub { my ($context, $user, $item) = @_; if ($user->IsCreator) { my $message = Orangutan::Context::Random( 'The following is to be run', 'Schedule items are', 'Schedule contains' ); $message .= ":\n"; foreach my $schedule (@{$main::users->{'schedule'}}) { my ($min, $hour, $day, $month, $year) = (localtime($schedule->[2]))[1..5]; $message .= sprintf("%02d:%02d %02d.%02d.%04d - %s (%s)\n", $hour, $min, $day, $month + 1, $year + 1900, $schedule->[0]->GetID, $schedule->[1]); } $user->SendMessage($message); } else { $user->SendMessage([ 'Maybe next time...', 'What is this?..', 'Dream about!..' ]); } }, weight => -50 ); # kate: syntax perl