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

[lua] [turtles] turtle.place() quirk

Started by Zachaq, 07 March 2012 - 07:26 PM
Zachaq #1
Posted 07 March 2012 - 08:26 PM
I've been trying to place a torch with turtle.placeUp() from slot 4, and I've noticed that when there isn't a valid place for a torch, instead of returning false, it simply pulls a block, in my case from slot 1, and places that instead. My question is, is there a way to get around this that doesn't involve moving the turtle, or am I out of luck?
Liraal #2
Posted 07 March 2012 - 08:35 PM
well, simply do a check what block actually got placed and if it's not the correct one, dig it. (won't work on glass-lie things, tough)
Zachaq #3
Posted 07 March 2012 - 09:07 PM
The program doing this is designed to require no user interaction after starting it though. I just checked, and torches detect just like a normal block, so I don't think that is what I'm looking for, sorry.
Liraal #4
Posted 07 March 2012 - 09:18 PM
it is. You don't check the BLOCK, you check the INVENTORY. If a block got removed form the torches slot, it's all good. If not, break it. Simple as that.
Zachaq #5
Posted 07 March 2012 - 09:28 PM
Ah, I get it, that seems easy enough to do, thanks! :mellow:/>/>