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

Programn for sensing lava on the ground by the computer

Started by clickeddaisy, 14 March 2015 - 05:36 PM
clickeddaisy #1
Posted 14 March 2015 - 06:36 PM
Hello I'm sure this program is super easy to make but im a newcommer to computercraft and im trying to do a program that senses lava on the ground by the right side of the computer and sends a redstone signal to the left side of the computer, im making this program for botania thermalilys, heres a screenshot for more accurate info http://tinypic.com/view.php?pic=25auf6h&s=8#.VQR_NuFMfSY

PS. I have tried to search for tutorials on how to make such a program but had no luck finding it.
HPWebcamAble #2
Posted 14 March 2015 - 06:57 PM
Computers (The block) cannot sense the environment around them (With the exception of Command Computers, but those are Creative only)

A TURTLE however, can. Basically, its a computer that can move (With fuel) and interact with its environment
(Hopefully you can find the recipe in NEI)

Here's the Turtle API:
http://computercraft.info/wiki/Turtle_%28API%29

And the Redstone API:
http://computercraft.info/wiki/Redstone_%28API%29

Try to use these to write a program. If you need any help, feel free to ask :)/>
SpencerBeige #3
Posted 14 March 2015 - 09:00 PM
turtle.inspect() return block data.
Wojbie #4
Posted 14 March 2015 - 10:25 PM
You are looking for block named "minecraft:flowing_lava". Metadata value of 0 for source block.
Edited on 14 March 2015 - 09:25 PM
Bomb Bloke #5
Posted 14 March 2015 - 10:30 PM
More specifically, source blocks use the name minecraft:lava, while non-source blocks use minecraft:flowing_lava.
Wojbie #6
Posted 14 March 2015 - 10:45 PM
More specifically, source blocks use the name minecraft:lava, while non-source blocks use minecraft:flowing_lava.
Could you test that? I am sure i was detecting lava source blocks in my ssp world using minecraft:flowing_lava and metadata 0 just 2 days ago for my extended turtle api. Sadly i am not able to test that right now but i believe that difference you speak of was for water not lava.
Bomb Bloke #7
Posted 14 March 2015 - 11:08 PM
On testing, I see we're both wrong: source blocks use metadata 0, flowing blocks use metadata 2. "Updating" blocks (flows "in motion") use minecraft:flowing_lava, whereas "settled" blocks (flows which've gone as far as they can) use minecraft:lava.

So to find source blocks, you'd need to check for both minecraft:lava and minecraft:flowing_lava with metadata of 0.
Wojbie #8
Posted 14 March 2015 - 11:30 PM
That explains my confusion - turtle movement was causing lava updates for me. Thank you for testing it for me and the OP.