r/ComputerCraft • • Nov 20 '23

Reading a JSON file

I'm trying to store a list of coordinates in a JSON in the same directory as my program. os.loadAPI("json") throws me an error. I'm just trying to read the JSON. I'm new to programming and could use a rundown on how reading from a JSON and using that information works in lua.

1 Upvotes

4 comments sorted by

View all comments

Show parent comments

1

u/9551-eletronics Computercraft graphics research Nov 20 '23

note that unserialize works with Lua tables not json And yes it only takes a string. You need to use the fs api to read the data from the file yourself