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

Turtle torch placement issues

Started by nirvana12360, 28 May 2015 - 07:39 PM
nirvana12360 #1
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/>
Lupus590 #2
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-OTo

as 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
Bomb Bloke #3
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.
nirvana12360 #4
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
Lupus590 #5
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