function dig()
turtle.dig()
turtle.digDown()
turtle.forward()
turtle.dig()
turtle.digDown()
turtle.forward()
turtle.digUp()
turtle.back()
end
local Level = 0
repeat
if turtle.down() then
Level = Level+1
end
dig()
turtle.back()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
dig()
turtle.turnRight()
turtle.dig()
turtle.dig()
turtle.forward()
if Level == 10 then
turtle.select(14)
print("Placing torch...")
turtle.place()
Level = 0
end
if turtle.getItemCount(12) ~=0 then
turtle.digDown()
print("Placing Chest...")
turtle.select(15)
turtle.placeDown()
turtle.select(1,12)
turtle.dropDown
end
if turtle.getFueLLevel() <= 10 then
turtle.select(16)
turtle.refuel()
end
turtle.turnLeft()
until not turtle.down()
turtle.select(13)
turtle.placeDown()
Help with Stair Mining Program
Started by swg18, Aug 28 2013 09:04 PM
4 replies to this topic
#1
Posted 28 August 2013 - 09:04 PM
This is the stair casing code I have so far it works to stair down but when it reaches a lava or water pool, it just goes right through it. I was wondering whether there was a way to at least seal off the stair from the pool as I could then remove the lava if there was not a way for it to do so. In addition, the part that places torches and chest was originally made for a strip mine and I tried to incorporate it but neither appears to work correctly. The torch section appears to be completely skipped. The chest section freezes the turtle after putting one item in the chest. I would appreciate any help I am new to ComputerCraft though I have done some basic programing before.
#2
Posted 28 August 2013 - 09:07 PM
Split into new topic.
#3
Posted 29 August 2013 - 12:19 AM
Please indent and space out your code, it really helps with readability:
For the turtle going through liquids, you're going to want to give it a building block and have it place that on every wall along the way down.
That's going to involve a lot of turning left and right and placing blocks. If there's already a block, the place will just fail and it will move on.
Is the turtle saying it's placing torches? If it's printing out the torch line, make sure when it fires there is actually somewhere in front of the turtle for the torch to go.
Spoiler
For the turtle going through liquids, you're going to want to give it a building block and have it place that on every wall along the way down.
That's going to involve a lot of turning left and right and placing blocks. If there's already a block, the place will just fail and it will move on.
Is the turtle saying it's placing torches? If it's printing out the torch line, make sure when it fires there is actually somewhere in front of the turtle for the torch to go.
turtle.dropDownThat should be
turtle.dropDown()
turtle.select(1,12)turtle.select() only takes a single argument, the slot number to change to.
#4
Posted 29 August 2013 - 03:45 AM
if turtle.getItemCount(12) ~=0 then
turtle.digDown()
print("Placing Chest...")
turtle.select(15)
turtle.placeDown()
for slots =1,12 do --// we want to select slots 1 to 12
turtle.select(slots) --// select the slot our for loop is on
turtle.dropDown() --// Drop the items down
end
turtle.select(1) --// select the first slot again now.
end
That should work for selecting and dropping all items in slots 1 to 12 then reset the slot to start at 1 again.
#5
Posted 29 August 2013 - 06:18 PM
Quote
Is the turtle saying it's placing torches? If it's printing out the torch line, make sure when it fires there is actually somewhere in front of the turtle for the torch to go.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











