Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local term = require("term")
- local event = require("event")
- local function cycleTable(x)
- term.clear()
- for k,v in pairs(component[x]) do
- print(k,v)
- event.pull("key_up")
- end
- end
- local function main()
- io.write("What component table do you need to read through?\n")
- local table = io.read()
- os.sleep(0.5)
- if type(component[table]) == "table" then
- cycleTable(table)
- else
- print("Not a valid table!")
- os.sleep(1)
- term.clear()
- main()
- end
- end
- term.clear()
- io.write("Component table cycler v.1\n")
- os.sleep(1)
- term.clear()
- main()
Advertisement
Add Comment
Please, Sign In to add comment