Jump to content




Detecting A Material


6 replies to this topic

#1 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 28 August 2013 - 07:31 PM

I've browsed trough the "Idea Exchange" topic and read this

Quote

It's possible. There are a variety of tests which can be performed to determine the type of material you have.

So, what are this tests to determine the material?

#2 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 28 August 2013 - 08:23 PM

I'll add to this list if I think of any more tests.

Gravel/Sand:
Go up two blocks, place the blocks below the turtle, and then see if they're still there.

Redstone/Lapis:
If upon digging four items are added to the turtles inventory, it's probably redstone or lapis ore.

Liquids:
A liquid source block can be determined by use of two empty buckets. Use turtle.placeDown() and then compare the buckets. If the compare is successful then the block below is not a liquid source block.
In order to detect a non-source block you can check if turtle.dig returns true twice.

Frequency test:
Blocks such as cobblestone, you can easily ascertain its type using a frequency test. If you encounter more than fifteen of the same block repetitively, you can almost be certain that it's cobblestone based on the MC distribution rules.

Does it smelt?:
If it does, then it must be gold, iron, cobblestone, or sand. And you can rule out both sand and cobblestone using above methods.

Crafting:
Craft something using the items with typical/cheap recipes. If they work then you can be certain of the item's type.

Map rules:
Use the MC distribution rules to your advantage. A large majority of land area will be cobblestone and dirt. You can keep those two blocks in your inventory for easy comparison. Use the above methods to separate some of the other frequent ores. Less common things such as rails from mineshafts stand out because you will encounter them so rarely.

#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,462 posts

Posted 28 August 2013 - 08:40 PM

The challenge started you off at the base of a tree. From this tree, you know what logs are, what planks are, what sticks are, and what dirt is (the block below the log you start off in front of). From that starting point, you can expand your knowledge with a few facts about the blocks in your environment:

Stone: Becomes a different block when dug. The new block can be placed. The new block is smeltable.
Gravel: Falls, occasionally drops something different.
Sand: Falls, smeltable.
Grass: Becomes dirt when dug.
Logs of unknown trees: Craft by themselves into four items, which two of craft into sticks (which are known).
Coal ore: Drops a block-incomparable item, which can smelt items, and is fuel.
Iron ore: Smelts, isn't stone/cobblestone. Smelting product creates turtles.
Gold ore: Smelts, smelting product creates monitors.
Redstone ore: Drops multiple items, crafting with a stick is successful.
Lapis ore: Drops multiple items, crafting with a stick is unsuccessful.
Diamond ore: Drops single block-incomparable item, isn't fuel. Crafts into a pickaxe.
Reeds: Create paper when crafted.
Lava: Liquid checks, and is fuel.
Water: Liquid checks, and isn't fuel.

Anything else either doesn't matter, or... doesn't matter, for the purposes of the challenge.

#4 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 29 August 2013 - 04:09 AM

Where did the OP mention the turtle duplication challenge thing?
Another test to try is to emit a redstone signal, then read it back (using rs.getInput) to see if the block conducted redstone. I haven't tried that in-game, but if it works it will tell you whether the block is solid.

#5 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 29 August 2013 - 04:22 AM

To add on what Lyqyd and Bubba stated...

Since CC 1.5 we have been able to supply a number of 0 to turtle.craft and turtle.refuel... This allows us to check whether an item is a fuel source, or if the current grid is craftable, without consuming or crafting the item. So when attempting to discover fuel sources, or things based off recipes, remember to use
turtle.refuel(0)
and
turtle.craft(0)


#6 CCJJSax

  • Members
  • 262 posts

Posted 30 August 2013 - 09:00 PM

also redstone is placeable, lapis is not

#7 floppyjack

  • Members
  • 18 posts

Posted 01 September 2013 - 06:09 AM

You can test if something is smeltable by putting it in the furnace and taking it out again before it has the chance to get consumed. Then you just check if the fuel is still there. (use cheap fuel)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users