1 ###RUN_PERL: #!/usr/bin/perl
3 # update.pl is generated from update.1.pl.
5 # update already ONGed frames & stuff
7 # Copyright (C) 2016, 2017, 2023, 2024 Balthasar SzczepaĆski
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU Affero General Public License as
11 # published by the Free Software Foundation, either version 3 of the
12 # License, or (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU Affero General Public License for more details.
19 # You should have received a copy of the GNU Affero General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 use Encode::Locale ('decode_argv');
25 use Encode ('encode', 'decode');
27 ###PERL_LIB: use lib /botm/lib/bsta
37 ###PERL_DATA_DEFAULT_PATH: DATA_DEFAULT_PATH = /botm/data/bsta/default
38 ###PERL_DATA_SETTINGS_PATH: DATA_SETTINGS_PATH = /botm/data/bsta/settings
39 ###PERL_DATA_STATE_PATH: DATA_STATE_PATH = /botm/data/bsta/state
41 binmode STDIN, ':encoding(UTF-8)';
42 binmode STDOUT, ':encoding(UTF-8)';
43 binmode STDERR, ':encoding(UTF-8)';
49 my %settings = read_data_file(DATA_SETTINGS_PATH());
50 my %default = read_data_file(DATA_DEFAULT_PATH());
51 my %state = read_data_file(DATA_STATE_PATH());
53 my $ong_state = int($state{'state'});
54 my $last_frame = ($ong_state > STATE->{'inactive'}) ?
64 foreach my $id (@ARGV) {
68 for (my $f=0; $f<=$last_frame; $f+=1) {
72 elsif ($id =~ /^[0-9]+$/) {
74 if ($f <= $last_frame) {
78 print "$f > $last_frame\n";
82 elsif ($id =~ /^[ic]$/) {
91 foreach my $id (@list) {
96 '', # timer value; not relevant
108 if (($id == 0) && ($ong_state > STATE->{'inactive'})) {