7 posts
Posted 10 January 2013 - 01:30 PM
well im really new to computer craft tried to start up some turtles and made a start up disck that compounded this with the start up for rednet that i made and i got the error "attempt to index ? (a nil value) " on line six from this
fs.copy("disk/dark","dark")
rednet.open("right")
print("my name is")
x=os.computerID()
print(x)
turtle.forward()
shell.run("dark")
help wil be well appreciated
7508 posts
Location
Australia
Posted 10 January 2013 - 01:33 PM
firstly this forum has [code][/code] tags… it makes code look nicer :)/>
now stupid question, but it has to be checked, this is on a turtle yes?
139 posts
Location
USA
Posted 10 January 2013 - 01:36 PM
my guess is you have a typo in the code that's actually on your turtle.
make sure it's actually turtle.forward() with no spelling mistakes. You typed it correctly here though.
7 posts
Posted 10 January 2013 - 01:53 PM
no its on a floppy and the error is from the computer
7508 posts
Location
Australia
Posted 10 January 2013 - 01:55 PM
the error is because a computer can not use the turtle api. its not a turtle, it cant move. so it doesn't know what to do with turtle.forward(). if you put it on a turtle it will work.
7 posts
Posted 10 January 2013 - 01:57 PM
it is also spelled correctly
7508 posts
Location
Australia
Posted 10 January 2013 - 01:59 PM
it doesn't matter if its spelled correctly or not if it doesn't exist. a computer CANNOT do turtle things!
7 posts
Posted 10 January 2013 - 02:03 PM
ok thanks also does it ever matter what kind of floppy
7508 posts
Location
Australia
Posted 10 January 2013 - 02:05 PM
no a floppy is just a storage medium that goes into a disk drive. the disk drive can be accessed by any computer/turtle beside it.
7 posts
Posted 10 January 2013 - 02:06 PM
thanks sorta fell like a dumbass
2005 posts
Posted 10 January 2013 - 09:10 PM
Don't worry about it. I mean, yeah, putting a turtle API command on a computer makes so little sense that I didn't even consider the possibility, but there isn't any way you would really know that computers don't even have access to the turtle API unless you'd read the API or had tried loading it on a computer (or looked up the value of type(turtle) in lua or another program).
Before I looked at the API, I would have assumed that a turtle API function would just fail on a computer and give a false/nil return.