From 789cec8f80d0eb94730eea48418c3d64991cc4c8 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Mon, 21 Mar 2011 21:21:20 -0600 Subject: [PATCH] UNO: Fixed a formatting issue in duration. --- NEWS | 23 +++++------------------ doc/CHANGELOG | 2 +- modules/UNO.pm | 12 +++++++++--- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/NEWS b/NEWS index e5125c5..b805ef8 100644 --- a/NEWS +++ b/NEWS @@ -11,30 +11,17 @@ The future of IRC bots is here! Xelhua gives to you, Auto 3.0, a new version of the popular Auto IRC bot. -In this alpha8 release, we have added: +In this alpha9 release, we have added: -* A module to get information on a package in AUR (AUR). -* Support for installs to custom locations. -* Support for system-wide installs. (/usr or /usr/local) -* The `wizard` utility, for creating local Auto config directories. -* EightBall rewritten to be much nicer. -* A module to translate English into LOLCAT (LOLCAT). -* Command aliasing via aliases blocks in the config. -* Added optional uno:english and required uno:msg options. See documentation for UNO. -* Added fastest/slowest game, most cards and most players records to UNO. +None Bug fixes: -* Fixed an issue in auto --help that incorrectly displayed the binary name. -* Fixed an exploit in QDB that allowed users to use services fantasy commands - with the bot's account. -* Fixed a bug in LinkTitle that caused multi-line 's to display wrong. -* Fixed a bug in UNO that allowed users to join more than once. +* UNO: Fixed a formatting issue in duration. Incompatibilities: -* UNO has a uno:msg config option. See documentation for UNO. -* Must be re-installed, run ./install [options] +None We thank you for choosing Auto. Please remember that he is coming to late development stages soon, and testers are needed! But we hope we've piqued @@ -44,4 +31,4 @@ created by anyone and uploaded there for everyone to use. Auto's goal is to create an efficient, stable and highly customizable IRC bot in Perl. To offer an alternative to other platforms. -Enjoy Auto 3.0.0 Alpha 8! +Enjoy Auto 3.0.0 Alpha 9! diff --git a/doc/CHANGELOG b/doc/CHANGELOG index a4ca9ac..3d168d1 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,7 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev =============================================================================== - + * UNO: Fixed a formatting issue in duration. 3.0 Alpha 8 =============================================================================== diff --git a/modules/UNO.pm b/modules/UNO.pm index 2b88692..7439f9b 100644 --- a/modules/UNO.pm +++ b/modules/UNO.pm @@ -653,6 +653,8 @@ sub cmd_uno { while ($durtime >= 3600) { $hours++; $durtime -= 3600 } while ($durtime >= 60) { $mins++; $durtime -= 60 } while ($durtime >= 1) { $secs++; $durtime -= 1 } + if (length $mins < 2) { $mins = "0$mins" } + if (length $secs < 2) { $secs = "0$secs" } $msg .= " The fastest game ever lasted \2$hours:$mins:$secs\2; the winner was \2$data->{fast}->{winner}\2."; } } @@ -664,6 +666,8 @@ sub cmd_uno { while ($durtime >= 3600) { $hours++; $durtime -= 3600 } while ($durtime >= 60) { $mins++; $durtime -= 60 } while ($durtime >= 1) { $secs++; $durtime -= 1 } + if (length $mins < 2) { $mins = "0$mins" } + if (length $secs < 2) { $secs = "0$secs" } $msg .= " The slowest game ever lasted \2$hours:$mins:$secs\2; the winner was \2$data->{slow}->{winner}\2."; } } @@ -1288,6 +1292,8 @@ sub _gameover { while ($durtime >= 3600) { $hours++; $durtime -= 3600 } while ($durtime >= 60) { $mins++; $durtime -= 60 } while ($durtime >= 1) { $secs++; $durtime -= 1 } + if (length $mins < 2) { $mins = "0$mins" } + if (length $secs < 2) { $secs = "0$secs" } privmsg($net, $chan, "Game lasted $hours:$mins:$secs; $UNOGCC cards were played."); # Reset variables. @@ -1438,7 +1444,7 @@ sub sendmsg { } # Start initialization. -API::Std::mod_init('UNO', 'Xelhua', '1.09', '3.0.0a8', __PACKAGE__); +API::Std::mod_init('UNO', 'Xelhua', '1.10', '3.0.0a9', __PACKAGE__); # build: perl=5.010000 __END__ @@ -1449,7 +1455,7 @@ UNO - Three editions of the UNO card game =head1 VERSION - 1.09 + 1.10 =head1 SYNOPSIS @@ -1499,7 +1505,7 @@ The commands this adds are: All of which describe themselves quite well with just the name. -This module is compatible with Auto v3.0.0a8+. +This module is compatible with Auto v3.0.0a9+. =head1 INSTALL