Skip to content

Instantly share code, notes, and snippets.

@glektarssza
Last active September 27, 2024 15:14
Show Gist options
  • Save glektarssza/1b42478aecb4449d06fb7813aa0e31a7 to your computer and use it in GitHub Desktop.
Save glektarssza/1b42478aecb4449d06fb7813aa0e31a7 to your computer and use it in GitHub Desktop.
A small helper for CC: Tweaked.
--- The block manipulator peripheral that will be used to work with the other
--- blocks.
local manipulator = nil
--- The RFTools Crafter Tier 3 peripheral.
local crafter = nil
--- The Storage Drawer peripheral that will store overflowing items.
local overflow_drawer = nil
--- The ProjectE Energy Condenser Mk2 peripheral.
local condenser = nil
local function setup()
manipulator = peripheral.find("manipulator")
if not manipulator then
printError("Error: no manipulator peripheral found!")
return false
end
local hasScanner = manipulator.hasModule("plethora:scanner")
if not hasScanner then
printError("Error: manipulator peripheral is missing the block scanner module!")
return false
end
local scannedBlocks = manipulator.scan()
for _, block in pairs(scannedBlocks) do
if block.name == "rftools:crafter3" then
crafter = block
elseif block.name == "storagedrawers:basicdrawers" then
print("Found storage drawer: ")
print(textutils.serialise(block, { compact = false }))
end
end
return true
end
local function main()
end
local setupOk = setup()
if setupOk then
main()
else
printError("Error: setup failed, aborting!")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment