local file function otr_init() otr.log("example.lua starting; writing to /tmp/lua.out") file = io.open("/tmp/lua.out", "a") file:write("written by OwnTracks Recorder version " .. otr.version .. "\n") end function otr_hook(topic, _type, data) local timestr = otr.strftime("It is %T in the year %Y", 0) print("L: " .. topic .. " -> " .. _type) file:write(timestr .. " " .. topic .. " lat=" .. data['lat'] .. data['addr'] .. "\n") end