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

Problem with turtle.compare()

Started by Sebra, 01 April 2012 - 10:50 AM
Sebra #1
Posted 01 April 2012 - 12:50 PM
I want to get some Peat from Forestry. I need to prepare Bog Earth, place it near water, wait, dig up when ready.
Forestry Bog Peat can do it itself, but this is kind of magic, so I try to use my turtle for this task.
I gave my Turtle several items of Bog Earth, teach it place, wait, compare, dig when changed. It seems program works, but Turtle dig up the same item, as placed. Pit block gives Pit item when dig up, so I cannot compare with it. I think Bog Earth become Pit block in several steps, so first change is not Pit yet. I did not tried magical ways to get Pit block.
So turtle can sense change, but cannot sense needed change.
Can anyone help me with this problem?
PixelToast #2
Posted 22 April 2012 - 01:23 AM
im having this problem to
after some testing i figured out turtle.compare() will always return true
ill try to figure out what is causing it
Sebra #3
Posted 23 April 2012 - 04:16 PM
Oh, almost two hundred views, one answer and miss. :)/>/>
You have other problem. For me compare works good except I have no good example to compare. We need some way to teach turtle what is what instead of always have an example.
Leo Verto #4
Posted 23 April 2012 - 08:08 PM
I think bog peat and pit use the same block ID but have different sub ids (eg 245:34), turtle compare can only find out the block ID.
Sebra #5
Posted 23 April 2012 - 10:16 PM
I think quite reverse: Turtle compare check both, but bog -> peat change in several steps so turtle see difference too early. I can compare with bog, but have no peat block.
There are many unavailable blocks. It would be so better to get some signature for comparing instead of having example block.