Soldato
i've been playing around with the computercraft mod for minecraft, where you can get a moveable computer that can do stuff in minecraft. it uses the lua language with a couple of bits bolted on so i figured someone might know what i'm doing wrong
i am using the fs API (designed for computercraft i believe) to update a file with details about the task it is doing and the position it is in, so that the turtle can resume doing what it was doing from where it left off if the server is restarted.
i am getting an 'attempted to call nil' error on line 23, despite using global variables for everything in the function. (i've tried it with and without global before the variables). there is already a file written in the correct place with the correct name with ten 0's as data to read
code: http://pastebin.com/H1rYTECU
here is the guide i have been following for using the fs API to get data stored to a file. I have used it with local variables in another program and it has worked just fine: http://www.computercraft.info/forums2/index.php?/topic/3923-basic-file-io-learn-how-to-save-data/
and this is the computercraft wiki: http://computercraft.info/wiki/Main_Page
if there is anything else you dont recognise in the code then it is probably in there (the turtle API page is probably worth a look, since i use it a lot)
any help is much apprecaited
i am using the fs API (designed for computercraft i believe) to update a file with details about the task it is doing and the position it is in, so that the turtle can resume doing what it was doing from where it left off if the server is restarted.
i am getting an 'attempted to call nil' error on line 23, despite using global variables for everything in the function. (i've tried it with and without global before the variables). there is already a file written in the correct place with the correct name with ten 0's as data to read
code: http://pastebin.com/H1rYTECU
here is the guide i have been following for using the fs API to get data stored to a file. I have used it with local variables in another program and it has worked just fine: http://www.computercraft.info/forums2/index.php?/topic/3923-basic-file-io-learn-how-to-save-data/
and this is the computercraft wiki: http://computercraft.info/wiki/Main_Page
if there is anything else you dont recognise in the code then it is probably in there (the turtle API page is probably worth a look, since i use it a lot)
any help is much apprecaited