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

Turtle thermometers?

Started by Lettuce, 31 August 2012 - 10:32 AM
Lettuce #1
Posted 31 August 2012 - 12:32 PM
A user of my mining program suggested I make a function to protect against lava. His/her name was RoseRawr. I was wondering if a turtle thermometer could be made, that would enable turtles to detect fluids, like water is "cold" and lava is "hot." It could be built in, or a peripheral. Otherwise, I don't know how to safeguard that.
DanCarl97 #2
Posted 31 August 2012 - 01:00 PM
A peripheral wouldn't help much, but perhaps a thermometer you could add by crafting is a good idea, similar to making a turtle a mining turtle.
Lettuce #3
Posted 31 August 2012 - 08:02 PM
Isn't that what a peripheral is? That IS what I meant. An addable thermometer, or a built-in one.
matejdro #4
Posted 02 September 2012 - 09:35 PM
You don't need to safeguard it. Turtle can go through lava and water without problems.
GopherAtl #5
Posted 03 September 2012 - 02:51 PM
I think they meant to protect people, detecting lava so they can take actions to make their tunnels safe for players.
dadmob18 #6
Posted 04 October 2012 - 04:41 AM
I would like to second the motion for detecting lava (and water), and then also being able to "mine" it by using a bucket from inventory (also suggested elsewhere). But I don't think we need a thermometer– it would be nice if it was as simple as returning a special value from turtle.detect(), like "lava".
PonyKuu #7
Posted 04 October 2012 - 05:46 AM
Actually, you can suck the lava/water source with an empty bucket, using the turtle.place() function. I used that in my testing program, which crafts bog earth :(/>/>'

But there are those annoying lava flow blocks which don't dissapear…
matejdro #8
Posted 04 October 2012 - 07:32 AM
Yes, but you don't know if you sucked water or lava.
Doyle3694 #9
Posted 04 October 2012 - 08:05 AM
do like:
if turtle.detectDown()==false then
turtle.select(16)
turtle.placeDown()
end
PonyKuu #10
Posted 04 October 2012 - 09:44 AM
Yes, but you don't know if you sucked water or lava.
Well, yo can put sample buckets in the inventory and use compareTo() to tell whether it is water or lava ^_~
Sebra #11
Posted 04 October 2012 - 04:24 PM
Do you think lava bucket would be equal lava source?
PonyKuu #12
Posted 04 October 2012 - 07:29 PM
No. Suck lava with a bucket, and then compare this bucket to another one.
turtle.compareTo(slot) compares two slots in the turtle inventory.
Lettuce #13
Posted 04 October 2012 - 10:28 PM
Honestly, thermometers was just a way I thought of to implement it. I really don't care about that regard, but for the safety of the people using my programs, I want a way to protect them, which can only be done by detecting a fluid.

That way, I can destroy lava flows, not only the source, and I wouldn't have to find the source, simply block it. This would make my programs perfect. I'm just asking for some tweaks to detect block, so I can make flawless tunnels, deep underground, where they are common.

I didn't anticipate a debate about buckets, and for flowing fluid entities, they don't help.
dadmob18 #14
Posted 07 October 2012 - 05:23 AM
Well, Lettuce, thanks to PonyKuu we have a partial answer, but it is slow and does not detect flowing lava, only source lava. If detect() is false, and then you place() a bucket, then suck it back up (right PonyKuu?), then compare it with a bucket of lava you already have in inventory and it matches, then there was source lava there!

But you have a point, Lettuce, that is not enough to protect your users from lava. A direct detector of flowing lava and water would be really useful for many things.

I don't think compare will match a lava block to a bucket of lava in inventory.
PonyKuu #15
Posted 07 October 2012 - 06:40 AM
No, just place(). Wtih empty bucket this function sucks a source block to the bucket.
But he is right - it won't help really, since buckets don't stack and it doesnt' work with flowing lava.
For now, turtles are completely blind, if we are talking about fluids.