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

Setting up a Gate Reading Mining turtle to read a BC Tank or Railcraft Iron Tank

Started by Saberwolfcdw, 15 September 2013 - 04:08 PM
Saberwolfcdw #1
Posted 15 September 2013 - 06:08 PM
Title: Setting up a Gate Reading Mining turtle to read a BC Tank or Railcraft Iron Tank level and place a BC Pipe when tank is full/empty.

Wanting to do it in a loop so it'll place the pipe when the tank not full and remove when it is. Very New to computer craft and I have built the turtle but I stink bad at programming. Just a little direction would be nice. Need to know how to wrap the gate, set the gate to read the tank and so on.

Thanks.
Lyqyd #2
Posted 15 September 2013 - 08:12 PM
Split into new topic.
plazter #3
Posted 16 September 2013 - 07:52 PM
Do you have Any kind of code your self yet? :)/>
BigTwisty #4
Posted 16 September 2013 - 08:20 PM
Wrap the gate with

reader = peripheral.wrap("right")

It might be left, you'll have to look at the turtle to see what side the gate reader is on.

The commands for the wrapped gate reader are like this:

state = reader.get()
if state["val"] then ...

Replace val with the gate code you want to check. You can get the gate codes by placing a gate on a pipe next to what you are reading and clicking through the available gate codes.

I'll leave the looping and the rest to you, as that will be a good learning excercise for you.