Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --56
- currAsp = {}
- aspectList = {
- Ordo = {amount = 0},
- Motus = {amount = 0},
- Invidia = {amount = 0},
- Aer = {amount = 0},
- Terra = {amount = 0},
- Ignis = {amount = 0},
- Aqua = {amount = 0},
- Perditio = {amount = 0},
- Vacuos = {amount = 0},
- Lux = {amount = 0},
- Tempestas = {amount = 0},
- Gelum = {amount = 0},
- Vitreus = {amount = 0},
- Victus = {amount = 0},
- Venenum = {amount = 0},
- Potentia = {amount = 0},
- Permutatio = {amount = 0},
- Metallum = {amount = 0},
- Mortuus = {amount = 0},
- Volatus = {amount = 0},
- Tenebrae = {amount = 0},
- Spiritus = {amount = 0},
- Sano = {amount = 0},
- Iter = {amount = 0},
- Alienis = {amount = 0},
- Praecantatio = {amount = 0},
- Auram = {amount = 0},
- Vitium = {amount = 0},
- Limus = {amount = 0},
- Herba = {amount = 0},
- Arbor = {amount = 0},
- Bestia = {amount = 0},
- Corpus = {amount = 0},
- Exanimis = {amount = 0},
- Cognitio = {amount = 0},
- Sensus = {amount = 0},
- Humanus = {amount = 0},
- Messis = {amount = 0},
- Perfodio = {amount = 0},
- Instrumentum = {amount = 0},
- Meto = {amount = 0},
- Telum = {amount = 0},
- Tutamen = {amount = 0},
- Fames = {amount = 0},
- Lucrum = {amount = 0},
- Fabrico = {amount = 0},
- Pannus = {amount = 0},
- Machina = {amount = 0},
- Vinculum = {amount = 0},
- Luxuria = {amount = 0},
- Infernus = {amount = 0},
- Superbia = {amount = 0},
- Gula = {amount = 0},
- Desidia = {amount = 0},
- Ira = {amount = 0},
- Tempus = {amount = 0}
- }
- table.sort(aspectList)
- for id, device in ipairs(peripheral.getNames()) do
- if (peripheral.getType(device) == "EssentiaProvider") then
- provider = peripheral.wrap(device)
- aspects = {provider.getAspects()}
- print(device.." wurde gefunden.")
- print("Verbinde...")
- elseif (peripheral.getType(device) == "monitor") then
- mon = peripheral.wrap(device)
- print(device.." wurde gefunden.")
- print("Verbinde...")
- mon.clear()
- end
- end
- function tableBuilder()
- for k, v in pairs(aspectList) do
- amount = provider.getAmount(tostring(k))
- aspectList[k].amount = amount
- end
- end
- function touch()
- local event, side, xPos, yPos = os.pullEvent("monitor_touch")
- if event == "monitor_touch" then
- if xPos <= 10 and xPos >= 1 and yPos <= 26 and yPos >= 22 then
- end
- end
- end
- function printToMonitor()
- table.sort(aspectList)
- local x = 1
- local y = 1
- table.foreach(aspectList, function(k,v)
- aspAmount = aspectList[k].amount
- if y == 20 or y == 40 then
- x = x+26
- y = 1
- end
- if aspAmount <= 100 and aspAmount >= 0 then
- mon.setTextColor(colors.red)
- mon.setCursorPos(x,y)
- mon.write(tostring(k)..": "..aspAmount.." ")
- elseif aspAmount <= 200 and aspAmount >= 101 then
- mon.setTextColor(colors.orange)
- mon.setCursorPos(x,y)
- mon.write(tostring(k)..": "..aspAmount.." ")
- elseif aspAmount <= 300 and aspAmount >= 201 then
- mon.setTextColor(colors.yellow)
- mon.setCursorPos(x,y)
- mon.write(tostring(k)..": "..aspAmount.." ")
- elseif aspAmount <= 400 and aspAmount >= 301 then
- mon.setTextColor(colors.green)
- mon.setCursorPos(x,y)
- mon.write(tostring(k)..": "..aspAmount.." ")
- elseif aspAmount <= 500 and aspAmount >= 401 then
- mon.setTextColor(colors.lime)
- mon.setCursorPos(x,y)
- mon.write(tostring(k)..": "..aspAmount.." ")
- elseif aspAmount >= 501 then
- mon.setTextColor(colors.blue)
- mon.setCursorPos(x,y)
- mon.write(tostring(k)..": "..aspAmount.." ")
- end
- y = y+1
- end)
- end
- function extractValues()
- end
- while true do
- local x,y = mon.getSize()
- term.setCursorPos(1, 1)
- term.clear()
- print(x..","..y)
- tableBuilder()
- printToMonitor()
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement