func GetField(L *luajit.State, f string) (float64, bool) { var result float64 L.Pushstring(f) L.Gettable(-2) if L.Isnumber(-1) != true { print("invalid field in table") return 0, false } result = L.Tonumber(-1) L.Pop(1) return result, true }
func SetField(L *luajit.State, f string, v float64) { L.Pushstring(f) L.Pushnumber(v) L.Settable(-3) }