Advertisement
Guest User

clarity

a guest
Jan 20th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.13 KB | None | 0 0
  1. rednet.open("front")
  2. rednet.open("back")
  3. os.loadAPI("touchpoint")
  4. local monitor = peripheral.find("monitor")
  5. t = touchpoint.new("bottom")
  6.  
  7. monitor.setBackgroundColor(colors.black)
  8. monitor.clear()
  9. monitor.setCursorPos(1,1)
  10. monitor.setTextColor(colors.black)
  11. local jar0 = table.concat(peripheral.call("tt_aspectContainer_0", "getAspects"))
  12. local jar0count = tostring(peripheral.call("tt_aspectContainer_0", "getAspectCount", jar0))
  13.   if tonumber(jar0count)<=20 then jar0status = colors.red end
  14.   if tonumber(jar0count)<40 and tonumber(jar0count)>20 then jar0status = colors.yellow end
  15.   if tonumber(jar0count)>=40 then jar0status = colors.green end
  16. t:add("Potentia", nil, 1, 1, 12, 1, jar0status, colors.gray)
  17.  
  18.  
  19.  
  20.  
  21.  local jar1 = table.concat(peripheral.call("tt_aspectContainer_1", "getAspects"))
  22. local jar1count = tostring(peripheral.call("tt_aspectContainer_1", "getAspectCount", jar1))
  23.   if tonumber(jar1count)<=20 then jar1status = colors.red end
  24.   if tonumber(jar1count)<40 and tonumber(jar1count)>20 then jar1status = colors.yellow end
  25.   if tonumber(jar1count)>=40 then jar1status = colors.green end
  26. t:add((jar1.."          "..jar1count), nil, 1, 2, 20, 2, jar1status, colors.gray)
  27.  
  28. local jar2 = table.concat(peripheral.call("tt_aspectContainer_2", "getAspects"))
  29. local jar2count = tostring(peripheral.call("tt_aspectContainer_2", "getAspectCount", jar2))
  30.   if tonumber(jar2count)<=20 then jar2status = colors.red end
  31.   if tonumber(jar2count)<40 and tonumber(jar2count)>20 then jar2status = colors.yellow end
  32.   if tonumber(jar2count)>=40 then jar2status = colors.green end
  33. t:add((jar2.."      "..jar2count), nil, 1, 3, 20, 3, jar2status, colors.gray)
  34.  
  35. local jar3 = table.concat(peripheral.call("tt_aspectContainer_3", "getAspects"))
  36. local jar3count = tostring(peripheral.call("tt_aspectContainer_3", "getAspectCount", jar3))
  37.   if tonumber(jar3count)<=20 then jar3status = colors.red end
  38.   if tonumber(jar3count)<40 and tonumber(jar3count)>20 then jar3status = colors.yellow end
  39.   if tonumber(jar3count)>=40 then jar3status = colors.green end
  40. t:add((jar3.."       "..jar3count), nil, 1, 4, 20, 4, jar3status, colors.gray)
  41.  
  42. local jar4 = table.concat(peripheral.call("tt_aspectContainer_4", "getAspects"))
  43. local jar4count = tostring(peripheral.call("tt_aspectContainer_4", "getAspectCount", jar4))
  44.   if tonumber(jar4count)<=20 then jar4status = colors.red end
  45.   if tonumber(jar4count)<40 and tonumber(jar4count)>20 then jar4status = colors.yellow end
  46.   if tonumber(jar4count)>=40 then jar4status = colors.green end
  47. t:add((jar4.."        "..jar4count), nil, 1, 5, 20, 5, jar4status, colors.gray)
  48.  
  49. local jar5 = table.concat(peripheral.call("tt_aspectContainer_5", "getAspects"))
  50. local jar5count = tostring(peripheral.call("tt_aspectContainer_5", "getAspectCount", jar5))
  51.   if tonumber(jar5count)<=20 then jar5status = colors.red end
  52.   if tonumber(jar5count)<40 and tonumber(jar5count)>20 then jar5status = colors.yellow end
  53.   if tonumber(jar5count)>=40 then jar5status = colors.green end
  54. t:add((jar5.."           "..jar5count), nil, 1, 6, 20, 6, jar5status, colors.gray)
  55.    
  56. local jar6 = table.concat(peripheral.call("tt_aspectContainer_6", "getAspects"))
  57. local jar6count = tostring(peripheral.call("tt_aspectContainer_6", "getAspectCount", jar6))
  58.   if tonumber(jar6count)<=20 then jar6status = colors.red end
  59.   if tonumber(jar6count)<40 and tonumber(jar6count)>20 then jar6status = colors.yellow end
  60.   if tonumber(jar6count)>=40 then jar6status = colors.green end
  61. t:add((jar6.."       "..jar6count), nil, 1, 7, 20, 7, jar6status, colors.gray)
  62.    
  63. local jar7 = table.concat(peripheral.call("tt_aspectContainer_7", "getAspects"))
  64. local jar7count = tostring(peripheral.call("tt_aspectContainer_7", "getAspectCount", jar7))
  65.   if tonumber(jar7count)<=20 then jar7status = colors.red end
  66.   if tonumber(jar7count)<40 and tonumber(jar7count)>20 then jar7status = colors.yellow end
  67.   if tonumber(jar7count)>=40 then jar7status = colors.green end
  68. t:add((jar7.."           "..jar7count), nil, 1, 8, 20, 8, jar7status, colors.gray)
  69.  
  70. local jar8 = table.concat(peripheral.call("tt_aspectContainer_8", "getAspects"))
  71. local jar8count = tostring(peripheral.call("tt_aspectContainer_8", "getAspectCount", jar8))
  72.   if tonumber(jar8count)<=20 then jar8status = colors.red end
  73.   if tonumber(jar8count)<40 and tonumber(jar8count)>20 then jar8status = colors.yellow end
  74.   if tonumber(jar8count)>=40 then jar8status = colors.green end
  75. t:add((jar8.."         "..jar8count), nil, 1, 9, 20, 9, jar8status, colors.gray)
  76.  
  77. local jar9 = table.concat(peripheral.call("tt_aspectContainer_9", "getAspects"))
  78. local jar9count = tostring(peripheral.call("tt_aspectContainer_9", "getAspectCount", jar9))
  79.   if tonumber(jar9count)<=20 then jar9status = colors.red end
  80.   if tonumber(jar9count)<40 and tonumber(jar9count)>20 then jar9status = colors.yellow end
  81.   if tonumber(jar9count)>=40 then jar9status = colors.green end
  82. t:add((jar9.."        "..jar9count), nil, 1, 10, 20, 10, jar9status, colors.gray)
  83.  
  84. local jar10 = table.concat(peripheral.call("tt_aspectContainer_10", "getAspects"))
  85. local jar10count = tostring(peripheral.call("tt_aspectContainer_10", "getAspectCount", jar10))
  86.   if tonumber(jar10count)<=20 then jar10status = colors.red end
  87.   if tonumber(jar10count)<40 and tonumber(jar10count)>20 then jar10status = colors.yellow end
  88.   if tonumber(jar10count)>=40 then jar10status = colors.green end
  89. t:add((jar10.."        "..jar10count), nil, 1, 11, 20, 11, jar10status, colors.gray)
  90.    
  91. local jar11 = table.concat(peripheral.call("tt_aspectContainer_11", "getAspects"))
  92. local jar11count = tostring(peripheral.call("tt_aspectContainer_11", "getAspectCount", jar11))
  93.   if tonumber(jar11count)<=20 then jar11status = colors.red end
  94.   if tonumber(jar11count)<40 and tonumber(jar11count)>20 then jar11status = colors.yellow end
  95.   if tonumber(jar11count)>=40 then jar11status = colors.green end
  96. t:add((jar11.."      "..jar11count), nil, 1, 12, 20, 12, jar11status, colors.gray)
  97.        
  98. local jar12 = table.concat(peripheral.call("tt_aspectContainer_12", "getAspects"))
  99. local jar12count = tostring(peripheral.call("tt_aspectContainer_12", "getAspectCount", jar12))
  100.   if tonumber(jar12count)<=20 then jar12status = colors.red end
  101.   if tonumber(jar12count)<40 and tonumber(jar12count)>20 then jar12status = colors.yellow end
  102.   if tonumber(jar12count)>=40 then jar12status = colors.green end
  103. t:add((jar12.."        "..jar12count), nil, 1, 13, 20, 13, jar12status, colors.gray)
  104.  
  105. local jar13 = table.concat(peripheral.call("tt_aspectContainer_13", "getAspects"))
  106. local jar13count = tostring(peripheral.call("tt_aspectContainer_13", "getAspectCount", jar13))
  107.   if tonumber(jar13count)<=20 then jar13status = colors.red end
  108.   if tonumber(jar13count)<40 and tonumber(jar13count)>20 then jar13status = colors.yellow end
  109.   if tonumber(jar13count)>=40 then jar13status = colors.green end
  110. t:add((jar13.."        "..jar13count), nil, 1, 14, 20, 14, jar13status, colors.gray)
  111.      
  112. local jar14 = table.concat(peripheral.call("tt_aspectContainer_14", "getAspects"))
  113. local jar14count = tostring(peripheral.call("tt_aspectContainer_14", "getAspectCount", jar14))
  114.   if tonumber(jar14count)<=20 then jar14status = colors.red end
  115.   if tonumber(jar14count)<40 and tonumber(jar14count)>20 then jar14status = colors.yellow end
  116.   if tonumber(jar14count)>=40 then jar14status = colors.green end
  117. t:add((jar14.."         "..jar14count), nil, 1, 15, 20, 15, jar14status, colors.gray)
  118.    
  119. local jar15 = table.concat(peripheral.call("tt_aspectContainer_15", "getAspects"))
  120. local jar15count = tostring(peripheral.call("tt_aspectContainer_15", "getAspectCount", jar15))
  121.   if tonumber(jar15count)<=20 then jar15status = colors.red end
  122.   if tonumber(jar15count)<40 and tonumber(jar15count)>20 then jar15status = colors.yellow end
  123.   if tonumber(jar15count)>=40 then jar15status = colors.green end
  124. t:add((jar15.."       "..jar15count), nil, 1, 16, 20, 16, jar15status, colors.gray)
  125.    
  126. local jar16 = table.concat(peripheral.call("tt_aspectContainer_16", "getAspects"))
  127. local jar16count = tostring(peripheral.call("tt_aspectContainer_16", "getAspectCount", jar16))
  128.   if tonumber(jar16count)<=20 then jar16status = colors.red end
  129.   if tonumber(jar16count)<40 and tonumber(jar16count)>20 then jar16status = colors.yellow end
  130.   if tonumber(jar16count)>=40 then jar16status = colors.green end
  131. t:add((jar16.."          "..jar16count), nil, 1, 17, 20, 17, jar16status, colors.gray)
  132.    
  133. local jar17 = table.concat(peripheral.call("tt_aspectContainer_17", "getAspects"))
  134. local jar17count = tostring(peripheral.call("tt_aspectContainer_17", "getAspectCount", jar17))
  135.   if tonumber(jar17count)<=20 then jar17status = colors.red end
  136.   if tonumber(jar17count)<40 and tonumber(jar17count)>20 then jar17status = colors.yellow end
  137.   if tonumber(jar17count)>=40 then jar17status = colors.green end
  138. t:add((jar17.."  "..jar17count), nil, 1, 18, 20, 18, jar17status, colors.gray)
  139.    
  140. local jar18 = table.concat(peripheral.call("tt_aspectContainer_18", "getAspects"))
  141. local jar18count = tostring(peripheral.call("tt_aspectContainer_18", "getAspectCount", jar18))
  142.   if tonumber(jar18count)<=20 then jar18status = colors.red end
  143.   if tonumber(jar18count)<40 and tonumber(jar18count)>20 then jar18status = colors.yellow end
  144.   if tonumber(jar18count)>=40 then jar18status = colors.green end
  145. t:add((jar18.."    "..jar18count), nil, 1, 19, 20, 19, jar18status, colors.gray)
  146.    
  147. local jar19 = table.concat(peripheral.call("tt_aspectContainer_19", "getAspects"))
  148. local jar19count = tostring(peripheral.call("tt_aspectContainer_19", "getAspectCount", jar19))
  149.   if tonumber(jar19count)<=20 then jar19status = colors.red end
  150.   if tonumber(jar19count)<40 and tonumber(jar19count)>20 then jar19status = colors.yellow end
  151.   if tonumber(jar19count)>=40 then jar19status = colors.green end
  152. t:add((jar19.."    "..jar19count), nil, 25, 1, 45, 1, jar19status, colors.gray)
  153.    
  154.  
  155. t:draw()
  156.  
  157. while true do
  158.         --# handleEvents will convert monitor_touch events to button_click if it was on a button
  159.         local event, bacon = t:handleEvents(os.pullEvent())
  160.         if event == "button_click" then
  161.                
  162.                 t:flash("bacon")
  163.                 rednet.broadcast("potentia")
  164.         end
  165. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement