Additional fake peripherals - umnikos/hopper.lua GitHub Wiki

As an abstraction over cc inventory methods, hopper.lua can afford to add a few more useful peripheral names to the roster, or to simplify the way existing peripherals work

1. self peripheral

If hopper.lua is ran on a turtle that is connected to a wired modem, the self peripheral name will be present and will represent the turtle's own inventory (16 slots). It can then transfer items to and from any chests connected to that wired modem

Example: hopper *chest* self *iron_ingot* -to_slot 1 -to_slot 3 -to_slot 6 -to_limit 16 -per_slot - Transfer iron ingots from a connected chest to the turtle's inventory in the shape of a bucket, in preparation for crafting buckets with turtle.craft()

2. Bound introspection module in a manipulator

Supplying the peripheral name of a manipulator with a bound introspection module in it will act as the inventory of the player the module is bound to (36 slots) or their ender chest if -ender is passed as a flag (27 slots). If the player is offline it will instead represent a chest with 0 slots, and thus no transfers to and from it will be attempted.

Example: hopper *chest* *manipulator* *steak* -to_slot 9 - Keep the last slot in your hotbar constantly full of steak to eat

3. Disk drive peripheral

Any items hoppered into a disk drive will immediately be ejected out of it, essentially making it a more powerful dropper.

Example: hopper *chest* *drive* *cobble* - send cobblestone and its relatives to be dropped into lava

4. void

The void is an infinite hole that consumes all that you give it and yet remains entirely empty. Or well, it would be if it existed. This is an imaginary peripheral that pretends to throw away all of your items, and instead just counts how many it would've thrown away if it did, obeying things like -from_limit and -transfer_limit. This count can then be used if you're calling hopper.lua using the library api.

Example: If when you call hopper("self void") it returns 18, you can conclude from it that there are a total of 18 items in the turtle's inventory