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 | |
| parent | 65c479316d3d69643ee4b0d3ed01f81cfbf994d0 (diff) | |
| download | scripts.irssi.org-f25d6e1bbdc2deb12c9e6a077bb659f8f3da0400.tar.bz2 | |
Add support for fractions of seconds in timer.pl
| -rw-r--r-- | _data/scripts.yaml | 4 | ||||
| -rw-r--r-- | scripts/timer.pl | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/_data/scripts.yaml b/_data/scripts.yaml index e9a530c..3e2937b 100644 --- a/_data/scripts.yaml +++ b/_data/scripts.yaml @@ -3701,9 +3701,9 @@ description: 'Provides /timer command for mIRC/BitchX type timer functionality.' filename: timer.pl license: 'Public Domain' - modified: '2014-09-14 22:49:20' + modified: '2015-02-07 16:11' name: Timer - version: '0.5' + version: '0.6' - authors: 'Jari Matilainen' contact: 'irc: vague`@freenode' 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 ); } |
