diff options
| author | Pablo Martín Báez Echevarría | 2015-02-07 16:12:59 -0200 |
|---|---|---|
| committer | Pablo Martín Báez Echevarría | 2015-02-07 16:12:59 -0200 |
| commit | f25d6e1bbdc2deb12c9e6a077bb659f8f3da0400 (patch) | |
| tree | c2ab2cdfb6e9c8bdd0ddb08e888eacde1500b0d5 /scripts | |
| parent | 65c479316d3d69643ee4b0d3ed01f81cfbf994d0 (diff) | |
| download | scripts.irssi.org-f25d6e1bbdc2deb12c9e6a077bb659f8f3da0400.tar.bz2 | |
Add support for fractions of seconds in timer.pl
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/timer.pl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/timer.pl b/scripts/timer.pl index e48f900..cd8f860 100644 --- a/scripts/timer.pl +++ b/scripts/timer.pl @@ -19,14 +19,14 @@ use warnings; use vars qw ($VERSION %IRSSI); use Irssi 20020325 qw (command_bind command_runsub command timeout_add timeout_remove signal_add_first); -$VERSION = '0.5'; +$VERSION = '0.6'; %IRSSI = ( authors => 'Kimmo Lehto, Marcus Rueckert', contact => 'kimmo@a-men.org, darix@irssi.org' , name => 'Timer', description => 'Provides /timer command for mIRC/BitchX type timer functionality.', license => 'Public Domain', - changed => '2003-08-27' + changed => '2015-02-07' ); our %timers; @@ -88,11 +88,11 @@ command_bind 'timer add' => sub { my ( $data, $server, $item ) = @_; my ( $name, $interval, $times, $command ); - if ( $data =~ /^\s*(\w+)\s+(\d+)\s+(-?\d+)\s+(.*)$/ ) { + if ( $data =~ /^\s*(\w+)\s+(\d+(?:\.\d+)?)\s+(-?\d+)\s+(.*)$/ ) { ( $name, $interval, $times, $command ) = ( $1, $2, $3, $4 ); $times = -1 if ( $times == 0 ); } - elsif ( $data =~ /^\s*(\w+)\s+(\d+)\s+(.*)$/ ) + elsif ( $data =~ /^\s*(\w+)\s+(\d+(?:\.\d+)?)\s+(.*)$/ ) { ( $name, $interval, $times, $command ) = ( $1, $2, -1, $3 ); } |
