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

Questions regarding item identification in turtle programs

Started by srentiln, 11 October 2012 - 03:27 PM
srentiln #1
Posted 11 October 2012 - 05:27 PM
Hello!

Firstly, I have to say that this is for use on a tekkit server, so it is an older version of computercraft. Would have asked at the technic forum, but it just seemed better to ask someplace where the specific mod was the main focus.

I'm trying to set up a fairly baic sorting system for storing the most basic materials (the ones you can't craft from other blocks). I came across two issues with this that I can't sem to find direct information on:

1) Can the turtle identify what the item in it's inventory is? For example, comparing slot 1 to item/id "x". Based off most of the programs I'm seeing, I think this is a no, but it doesn't hurt to ask to confirm.

2) Does the turtle recognize that different log types are all logs, or will it not recognize them as the same group? For example, I use an oak log as the comparison. Will it recognize that a birch log is the same item type, or will it just say it's not the same?
Cranium #2
Posted 11 October 2012 - 05:43 PM
  1. No. Turtles cannot give you the item ID.
  2. Yes. The turtle.compare() functions detect if something in front/above/below is the same as the currently selected slot. You can compare separate types of logs, and it will say that each are different.
srentiln #3
Posted 11 October 2012 - 05:55 PM
Just to clarify, I cannot use one log type as a trigger for all log types, correct?

A bit of a nuisance, but workable still…just means I will have to re-design the storage layout.

thanks for the information :P/>/>
Cranium #4
Posted 11 October 2012 - 06:49 PM
Since each log has a different item ID, it will return different for each compare. The java code part of this does compare item IDs, but you cannot get them.