Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Wrap the peripheral behind the computer
- local peripheralSide = "back" -- Adjust as needed
- local wrappedPeripheral = peripheral.wrap(peripheralSide)
- -- Check if the peripheral is available
- if wrappedPeripheral == nil then
- print("Peripheral on side " .. peripheralSide .. " not found!")
- return
- end
- -- Function to print functions in batches
- local function printFunctionsInBatches(peripheralFunctions)
- local batchSize = 10
- local totalFunctions = #peripheralFunctions
- for i = 1, totalFunctions, batchSize do
- for j = i, math.min(i + batchSize - 1, totalFunctions) do
- print(j .. ". " .. peripheralFunctions[j])
- end
- if i + batchSize <= totalFunctions then
- print("Press any key to continue...")
- os.pullEvent("key")
- end
- end
- end
- -- Get a list of all available functions
- local allFunctions = {}
- for functionName, _ in pairs(wrappedPeripheral) do
- table.insert(allFunctions, functionName)
- end
- -- Print functions in batches
- printFunctionsInBatches(allFunctions)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement