lua compat; register.cgi - add link to puzzles

This commit is contained in:
J. Patrick Avery, Jr 2017-02-05 20:11:45 -07:00
parent 2a3970d5e3
commit 42bae17f16
4 changed files with 5 additions and 7 deletions

View File

@ -7,8 +7,6 @@ else
fi fi
basedir=$(pwd) basedir=$(pwd)
printf "Updating moth instance in %s\n" $(pwd)
# Do nothing if `disabled` is present # Do nothing if `disabled` is present
if [ -f disabled ]; then if [ -f disabled ]; then
exit exit

View File

@ -1,4 +1,4 @@
#! /usr/bin/lua5.3 #! /usr/bin/lua5.1
local basedir = arg[1] local basedir = arg[1]
local statedir = basedir .. "/state" local statedir = basedir .. "/state"
@ -10,7 +10,7 @@ local nteams = 0
local NR = 0 local NR = 0
for line in io.lines(statedir .. "/points.log") do 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] local teamno = teams[hash]
if not teamno then if not teamno then

View File

@ -1,4 +1,4 @@
#! /usr/bin/lua5.3 #! /usr/bin/lua5.1
local basedir = arg[1] local basedir = arg[1]
local statedir = basedir .. "/state" local statedir = basedir .. "/state"
@ -9,7 +9,7 @@ for cat in io.lines(statedir .. "/categories.txt") do
end end
for line in io.lines(statedir .. "/points.log") do 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 points = tonumber(points) or 0
-- Skip scores for removed categories -- Skip scores for removed categories

View File

@ -30,4 +30,4 @@ end
f:write(team) f:write(team)
f:close() 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! <a href='/puzzles.html'>Puzzles</a>")