Jump to content




3X3 Tunnel Digger (Down)


  • You cannot reply to this topic
6 replies to this topic

#1 Marv-inside

  • New Members
  • 6 posts

Posted 27 February 2012 - 10:31 PM

This is my code for an 3+3 Tunnel digger!
(more later, currently its "Beta"

you have to rename the file, just delete the .txt (You aren't permitted to upload this kind of file)Attached File  tunnel.txt   1.42K   97 downloads


print("Insert 16 Cobble in slot 1!")
print("Press Enter if ready")
slot1 = turtle.getItemCount(1)
if slot1 > 15 then
io.read()
turtle.forward()
turtle.forward()
turtle.digDown()    --OOTOO
turtle.select(1)    --O   O
turtle.placeDown()  --O   O
	 --O   O
	 --OOOOO
turtle.turnRight()
turtle.forward()
turtle.digDown()    --OOXTO
turtle.placeDown() --O   O
	 --O   O
	 --O   O
	 --OOOOO
turtle.forward()
turtle.digDown()    --OOXXT
turtle.placeDown() --O   O
	 --O   O
	 --O   O
x1 = 0    --OOOOO
while x1 < 4 do
turtle.turnRight()
turtle.forward()
turtle.digDown()
turtle.placeDown()
x2 = 1
while x2 < 4 do
turtle.forward()
turtle.digDown()    --OOXXX
turtle.placeDown()  --O   T
x2 = (x2+1)   --O   O
print(x2)    --O   O
end	 --OOOOO
x1 = (x1+1)
print(x1)
end
turtle.back()
turtle.turnRight()
turtle.forward()
print("Is this Position ok?")
i = io.read()
if i == yes or y or 1 or ja or yay then
while true do -- digging down
  turtle.digDown()
  turtle.forward()
  turtle.digDown()
  turtle.forward()
  turtle.digDown()
 
  turtle.turnRight()
  turtle.forward()
  turtle.turnRight()

  turtle.digDown()
  turtle.forward()
  turtle.digDown()
  turtle.forward()
  turtle.digDown()

  turtle.turnLeft()
  turtle.forward()
  turtle.turnLeft()

  turtle.digDown()
  turtle.forward()
  turtle.digDown()
  turtle.forward()
  turtle.digDown()

  turtle.turnRight()
  turtle.turnRight()
  turtle.down()
end
end
end


#2 ThePH

  • Members
  • 31 posts

Posted 27 February 2012 - 10:53 PM

you should use more loops and functions.

#3 Marv-inside

  • New Members
  • 6 posts

Posted 28 February 2012 - 12:47 AM

@ThePH yes, this is one of my first programm in lua, but currently i'm working an an woodcutter(http://www.computerc...320-lumberjack/)

#4 Jaan

  • New Members
  • 10 posts

Posted 28 February 2012 - 07:41 AM

Noobs! You just should use excavate on the turtle and insert the radius, it does the same when you write in the turtle: excavate 3

#5 Marv-inside

  • New Members
  • 6 posts

Posted 28 February 2012 - 03:47 PM

@Jaan thx, was my first programm...

BUT this programm will show you the position and wait for you, untill it'll start! (not a big feature, but...)

#6 Chub1337

  • New Members
  • 36 posts

Posted 28 February 2012 - 03:51 PM

View PostMarv-inside, on 28 February 2012 - 03:47 PM, said:

@Jaan thx, was my first programm...

BUT this programm will show you the position and wait for you, untill it'll start! (not a big feature, but...)

Haha, don't listen to Jaan, ofcourse it could use some tweeking here and there, but for a first program, I'm impressed! Good job! :D/>

-Chub1337

#7 Marv-inside

  • New Members
  • 6 posts

Posted 28 February 2012 - 05:33 PM

@Chub1337 thx, i'm gona to check if there is only 1 slot left, and then go up to drop all items.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users