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

Best way of detecting lava

Started by KingofGamesYami, 22 July 2014 - 05:11 PM
KingofGamesYami #1
Posted 22 July 2014 - 07:11 PM
I've got a turtle branch mining script I wrote to be extremely fuel efficient (as in, it will detect when it has just enough fuel to make it back) and was wondering if there would be any way to detect if there is a lava source block next to my turtle, which it could then use to increase time spent mining. Even if I just detect that there is a liquid available I can easily discern if it can be used for fuel by trying to refuel with it. I know turtle.detect() will return false, but other than that how can I know it isn't air?
hilburn #2
Posted 22 July 2014 - 08:03 PM
AFAIK the only way to detect liquids is something along the lines of:


turtle.select(bucketslot)
if turtle.place() then --#if picked up liquid
	 if turtle.refuel() then
		  --#its lava
	 else
		  turtle.place() --#empty the bucket
	 end
end
KingofGamesYami #3
Posted 22 July 2014 - 10:05 PM
Thanks.
bigbrainiac10 #4
Posted 22 July 2014 - 10:27 PM
If you want it to refuel using lava, if you have the EnderStorage mod you could use a endertank and refuel using that?

Other than that, hilburn's way is the only real way to do it using the environment.
KingofGamesYami #5
Posted 22 July 2014 - 11:11 PM
No, I mean I want my turtle to refuel when it encounters lava. Here's a link to my script (which i will be releasing shortly): http://pastebin.com/ZpKSLTgW