Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local t = {
- ["purple"] = {
- side = "left",
- flux_level = 0,
- flux_max = 7
- },
- ["lime"] = {
- side = "back",
- flux_level = 0,
- flux_max = 7
- },
- ["orange"] = {
- side = "right",
- flux_level = 0,
- flux_max = 7
- },
- ["central"] = {
- side = "front",
- flux_level = 0,
- flux_max = 5
- }
- }
- ---------------------------
- --Prints Table for debugging
- ---------------------------
- local function printTable(e)
- if type(e) == "table" then
- for k,v in pairs(e) do -- for every element in the table
- print(k,v)
- printTable(v) -- recursively repeat the same procedure
- sleep(1.5)
- print()
- end
- else -- if not, we can just print it
- print(e)
- end
- end
- ---------------------------
- --U
- ---------------------------
- local function getUpdate()
- while true do
- if os.pullEvent("redstone") then
- t.purple.flux_level = rs.getAnalogInput(t.purple.side)
- t.lime.flux_level = rs.getAnalogInput(t.lime.side)
- t.orange.flux_level = rs.getAnalogInput(t.orange.side)
- t.central.flux_level = rs.getAnalogInput(t.central.side)
- print("Updated")
- printTable(t)
- sleep(1)
- else
- sleep(1)
- print("No Update")
- end
- end
- end
- getUpdate()
Advertisement
Add Comment
Please, Sign In to add comment