i do some script. Program RaceManager (python scripts) do laps.log file which contain data
20070508 16:24:19,SAtaN,BL1,SAtaN666,XRR,338,3:35.380,2:43.840,3:12.120
20070511 10:56:39,demon,BL1,,FXR,4,1:31.340,0:33.520,1:02.520
20070511 11:11:36,demon,BL1,,FXR,5,11:05.160,0:33.130,1:02.960
20070511 11:13:00,demon,BL1,,FXR,6,1:23.600,0:29.140,0:58.430
20070511 19:58:15,UnDeAD,BL1,835,RB4,1,2:08.780,1:01.040,1:36.670
20070512 14:44:49,MDK,BL1,373,FXR,28,1:33.110,0:35.860,1:06.050
construction
date time,uname (not pname),track,plate,cname,lapsdone,ltime,sp1[,sp2,sp3]
I maked stats (php) using this file. Now i have all without uname and track (lapsdone left stats). This is my script (not accomplished)
function ca(imsg)
luaLFS:tiny(1, TINY_NPL)
end
evt_bind(EVT_CONNECTED, ca)
function put_massive(imsg)
local t = luaLFS:npl(imsg)
s = { [t.plid] = { user = "", track = "", plate = t.plate, car = t.cname, sp1 = 0, sp2 = 0, sp3 = 0} }
print("Car: "..s[t.plid].car)
print("Plate: "..s[t.plid].plate)
end
evt_bind(ISP_NPL, put_massive)
function l_split(imsg)
local t = luaLFS:spx(imsg)
if (t.split == 1) then
s[t.plid].sp1 = t.stime
print ("SP1="..s[t.plid].sp1)
end
if (t.split == 2) then
s[t.plid].sp2 = t.stime
print ("SP1="..s[t.plid].sp1)
print ("SP2="..s[t.plid].sp2)
end
if (t.split == 3) then
s[t.plid].sp3 = t.stime
print ("SP1="..s[t.plid].sp1)
print ("SP2="..s[t.plid].sp2)
print ("SP3="..s[t.plid].sp3)
end
end
evt_bind(ISP_SPX, l_split)
function l_lap(imsg)
local t = luaLFS:lap(imsg)
local file_w = io.open("D:/Downloads/LFS/luaLFS-0.7/scripts/laps.log","a")
file_w:write(os.date('%x %X').." "..s[t.plid].plate.." "..s[t.plid].car.." "..t.ltime.." "..s[t.plid].sp1.." "..s[t.plid].sp2.."\n")
file_w:close()
end
evt_bind(ISP_LAP, l_lap)