Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.find("monitor")
- local essentia = peripheral.wrap("back")
- local aspects = {
- Aer = 0,
- Aqua = 0,
- Ignis = 0,
- Ordo = 0,
- Perditio = 0,
- Terra = 0,
- Gelum = 0,
- Lux = 0,
- Motus = 0,
- Permutatio = 0,
- Potentia = 0,
- Tempestas = 0,
- Vacuos = 0,
- Venenum = 0,
- Victus = 0,
- Vitreus = 0,
- Bestia = 0,
- Fames = 0,
- Herba = 0,
- Iter = 0,
- Limus = 0,
- Metallum = 0,
- Mortuus = 0,
- Praecantatio = 0,
- Sano = 0,
- Tenebrae = 0,
- Vinculum = 0,
- Volatus = 0,
- Alienis = 0,
- Arbor = 0,
- Auram = 0,
- Corpus = 0,
- Exanimis = 0,
- Spiritus = 0,
- Vitium = 0,
- Cognitio = 0,
- Sensus = 0,
- Humanus = 0,
- Instrumentum = 0,
- Lucrum = 0,
- Messis = 0,
- Perfodio = 0,
- Fabrico = 0,
- Machina = 0,
- Meto = 0,
- Pannus = 0,
- Telum = 0,
- Tutamen = 0,
- Infernus = 0,
- Luxuria = 0,
- Gula = 0,
- Desidia = 0,
- Ira = 0,
- Invidia = 0,
- Superbia = 0,
- Tempus = 0
- }
- local threshHold = 1000
- -- sorting
- do
- local s = {}
- for i,v in pairs(aspects) do
- table.insert(s,i)
- end
- table.sort(s)
- aspects = {}
- for i,v in ipairs(s) do
- aspects[i] = {v,0}
- end
- end
- local function aspectScan()
- local etable = {essentia.getAspects()}
- local sorted = {}
- local calling = {}
- for i = 1, #etable, 2 do
- if i % 2 == 1 then
- table.insert(sorted,etable[i])
- end
- calling[etable[i]] = etable[i+1]
- end
- table.sort(sorted)
- local result = {}
- for i,v in ipairs(sorted) do
- result[v] = calling[v]
- end
- for i,v in ipairs(aspects) do
- if result[v[1]] then
- v[2] = result[v[1]]
- else
- v[2] = 0
- end
- end
- end
- local function outputToMonitor(tab)
- monitor.clear()
- monitor.setCursorPos(1,1)
- local posx,posy = 1,1
- for i,v in ipairs(tab) do
- if v[2] < threshHold then
- monitor.setTextColor(colors.red)
- elseif v[2] > 2001 then
- monitor.setTextColor(colors.green)
- else
- monitor.setTextColor(colors.yellow)
- end
- monitor.setCursorPos(posx,posy)
- monitor.write(v[1] .. ":")
- local offset = (posx + 19) - string.len(v[2])
- monitor.setCursorPos(offset,posy)
- monitor.write(v[2])
- if posy < 19 then
- posy = posy + 1
- else
- posy = 1
- posx = posx + 25
- end
- end
- end
- aspectScan()
- outputToMonitor(aspects)
- while true do
- os.sleep(30)
- aspectScan()
- outputToMonitor(aspects)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement