| Method | Description |
|---|---|
getAddress() | Gets the Redstone Requester's address |
getConfiguration() | Gets the Redstone Requester's configuration |
getRequest() | Gets the Redstone Requester's request data |
request() | Sends a package request to the network |
setAddress(address) | Sets the Redstone Requester's address |
setConfiguration(configuration) | Sets the Redstone Requester's configuration |
setCratingRequest([itemName], ...) | Sets the Redstone Requester's configuration as a crafting package |
setRequest([item], ...) | Sets the Redstone Requester's configuration |
getAddress()
Gets the Redstone Requester's address.
Returns
stringWith the address currently in use.
getConfiguration()
Gets the Redstone Requester's configuration.
Returns
stringWith either"allow_partial"or"strict"as the configuration.
getRequest()
Gets the Redstone Requester's request data.
Returns
tableTable ofitemDetails.
request()
Requests for a package in the network using the Redstone Requester's configuration, request data and address.
setAddress(address)
Sets the Redstone Requester's address to the given variable.
If the address arg is nil, it'll unset the address.
Parameters
- address:
stringAddresses requested packages to address.
setConfiguration(configuration)
Sets the Redstone Requester's configuration to either "strict" or "allow_partial", represented by the bottoms on the bottom left of it's gui.
"strict"will only let the request through if all the matching items are available."allow_partial"will run the request no matter the avialability.
Parameters
- address:
stringThe desired configuration, either"strict"or"allow_partial".
setCraftingRequest([itemName], ...)
Sets the packagers configuration with up to 9 slots for autocrafting.
- The first argument tells how many "batches" you want to make in a single package
- Then, each argument after that represents a slot of the configuration and is a
stringof the itemname, likecreate:wrenchorapple.- those items get re-packaged as one order, and unpacked in an autocrafter in the order given.
- a nil argument equates to an empty slot.
Warning
Redstone requesters lose their craft-encoding capability once interacted with as a player, since by closing the ui you send the server a packet that makes the request in the menu a normal request, regardless if it was a crafting one or not.
Parameters
- itemName:
stringmatching the name of the desired item. You can have up to 9itemNameargs.
Usage
redstoneRequester = peripheral.find("Create_RedstoneRequester")
redstoneRequester.setCraftingRequest(
1, -- number of crafts we want
"minecraft:diamond",
"minecraft:diamond",
"diamond", -- skipping "minecraft:" works for vanilla items
"minecraft:air", -- sets an empty slot
"minecraft:stick",
nil, -- also sets an empty slot
nil,
"minecraft:stick",
-- not providing args at the end also sets empty slots
)
redstoneRequester.setAddress("crafter"])
redstoneRequester.request()Will request a package that crafts into a Diamond Pickaxe when provided to properly set up auto-crafters.
While:
redstoneRequester.setCraftingRequest()will clear the request and set it to 9 empty slots.
setRequest([item], ...)
Sets the packagers request, the same one as the one available in the GUI - maximum of 9 arguments.
- Each argument represents a slot of the configuration and is a table of the item
name, likecreate:wrenchorappleand thecount, between1and256. - a nil argument or a table with an unspecified
nameare allowed but serve no purpose - Unspecified
countequates to1
Parameters
- item:
tableTable ofname = stringandcount = number. You can have up to 9itemargs.
Usage
redstoneRequester = peripheral.find("Create_RedstoneRequester")
redstoneRequester.setRequest(
{ name = "minecraft:dirt", count = nil }, -- defaults to 1
-- "diamond", -- this would error
{ name = "minecraft:sand", count = "yay" }, -- defaults to 1
{ name = "cobblestone", count = 21 }, -- skipping "minecraft:" works for vanilla items
{ name = "create:wrench" },
)
redstoneRequester.setAddress("crafter")
redstoneRequester.request()Will request a package that contains (if available) 1 dirt, 1 sand, 21 cobblestone and a create wrench.
While:
redstoneRequester.setRequest()will clear the request and set it to 9 empty slots.