5 posts
Posted 12 November 2012 - 06:33 AM
Ok, so I am very new to ComputerCraft so I am still learning, but I'm currently trying to write a program for a mining turtle to make it dig a pit for me, sort of like the "exctract" command (the file is named "go"). I am getting "go:3: Attempt to index ?(a nil value)" when i try to run it and I don't understand the problem =/
It looks like this…
[attachment=667:friggen program.png]
[attachment=668:the error.PNG]
function digStraight()
for r=1,53 do
turtle.dig()
turtle.forward()
end
end
for i=1,40 do
for j=1,97 do
for k=1,1 do
for m=1,49 do
digStraight()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
digStraight()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
end
turtle.turnLeft()
end
turtle.forward()
end
turtle.turnRight()
turtle.digDown()
turtle.down()
end
8543 posts
Posted 12 November 2012 - 06:42 AM
You are running this on a turtle, correct? Line three looks fine. Did you retype this onto the forums? If so, you may have accidentally fixed a typo when you copied it over. Check through the original code (especially line three) to ensure that everything is spelled and capitalized correctly.
5 posts
Posted 12 November 2012 - 06:52 AM
I don't see a problem with it either =/ its just "turtle.dig()"…. I put a pic of the actual code up, maybe you can pick out the issue there….
5 posts
Posted 12 November 2012 - 06:57 AM
This is being run on a Tekkit multiplayer server if that makes any difference….
386 posts
Location
France
Posted 12 November 2012 - 07:03 AM
Did you mess around with bios.lua ?? It's the only thing i can see …
5 posts
Posted 12 November 2012 - 07:10 AM
no i haven't messed with anything, i built a mining turtle, a disk drive, and a floppy disk. Did cd disk, edit go. Wrote it….. (on a side note it's reassuring to know I'm not the only one that doesn't see an issue =P)
2088 posts
Location
South Africa
Posted 12 November 2012 - 07:24 AM
Use pastebin and then copy it onto your turtle (let's hope http api is enabled) and check if it gives an error? Maybe the disk drive is faulty. I don't get one when i copy your code without edits.
8543 posts
Posted 12 November 2012 - 07:43 AM
Yeah, you could always try copying it directly to the mining turtle, but I'm not really seeing any glaring issues with the code there, as long as it's being run on a turtle, not a computer.
5 posts
Posted 12 November 2012 - 08:09 AM
omg such a fail -.-….. i was trying to run it on a computer, the turtle was in my inventory the whole time…. ugh thanks for the help guys really appreciated!
2088 posts
Location
South Africa
Posted 12 November 2012 - 09:05 AM
omg such a fail -.-….. i was trying to run it on a computer, the turtle was in my inventory the whole time…. ugh thanks for the help guys really appreciated!
:unsure:/>/> ^_^/>/> :(/>/>