Openkore.com

OpenKore Forums
It is currently 23 Aug 2019, 20:02

All times are UTC - 5 hours [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: autobreaktime syntax for multiple days
PostPosted: 08 Mar 2017, 23:47 
Offline
Noob
Noob

Joined: 01 Jan 2017, 23:59
Posts: 4
I was wondering if anyone knew the syntax for multiple days, I have tried

Code:
autoBreakTime tue | wed {
    startTime 01:00
    stopTime 02:00
}

I also tried
Code:
autoBreakTime [tue | wed] {
    startTime 01:00
    stopTime 02:00
}

and w/o spaces
Code:
autoBreakTime tue|wed {
    startTime 01:00
    stopTime 02:00
}

Code:
autoBreakTime [tue|wed] {
    startTime 01:00
    stopTime 02:00
}

but none of these syntax work. I was wondering what am i doing wrong?


Top
 Profile  
 
 Post subject: Re: autobreaktime syntax for multiple days
PostPosted: 09 Mar 2017, 05:59 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 361
Multiple days syntax not supported by plugin due to this code:.
Code:
my @wdays = qw/sun mon tue wed thu fri sat/;
....
my (undef, $min, $hour, undef, undef, undef, $wday) = localtime;
....
next unless $config{$prefix} =~ /^(?:all|$wdays[$wday])$/i;


Use 2 different blocks:
Code:
autoBreakTime wed {
    startTime 01:00
    stopTime 02:00
}
autoBreakTime tue {
    startTime 01:00
    stopTime 02:00
}



BUT if you change this line in breakTime.pl:
Code:
next unless $config{$prefix} =~ /^(?:all|$wdays[$wday])$/i;

to this line:
Code:
next unless split /\s+/,  $config{$prefix} =~ /all|$wdays[$wday]/i;

it will work like this:
Code:
autoBreakTime wed tue {
    startTime 01:00
    stopTime 02:00
}

_________________
Please use pin function for uploading your file contents!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group