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

TC Smeltery problem.

Started by Enderslayer14, 28 August 2014 - 10:33 AM
Enderslayer14 #1
Posted 28 August 2014 - 12:33 PM
I'm trying to make an automated emerald farm. But the common design problem of needing atleast a bit of metal on top of the emerald is breaking my head. Can computers detect liquids in a smeltery? I drain out the emerald with an fluiduct. If the computer could detect that theres only ( by example 500mb in it). Would it then be possible to give a redstone signal that goes trough a no-gate so the fluiduct stops draining emeralds? And when theres more than it 500mb in it it stops the redstone signal again so it starts making emeralds again? Thanks for your attention :)/>
Bomb Bloke #2
Posted 28 August 2014 - 04:01 PM
If the computer can detect what's going on in the smeltery, then yes, you could generate corresponding redstone signals.

Start out by attempting to use the OpenPeripaherals documentation script on your smeltery to see if it can be used as a peripheral. Results may vary according to the mod versions you have installed.

You may also find this peripheral tutorial handy.
hilburn #3
Posted 28 August 2014 - 06:01 PM
You have to to wrap a smeltery drain to access the contents of the tank.

I actually made a program you might like to use, it's designed to trade for pages but you can just cut that bit out if you want emeralds. the setup is reasonably well explained though

http://www.computercraft.info/forums2/index.php?/topic/19632-mystcraft-page-trader-openperipherals/
Enderslayer14 #4
Posted 29 August 2014 - 01:24 PM
Thanks for the answers i will try a bit out

You have to to wrap a smeltery drain to access the contents of the tank.

I actually made a program you might like to use, it's designed to trade for pages but you can just cut that bit out if you want emeralds. the setup is reasonably well explained though

http://www.computerc...penperipherals/

Second computer sits in front of drain (allows interface with smeltery liquid contents) - programmed to output redstone high left when smeltery contains liquid emerald.

Thats the code im looking for and cant get to work.
hilburn #5
Posted 30 August 2014 - 01:11 AM
Unfortunately since I wrote that code I've had to scrub my laptop so lost a lot of scripts that I foolishly didn't backup. That said it was fairly simple so here is a quick guess at what it looked like:


tank=peripheral.wrap("back")
while true do
   output=false
   for _,liquid in pairs(tank.getLiquid()) do --#check this is the function, there is one which will return an array of liquid data for the smeltery
        if liquid.name=="liquid.emerald" then --#not sure if this is the field or that's the name of liquid emerald, again you'd need to test that
             output=true
        end
   end
   rs.setOutput("right",output)
   sleep(2)
end