This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
angielskidrwal's profile picture

Help

Started by angielskidrwal, 02 April 2013 - 06:20 AM
angielskidrwal #1
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
Kingdaro #2
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. :)/>
LBPHacker #3
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)
SuicidalSTDz #4
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/>
LBPHacker #5
Posted 02 April 2013 - 08:28 AM
EDIT: And… ninja'd
Now we're even :D/>
SuicidalSTDz #6
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/>
angielskidrwal #7
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
LBPHacker #8
Posted 02 April 2013 - 08:47 AM
refuel it maybe?
angielskidrwal #9
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?
SuicidalSTDz #10
Posted 02 April 2013 - 09:09 AM
turtle.up()
turtle.down()

Seems a bit redundant?
angielskidrwal #11
Posted 02 April 2013 - 09:28 AM
Hello guys i got another problem ;d

Here is the main program ;d

http://img571.images...30402212753.png

And here is the error i got

http://img835.images...30402212808.png

Please help me again ;d :)/> and guys do you have any idea how i can make this better? :D/>
LBPHacker #12
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
angielskidrwal #13
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.png

Here's the main program :

http://imageshack.us...30402214907.png

And here's the error :

http://imageshack.us...30402214843.png
LBPHacker #14
Posted 02 April 2013 - 09:50 AM
It's digUp, not digUP
Kingdaro #15
Posted 02 April 2013 - 09:51 AM
It should be "turtle.digUp", not "turtle.digUP", and "print = (i)" should be "print(i)".
angielskidrwal #16
Posted 02 April 2013 - 09:53 AM
Ok thanks guys for helping me :)/>.
Ninjawolf0007 #17
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.
oeed #18
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.
SuicidalSTDz #19
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.