I have the problem, that my turtle stops running my programm, when the fuel is over!
(I mean, I said in lua "turtle.refuel()" because that was the only way to get this thing to move...
And if this peace of coal is over, the turtle stops moving!)
I want that the turtle automatically use the coal which is still in slot 1 (the selected one!)
I never had this problem if I run for example the "tunnel" programm which was already there!
If I place a new turtle, it won't move (with "turtle.forward()" manuelly or in my programms!) untill I write "turtle.refuel()"!
BUT I don't need to do that if I use the "tunnel" programm! It will just use up the coal in the slot without any trouble!
So my question is:
Do you need a refuel command in the programm? I didn't found that in any tutorials (I just found outdated tutorials for everything!
Even from the wiki's tutorials nothing works in the new Version...) I looked in the tunnel code but didn't unterstand anything! ;D
I'm new in the lua - or programming at all! (Started watching videos about ComputerCraft programming yesterday)
(Just "quickly" wrote a programm for a branchmine (editable) and then the programm for a room digger (-this is where I have the trouble)
I'll post the code here - maybe it's another mistake from me...
(NOTE: All red text is NOT in the turtle programm! It's just a note for you!)
print("Wie lange?: ") --this is german for "How long?: " x = io.read() x = x-1 print("Wie breit?: ") --this is german for "How wide?: " print("Achtung!Nur gerade Zahlen!") --this is german for " Watch out! Just aliquot Numbers!" (because y = y/2) y = io.read() y = y+0 y = y/2 for a=1,y do for b=1,x do turtle.dig() turtle.digUp() turtle.forward() end turtle.digUp() turtle.turnRight() turtle.dig() turtle.forward() turtle.turnRight() for c=1,x do turtle.dig() turtle.digUp() turtle.forward() end turtle.digUp() turtle.turnLeft() turtle.dig() turtle.forward() turtle.turnLeft() end
(Don't know why the forum do not showing the blanks at the beginning of the line...
I know, with funktions you can make it less text! But I was happy to made it working! ;D )
Please help me,
this turtle would realy help me out if the coal problem is solved!
~harlekintiger
PS: Sorry, but how can you make this cool and useful background for code here in a forum?
Edited by Lyqyd, 11 December 2012 - 04:56 PM.
added code tags