Jump to content




[first] basic turtle door


6 replies to this topic

#1 Heroj04

  • Members
  • 32 posts

Posted 11 September 2012 - 10:46 PM

This is my first practical program.
This program simply, when you press a button(or any redstone update) will make a hole in a wall, wait five seconds then build it back.

Note: the wall can only be made of one type of block ATM.

Anyway here you go
http://pastebin.com/hMRnu47r

#2 NIN3

  • New Members
  • 57 posts
  • LocationEverywhere.

Posted 11 September 2012 - 10:53 PM

Um, Did you atually try this code? I see it sets 3 functions, but never calls any of them......

Just saying, dont listen to my rambling.

#3 Heroj04

  • Members
  • 32 posts

Posted 11 September 2012 - 11:01 PM

View PostNIN3, on 11 September 2012 - 10:53 PM, said:

Um, Did you atually try this code? I see it sets 3 functions, but never calls any of them......

Just saying, dont listen to my rambling.

Damn it I made it on my turtle just rewrote it then on pastebin and forgot that fixing now

Fixed

#4 Jahmaican

  • Members
  • 26 posts
  • LocationPoland

Posted 11 September 2012 - 11:06 PM

Yes, you propably missed "waiting()" at the very bottom.

The code itself could be better, but just to be able to use this with a wall made of different materials you could do this:
function closeDoor()

slot=1
turtle.select(slot)

turtle.forward()

while turtle.getItemCount(slot)==0 do
slot=slot+1
turtle.select(slot)
end

turtle.placeUp()
turtle.forward()

while turtle.getItemCount(slot)==0 do
slot=slot+1
turtle.select(slot)
end

turtle.placeUp()
turtle.back()

while turtle.getItemCount(slot)==0 do
slot=slot+1
turtle.select(slot)
end

turtle.place()
turtle.back()

while turtle.getItemCount(slot)==0 do
slot=slot+1
turtle.select(slot)
end

turtle.place()
waiting()
end

Looks very bad but should work, haven't tested it though. Of course it might crash if there's some items that you can't place in turtle's inventory, or if some of the blocks get lost somehow.

#5 Heroj04

  • Members
  • 32 posts

Posted 11 September 2012 - 11:11 PM

View PostJahmaican, on 11 September 2012 - 11:06 PM, said:

Yes, you propably missed "waiting()" at the very bottom.

The code itself could be better, but just to be able to use this with a wall made of different materials you could do this:
function closeDoor()

slot=1
turtle.select(slot)

turtle.forward()

while turtle.getItemCount(slot)==0 do
slot=slot+1
turtle.select(slot)
end

turtle.placeUp()
turtle.forward()

while turtle.getItemCount(slot)==0 do
slot=slot+1
turtle.select(slot)
end

turtle.placeUp()
turtle.back()

while turtle.getItemCount(slot)==0 do
slot=slot+1
turtle.select(slot)
end

turtle.place()
turtle.back()

while turtle.getItemCount(slot)==0 do
slot=slot+1
turtle.select(slot)
end

turtle.place()
waiting()
end

Looks very bad but should work, haven't tested it though. Of course it might crash if there's some items that you can't place in turtle's inventory, or if some of the blocks get lost somehow.
Unfortunately I can't check because I'm not at my pc I'm on an iPad but thanks

#6 xXLeNinjaXx

  • Members
  • 33 posts

Posted 12 January 2014 - 02:54 PM

Heres an Install i was board xD

pastebin get uXcGtDuJ Install

Edited by xXLeNinjaXx, 12 January 2014 - 02:54 PM.


#7 Buho

  • Members
  • 110 posts

Posted 13 January 2014 - 12:13 PM

Heroj: That's a pretty cool door idea!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users