]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Add support for fractions of seconds in timer.pl
authorPablo Martín Báez Echevarría <redacted>
Sat, 7 Feb 2015 18:12:59 +0000 (16:12 -0200)
committerPablo Martín Báez Echevarría <redacted>
Sat, 7 Feb 2015 18:12:59 +0000 (16:12 -0200)
_data/scripts.yaml
scripts/timer.pl

index e9a530c74386e4f7d24c7124179db2503070df72..3e2937bc9324ac3d32050a3ec9e78b2f88593550 100644 (file)
   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'
index e48f9008cf0258eae43703229751dfd9e15e4543..cd8f8602d73c341f8327ea34a4f8a0d0ced8035c 100644 (file)
@@ -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 );
     }
git clone https://git.99rst.org/PROJECT