6 posts
Posted 02 April 2013 - 08:20 AM
What did i wrong with this program for a mining turtle? Please help ;)/>
turtle.down()
for i = 1,60 do
j = 1,4 do
turtle.forward()
turtle.digdown()
turtle.down()
turtle.dig()
turtle.forward()
turtle.turnLeft()
end
end
1688 posts
Location
'MURICA
Posted 02 April 2013 - 08:22 AM
You're missing "for" on line 4.
Also, next time there's a problem, could you please tell us what it is, or the error you get if it isn't obvious? That'd be great, thanks. :)/>
758 posts
Location
Budapest, Hungary
Posted 02 April 2013 - 08:26 AM
And don't complain about "attempt to call nil" in the future. Lua is case-sensitive, and if you just copypaste the code above, you're gonna get plenty of that kind of error. (turtle.digdown, line 5)
1511 posts
Location
Pennsylvania
Posted 02 April 2013 - 08:27 AM
EDIT: And… ninja'd
turtle.digDown() not turtle.digdown()
Case sensitive young grasshopper
EDIT: Congrats on 1,000 Kingdaro ^_^/> Nice title too :P/>
758 posts
Location
Budapest, Hungary
Posted 02 April 2013 - 08:28 AM
EDIT: And… ninja'd
Now we're even :D/>
1511 posts
Location
Pennsylvania
Posted 02 April 2013 - 08:29 AM
EDIT: And… ninja'd
Now we're even :D/>
Pfft. Just you wait. I'll getcha you little buggart :P/>
6 posts
Posted 02 April 2013 - 08:41 AM
It still don't work.The turtle is just spinning around and do nothing ;/.
The program look like this :
turtle.down()
for i = 1,60 do
for j = 1,4 do
turtle.forward()
turtle.digDown()
turtle.down()
turtle.dig()
turtle.forward()
turtle.turnLeft()
end
end
758 posts
Location
Budapest, Hungary
Posted 02 April 2013 - 08:47 AM
refuel it maybe?
6 posts
Posted 02 April 2013 - 09:08 AM
I got a question how do i move a mining turtle go 1 block higher? and then like go down again?
1511 posts
Location
Pennsylvania
Posted 02 April 2013 - 09:09 AM
turtle.up()
turtle.down()
Seems a bit redundant?
6 posts
Posted 02 April 2013 - 09:28 AM
Hello guys i got another problem ;d
Here is the main program ;d
http://img571.images...30402212753.pngAnd here is the error i got
http://img835.images...30402212808.pngPlease help me again ;d :)/> and guys do you have any idea how i can make this better? :D/>
758 posts
Location
Budapest, Hungary
Posted 02 April 2013 - 09:33 AM
You should give FOR two parameters (where you want it to start looping and where you want it to end). EG:
for i = 1, 3 do
print(i)
end
If you're still confused:
http://lua-users.org/wiki/ForTutorial
6 posts
Posted 02 April 2013 - 09:48 AM
Eh guys i got another problem. I started the 3x3 program, it works fine until the turtle stopped after digging 1 block forward.
It look's like this :
http://imageshack.us...30402214829.pngHere's the main program :
http://imageshack.us...30402214907.pngAnd here's the error :
http://imageshack.us...30402214843.png
758 posts
Location
Budapest, Hungary
Posted 02 April 2013 - 09:50 AM
It's digUp, not digUP
1688 posts
Location
'MURICA
Posted 02 April 2013 - 09:51 AM
It should be "turtle.digUp", not "turtle.digUP", and "print = (i)" should be "print(i)".
6 posts
Posted 02 April 2013 - 09:53 AM
Ok thanks guys for helping me :)/>.
46 posts
Posted 02 April 2013 - 01:51 PM
Hey could someone help me? I'm getting "bios:338: [string "startup"]:16: 'do' expected.
this is my program… it doesn't go up to line 16…
while true do
if redstone.getInput("left") == true and redstone.getInput("right") == true then
redstone.setOutput("top", true)
sleep(5)
redstone.setOutput("top", false)
sleep(.1)
end
end
What did I do wrong? Thanks.
2151 posts
Location
Auckland, New Zealand
Posted 02 April 2013 - 01:54 PM
Hey could someone help me? I'm getting "bios:338: [string "startup"]:16: 'do' expected.
this is my program… it doesn't go up to line 16…
while true do
if redstone.getInput("left") == true and redstone.getInput("right") == true then
redstone.setOutput("top", true)
sleep(5)
redstone.setOutput("top", false)
sleep(.1)
end
end
What did I do wrong? Thanks.
Start your own thread with the question, don't hijack the thread.
1511 posts
Location
Pennsylvania
Posted 02 April 2013 - 01:55 PM
EDIT: Meh, ninja'd. As oeed said, start a new thread next time you have a question.
The bios is what boots CraftOS..
Now, your program which is obviously startup does go up to 16 or else we would not be seeing that error now would we?
Check to make sure you can't scroll down any further than the end of your code. If you can, then there must spaces which means there might be a character or something at line 16 that is causing an error.