From 42bae17f16256953d6d97a3861b60a91315ec9c8 Mon Sep 17 00:00:00 2001 From: "J. Patrick Avery, Jr" Date: Sun, 5 Feb 2017 20:11:45 -0700 Subject: [PATCH] lua compat; register.cgi - add link to puzzles --- bin/once | 2 -- bin/points | 4 ++-- bin/puzzles | 4 ++-- www/cgi-bin/register.cgi | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bin/once b/bin/once index 82ee920..7645174 100755 --- a/bin/once +++ b/bin/once @@ -7,8 +7,6 @@ else fi basedir=$(pwd) -printf "Updating moth instance in %s\n" $(pwd) - # Do nothing if `disabled` is present if [ -f disabled ]; then exit diff --git a/bin/points b/bin/points index 79a4e5d..7195892 100755 --- a/bin/points +++ b/bin/points @@ -1,4 +1,4 @@ -#! /usr/bin/lua5.3 +#! /usr/bin/lua5.1 local basedir = arg[1] local statedir = basedir .. "/state" @@ -10,7 +10,7 @@ local nteams = 0 local NR = 0 for line in io.lines(statedir .. "/points.log") do - local ts, hash, cat, points = line:match("(%d+) (%g+) (%g+) (%d+)") + local ts, hash, cat, points = line:match("(%d+) ([^%s]+) ([^%s]+) (%d+)") local teamno = teams[hash] if not teamno then diff --git a/bin/puzzles b/bin/puzzles index 0259174..044b2ac 100755 --- a/bin/puzzles +++ b/bin/puzzles @@ -1,4 +1,4 @@ -#! /usr/bin/lua5.3 +#! /usr/bin/lua5.1 local basedir = arg[1] local statedir = basedir .. "/state" @@ -9,7 +9,7 @@ for cat in io.lines(statedir .. "/categories.txt") do end for line in io.lines(statedir .. "/points.log") do - local ts, team, cat, points = line:match("^(%d+) (%g+) (%g+) (%d+)") + local ts, team, cat, points = line:match("^(%d+) ([^%s]+) ([^%s]+) (%d+)") points = tonumber(points) or 0 -- Skip scores for removed categories diff --git a/www/cgi-bin/register.cgi b/www/cgi-bin/register.cgi index c1ca49d..f68ec86 100755 --- a/www/cgi-bin/register.cgi +++ b/www/cgi-bin/register.cgi @@ -30,4 +30,4 @@ end f:write(team) f:close() -koth.page("Success", "Okay, your team has been named and you may begin using your hash!") +koth.page("Success", "Okay, your team has been named and you may begin using your hash! Puzzles")