2 posts
Posted 28 May 2015 - 09:39 PM
I have been trying to create a program for a turtle to mine a 3x2 hallway in order for me to be able to strip mine off of it. I have succeeded up until the point where I attempted to make the turtle periodically place torches. I am new to ComputerCraft and lua so any help would be appreciated. Here are my attempts made so far. http://pastebin.com/8TTJmbdV i tried to define variables and then watched somebody do that maths stuff on line 83-86. I am determined not to steal somebody elses program. Ty :D/>
2427 posts
Location
UK
Posted 28 May 2015 - 10:34 PM
While not to do with torches, this video about placing turtle block placement may be useful.
https://www.youtube....h?v=N1PT3GD-OToas for timing to place torches, have some kind of counter when you move then when the counter is above some number: place a torch and reset the number
Edited on 28 May 2015 - 08:35 PM
7083 posts
Location
Tasmania (AU)
Posted 28 May 2015 - 11:50 PM
Seems you have a two-block high tunnel, with the turtle floating along the bottom. Assuming the turtle can't place torches above itself, you could instead have the turtle float along the top of the tunnel, placing the torches beneath itself onto the floor. This would remove the need to have it turn around.
2 posts
Posted 29 May 2015 - 12:12 AM
thank you for you reply. could you give an example of this counter that you mentioned?
Thank you will try this tommorow
2427 posts
Location
UK
Posted 29 May 2015 - 12:04 PM
local count = 0
local torchSpacing = 12
while continueToDig do
digNextTunnelSection()
turtle.forward()
count = count +1
if count == torchSpacing then
placeTorch()
count = 0
end
end