Works for multiplayer
Why this was made:
Spoiler
This mod was made because a turtle would be perfect to use as a sorting system, but was always missing the ability to test an item's id without having something to compare it to. This mod fixes that by allowing any turtle to see the item id of any item in their inventory.I had searched around on this form earlier to see if another mod did this task, but was not able to find one. The closest I could find were ARP pipes by Xfel http://www.computerc...now-for-mc-142/ but this did not quite do the job I wanted, and it has not been updated to the latest version of minecraft.
Searching the forums I had found that others were wanting this simple tool also. http://www.computerc...amount-checker/
This link is from august, but it is asking for exactly what I have added to computer craft.
Note that the reason that the mod id is called someone9999.addons is because I am planning to add more addons to computer craft because I really enjoyed using the computer craft API.
This mod adds an analytical turtle which can be used to determine the block id or metadata of any block or item in it's inventory
Crafting Recipes
Spoiler
AnalyzerAnalyiticalTurtle
Images
Spoiler
Methods that you can call using this turtle upgrade.
"analyzer" is the variable that the peripheral is wrapped to in these examples.
Note: The latest update makes it so most methods that can be called now return a string describing an error if it fails. This is configurable in the config options to return false only. This may break pre 2.2 programs. Sorry for the inconvenience.
--Note that anytime slot is sent as an argument, it's valid values are integer values
--starting from 1 to the inventory size.
analyzer.getBlockId()
--Returns the block Id of the currently selected block in the turtle's inventory.
analyzer.getBlockIdAt(slot)
analyzer.getBlockIdAtUp(slot)
analyzer.getBlockIdAtDown(slot)
--Returns the block Id of the slot sent as an argument in the adjacent inventory above, infront, or below the turtle.
--This counts as a "check" for fuel usage.
analyzer.getBlockName()
--Returns a string containing the localized block name in the currently selected slot in the turtle's inventory.
--Items named with the anvil will NOT return their custom name, this is a known bug.
analyzer.getBlockNameAt(slot)
analyzer.getBlockNameAtUp(slot)
analyzer.getBlockNameAtDown(slot)
--Returns a string containing the localized block name in the send argument in the adjacent inventory above, infront, or below the turtle.
--This counts as a "check" for fuel usage.
--Items named with the anvil will NOT return their custom name, this is a known bug.
analyzer.getBlockMetadata()
--Returns the metadata of the currently selected block in the turtle's inventory, or the item damage if the selected block is an item.
analyzer.getBlockMetadataAt(slot)
analyzer.getBlockMetadataAtUp(slot)
analyzer.getBlockMetadataAtDown(slot)
--Returns the metadata of the selected slot in the adjacent inventory above, infront, or below the turtle.
--This counts as a "check" for fuel usage.
analyzer.getBlockCount()
--Returns the number of blocks or items in the currently selected slot in the turtles inventory.
analyzer.getBlockCountAt()
analyzer.getBlockCountAtUp()
analyzer.getBlockCountAtDown()
--Returns the number of blocks or items in the selected slot in the adjacent inventory above, infront, or below the turtle.
--This counts as a "check" for fuel usage.
analyzer.placeAt(slot)
analyzer.placeAtUp(slot)
analyzer.placeAtDown(slot)
--Places the selected item in the turtle's inventory into the selected slot in the container infront, above, or below the turtle.
--This counts as an "action" for fuel usage.
analyzer.takeAt(slot)
analyzer.takeAtUp(slot)
analyzer.takeAtDown(slot)
--Takes the selected item in the container infront, above, or below the turtle into the selected slot in the turtle
--This counts as an "action" for fuel usage.
analyzer.getCheckUsesLeft()
--Returns the number of checks the turtle can do until more fuel is required.
analyzer.getActionUsesLeft()
--Returns the number of actions the turtle can do until more fuel is required.
Example Code:
Spoiler
local analyzer = peripheral.wrap("right")
turtle.select(1)
turtle.dig()
print("I just dug " .. analyzer.getBlockName())
Download:
2.3 (MC 1.4.6) (CC 1.4.8) Universal
2.1 (MC 1.4.4) (CC 1.4.7) Universal
2.0 (MC 1.4.2) (CC 1.4.6) Universal
1.0 (MC 1.4.2) (CC 1.4.6) Universal
Change Log:
Spoiler
2.2- Ported to Minecraft 1.4.6
- Fixes metadata not carrying over on takeAt and placeAt calls.
- More descriptive errors are now given when the analyzer fails.
- Fuel is now required for the analyzer to function. 1 fuel is taken after every 5 "actions" (takeAt, placeAt), and after every 10 "checks" (getBlockIdAt, getBlockCountAt, etc…). Checks that only affect the turtle's inventory are not affected by these fuel requirements.
- Config option to adjust fuel requirements.
- Methods to figure out how many checks or actions are left until more fuel is used.
- Ported to Minecraft 1.4.4
- Added ability to configure which methods are allowed to be called in config.
- Added the ability to find out information about blocks in adjacent inventories to turtles. (Analyzer Upgrade).
- Added the ability to place and take items out of specific slots in adjacent inventories to turtles. (Analyzer Upgrade).
- Changed getBlockCount to return 0 instead of -1 if there is no block at the selected slot. (Analyzer Upgrade).
- First Release