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

Read Metadata from block next to computer or turtle

Started by ag0x, 11 February 2014 - 02:01 AM
ag0x #1
Posted 11 February 2014 - 03:01 AM
Alright, so i searched the net for any solution regarding this, but cannot find any so here it goes..

What im trying to do is to put down a jar of essentia and a computer/turtle behind it.
The computer needs to detect when its below completly full. When looking at the item, it is storing this
information in the NBT data.

So to the core question:

Is there any way to read the meta data (not set it) from an adjacent block or item with code?
tesla1889 #2
Posted 11 February 2014 - 10:23 AM
you're going to have to do this in Java (i.e. use a mod or write your own).
there currently is no way to read NBT data from computercraft.
CometWolf #3
Posted 11 February 2014 - 12:18 PM
Not a thaumcraft user myself, but openPeripherals might be able to read this info.
FileStriker #4
Posted 11 February 2014 - 12:22 PM
I don't know, if it works but:

turtle.select(1)
i = turtle.compare() -- check if the item have the same id then the block (jar)
while i == false do -- repeat it
    i = turtle.compare()
end
-- your program

I hope, I could help you
Lyqyd #5
Posted 11 February 2014 - 12:31 PM
Nope, that would just compare the same block over and over again.

It's literally the same as this:


while not turtle.compare() do end