Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("front")
- rednet.open("back")
- os.loadAPI("touchpoint")
- local monitor = peripheral.find("monitor")
- t = touchpoint.new("bottom")
- monitor.setBackgroundColor(colors.black)
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.setTextColor(colors.black)
- local jar0 = table.concat(peripheral.call("tt_aspectContainer_0", "getAspects"))
- local jar0count = tostring(peripheral.call("tt_aspectContainer_0", "getAspectCount", jar0))
- if tonumber(jar0count)<=20 then jar0status = colors.red end
- if tonumber(jar0count)<40 and tonumber(jar0count)>20 then jar0status = colors.yellow end
- if tonumber(jar0count)>=40 then jar0status = colors.green end
- t:add("Potentia", nil, 1, 1, 12, 1, jar0status, colors.gray)
- local jar1 = table.concat(peripheral.call("tt_aspectContainer_1", "getAspects"))
- local jar1count = tostring(peripheral.call("tt_aspectContainer_1", "getAspectCount", jar1))
- if tonumber(jar1count)<=20 then jar1status = colors.red end
- if tonumber(jar1count)<40 and tonumber(jar1count)>20 then jar1status = colors.yellow end
- if tonumber(jar1count)>=40 then jar1status = colors.green end
- t:add((jar1.." "..jar1count), nil, 1, 2, 20, 2, jar1status, colors.gray)
- local jar2 = table.concat(peripheral.call("tt_aspectContainer_2", "getAspects"))
- local jar2count = tostring(peripheral.call("tt_aspectContainer_2", "getAspectCount", jar2))
- if tonumber(jar2count)<=20 then jar2status = colors.red end
- if tonumber(jar2count)<40 and tonumber(jar2count)>20 then jar2status = colors.yellow end
- if tonumber(jar2count)>=40 then jar2status = colors.green end
- t:add((jar2.." "..jar2count), nil, 1, 3, 20, 3, jar2status, colors.gray)
- local jar3 = table.concat(peripheral.call("tt_aspectContainer_3", "getAspects"))
- local jar3count = tostring(peripheral.call("tt_aspectContainer_3", "getAspectCount", jar3))
- if tonumber(jar3count)<=20 then jar3status = colors.red end
- if tonumber(jar3count)<40 and tonumber(jar3count)>20 then jar3status = colors.yellow end
- if tonumber(jar3count)>=40 then jar3status = colors.green end
- t:add((jar3.." "..jar3count), nil, 1, 4, 20, 4, jar3status, colors.gray)
- local jar4 = table.concat(peripheral.call("tt_aspectContainer_4", "getAspects"))
- local jar4count = tostring(peripheral.call("tt_aspectContainer_4", "getAspectCount", jar4))
- if tonumber(jar4count)<=20 then jar4status = colors.red end
- if tonumber(jar4count)<40 and tonumber(jar4count)>20 then jar4status = colors.yellow end
- if tonumber(jar4count)>=40 then jar4status = colors.green end
- t:add((jar4.." "..jar4count), nil, 1, 5, 20, 5, jar4status, colors.gray)
- local jar5 = table.concat(peripheral.call("tt_aspectContainer_5", "getAspects"))
- local jar5count = tostring(peripheral.call("tt_aspectContainer_5", "getAspectCount", jar5))
- if tonumber(jar5count)<=20 then jar5status = colors.red end
- if tonumber(jar5count)<40 and tonumber(jar5count)>20 then jar5status = colors.yellow end
- if tonumber(jar5count)>=40 then jar5status = colors.green end
- t:add((jar5.." "..jar5count), nil, 1, 6, 20, 6, jar5status, colors.gray)
- local jar6 = table.concat(peripheral.call("tt_aspectContainer_6", "getAspects"))
- local jar6count = tostring(peripheral.call("tt_aspectContainer_6", "getAspectCount", jar6))
- if tonumber(jar6count)<=20 then jar6status = colors.red end
- if tonumber(jar6count)<40 and tonumber(jar6count)>20 then jar6status = colors.yellow end
- if tonumber(jar6count)>=40 then jar6status = colors.green end
- t:add((jar6.." "..jar6count), nil, 1, 7, 20, 7, jar6status, colors.gray)
- local jar7 = table.concat(peripheral.call("tt_aspectContainer_7", "getAspects"))
- local jar7count = tostring(peripheral.call("tt_aspectContainer_7", "getAspectCount", jar7))
- if tonumber(jar7count)<=20 then jar7status = colors.red end
- if tonumber(jar7count)<40 and tonumber(jar7count)>20 then jar7status = colors.yellow end
- if tonumber(jar7count)>=40 then jar7status = colors.green end
- t:add((jar7.." "..jar7count), nil, 1, 8, 20, 8, jar7status, colors.gray)
- local jar8 = table.concat(peripheral.call("tt_aspectContainer_8", "getAspects"))
- local jar8count = tostring(peripheral.call("tt_aspectContainer_8", "getAspectCount", jar8))
- if tonumber(jar8count)<=20 then jar8status = colors.red end
- if tonumber(jar8count)<40 and tonumber(jar8count)>20 then jar8status = colors.yellow end
- if tonumber(jar8count)>=40 then jar8status = colors.green end
- t:add((jar8.." "..jar8count), nil, 1, 9, 20, 9, jar8status, colors.gray)
- local jar9 = table.concat(peripheral.call("tt_aspectContainer_9", "getAspects"))
- local jar9count = tostring(peripheral.call("tt_aspectContainer_9", "getAspectCount", jar9))
- if tonumber(jar9count)<=20 then jar9status = colors.red end
- if tonumber(jar9count)<40 and tonumber(jar9count)>20 then jar9status = colors.yellow end
- if tonumber(jar9count)>=40 then jar9status = colors.green end
- t:add((jar9.." "..jar9count), nil, 1, 10, 20, 10, jar9status, colors.gray)
- local jar10 = table.concat(peripheral.call("tt_aspectContainer_10", "getAspects"))
- local jar10count = tostring(peripheral.call("tt_aspectContainer_10", "getAspectCount", jar10))
- if tonumber(jar10count)<=20 then jar10status = colors.red end
- if tonumber(jar10count)<40 and tonumber(jar10count)>20 then jar10status = colors.yellow end
- if tonumber(jar10count)>=40 then jar10status = colors.green end
- t:add((jar10.." "..jar10count), nil, 1, 11, 20, 11, jar10status, colors.gray)
- local jar11 = table.concat(peripheral.call("tt_aspectContainer_11", "getAspects"))
- local jar11count = tostring(peripheral.call("tt_aspectContainer_11", "getAspectCount", jar11))
- if tonumber(jar11count)<=20 then jar11status = colors.red end
- if tonumber(jar11count)<40 and tonumber(jar11count)>20 then jar11status = colors.yellow end
- if tonumber(jar11count)>=40 then jar11status = colors.green end
- t:add((jar11.." "..jar11count), nil, 1, 12, 20, 12, jar11status, colors.gray)
- local jar12 = table.concat(peripheral.call("tt_aspectContainer_12", "getAspects"))
- local jar12count = tostring(peripheral.call("tt_aspectContainer_12", "getAspectCount", jar12))
- if tonumber(jar12count)<=20 then jar12status = colors.red end
- if tonumber(jar12count)<40 and tonumber(jar12count)>20 then jar12status = colors.yellow end
- if tonumber(jar12count)>=40 then jar12status = colors.green end
- t:add((jar12.." "..jar12count), nil, 1, 13, 20, 13, jar12status, colors.gray)
- local jar13 = table.concat(peripheral.call("tt_aspectContainer_13", "getAspects"))
- local jar13count = tostring(peripheral.call("tt_aspectContainer_13", "getAspectCount", jar13))
- if tonumber(jar13count)<=20 then jar13status = colors.red end
- if tonumber(jar13count)<40 and tonumber(jar13count)>20 then jar13status = colors.yellow end
- if tonumber(jar13count)>=40 then jar13status = colors.green end
- t:add((jar13.." "..jar13count), nil, 1, 14, 20, 14, jar13status, colors.gray)
- local jar14 = table.concat(peripheral.call("tt_aspectContainer_14", "getAspects"))
- local jar14count = tostring(peripheral.call("tt_aspectContainer_14", "getAspectCount", jar14))
- if tonumber(jar14count)<=20 then jar14status = colors.red end
- if tonumber(jar14count)<40 and tonumber(jar14count)>20 then jar14status = colors.yellow end
- if tonumber(jar14count)>=40 then jar14status = colors.green end
- t:add((jar14.." "..jar14count), nil, 1, 15, 20, 15, jar14status, colors.gray)
- local jar15 = table.concat(peripheral.call("tt_aspectContainer_15", "getAspects"))
- local jar15count = tostring(peripheral.call("tt_aspectContainer_15", "getAspectCount", jar15))
- if tonumber(jar15count)<=20 then jar15status = colors.red end
- if tonumber(jar15count)<40 and tonumber(jar15count)>20 then jar15status = colors.yellow end
- if tonumber(jar15count)>=40 then jar15status = colors.green end
- t:add((jar15.." "..jar15count), nil, 1, 16, 20, 16, jar15status, colors.gray)
- local jar16 = table.concat(peripheral.call("tt_aspectContainer_16", "getAspects"))
- local jar16count = tostring(peripheral.call("tt_aspectContainer_16", "getAspectCount", jar16))
- if tonumber(jar16count)<=20 then jar16status = colors.red end
- if tonumber(jar16count)<40 and tonumber(jar16count)>20 then jar16status = colors.yellow end
- if tonumber(jar16count)>=40 then jar16status = colors.green end
- t:add((jar16.." "..jar16count), nil, 1, 17, 20, 17, jar16status, colors.gray)
- local jar17 = table.concat(peripheral.call("tt_aspectContainer_17", "getAspects"))
- local jar17count = tostring(peripheral.call("tt_aspectContainer_17", "getAspectCount", jar17))
- if tonumber(jar17count)<=20 then jar17status = colors.red end
- if tonumber(jar17count)<40 and tonumber(jar17count)>20 then jar17status = colors.yellow end
- if tonumber(jar17count)>=40 then jar17status = colors.green end
- t:add((jar17.." "..jar17count), nil, 1, 18, 20, 18, jar17status, colors.gray)
- local jar18 = table.concat(peripheral.call("tt_aspectContainer_18", "getAspects"))
- local jar18count = tostring(peripheral.call("tt_aspectContainer_18", "getAspectCount", jar18))
- if tonumber(jar18count)<=20 then jar18status = colors.red end
- if tonumber(jar18count)<40 and tonumber(jar18count)>20 then jar18status = colors.yellow end
- if tonumber(jar18count)>=40 then jar18status = colors.green end
- t:add((jar18.." "..jar18count), nil, 1, 19, 20, 19, jar18status, colors.gray)
- local jar19 = table.concat(peripheral.call("tt_aspectContainer_19", "getAspects"))
- local jar19count = tostring(peripheral.call("tt_aspectContainer_19", "getAspectCount", jar19))
- if tonumber(jar19count)<=20 then jar19status = colors.red end
- if tonumber(jar19count)<40 and tonumber(jar19count)>20 then jar19status = colors.yellow end
- if tonumber(jar19count)>=40 then jar19status = colors.green end
- t:add((jar19.." "..jar19count), nil, 25, 1, 45, 1, jar19status, colors.gray)
- t:draw()
- while true do
- --# handleEvents will convert monitor_touch events to button_click if it was on a button
- local event, bacon = t:handleEvents(os.pullEvent())
- if event == "button_click" then
- t:flash("bacon")
- rednet.broadcast("potentia")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement