Advertisement
TheSpicePhantom

essentiaMK2

Jul 22nd, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.60 KB | None | 0 0
  1. --56
  2.  
  3. currAsp = {}
  4.  
  5.  
  6.  
  7.  
  8. aspectList = {
  9.     Ordo = {amount = 0},
  10.     Motus = {amount = 0},
  11.     Invidia = {amount = 0},
  12.     Aer = {amount = 0},
  13.     Terra = {amount = 0},
  14.     Ignis = {amount = 0},
  15.     Aqua = {amount = 0},
  16.     Perditio = {amount = 0},
  17.     Vacuos = {amount = 0},
  18.     Lux = {amount = 0},
  19.     Tempestas = {amount = 0},
  20.     Gelum = {amount = 0},
  21.     Vitreus = {amount = 0},
  22.     Victus = {amount = 0},
  23.     Venenum = {amount = 0},
  24.     Potentia = {amount = 0},
  25.     Permutatio = {amount = 0},
  26.     Metallum = {amount = 0},
  27.     Mortuus = {amount = 0},
  28.     Volatus = {amount = 0},
  29.     Tenebrae = {amount = 0},
  30.     Spiritus = {amount = 0},
  31.     Sano = {amount = 0},
  32.     Iter = {amount = 0},
  33.     Alienis = {amount = 0},
  34.     Praecantatio = {amount = 0},
  35.     Auram = {amount = 0},
  36.     Vitium = {amount = 0},
  37.     Limus = {amount = 0},
  38.     Herba = {amount = 0},
  39.     Arbor = {amount = 0},
  40.     Bestia = {amount = 0},
  41.     Corpus = {amount = 0},
  42.     Exanimis = {amount = 0},
  43.     Cognitio = {amount = 0},
  44.     Sensus = {amount = 0},
  45.     Humanus = {amount = 0},
  46.     Messis = {amount = 0},
  47.     Perfodio = {amount = 0},
  48.     Instrumentum = {amount = 0},
  49.     Meto = {amount = 0},
  50.     Telum = {amount = 0},
  51.     Tutamen = {amount = 0},
  52.     Fames = {amount = 0},
  53.     Lucrum = {amount = 0},
  54.     Fabrico = {amount = 0},
  55.     Pannus = {amount = 0},
  56.     Machina = {amount = 0},
  57.     Vinculum = {amount = 0},
  58.     Luxuria = {amount = 0},
  59.     Infernus = {amount = 0},
  60.     Superbia = {amount = 0},
  61.     Gula = {amount = 0},
  62.     Desidia = {amount = 0},
  63.     Ira = {amount = 0},
  64.     Tempus = {amount = 0}
  65. }
  66. table.sort(aspectList)
  67.  
  68.  
  69. for id, device in ipairs(peripheral.getNames()) do
  70.     if (peripheral.getType(device) == "EssentiaProvider") then
  71.  
  72.         provider = peripheral.wrap(device)
  73.         aspects = {provider.getAspects()}
  74.         print(device.." wurde gefunden.")
  75.         print("Verbinde...")
  76.     elseif (peripheral.getType(device) == "monitor") then
  77.         mon = peripheral.wrap(device)
  78.         print(device.." wurde gefunden.")
  79.         print("Verbinde...")
  80.         mon.clear()
  81.     end
  82. end
  83.  
  84. function tableBuilder()
  85.     for k, v in pairs(aspectList) do
  86.         amount = provider.getAmount(tostring(k))
  87.         aspectList[k].amount = amount
  88.     end
  89. end
  90.  
  91. function touch()
  92.     local event, side, xPos, yPos = os.pullEvent("monitor_touch")
  93.     if event == "monitor_touch" then
  94.         if xPos <= 10 and xPos >= 1 and yPos <= 26 and yPos >= 22 then
  95.            
  96.         end
  97.     end
  98. end
  99.  
  100. function printToMonitor()
  101.     table.sort(aspectList)
  102.     local x = 1
  103.     local y = 1
  104.  
  105.     table.foreach(aspectList, function(k,v)
  106.         aspAmount = aspectList[k].amount
  107.         if y == 20 or y == 40 then
  108.                 x = x+26
  109.                 y = 1
  110.         end
  111.         if aspAmount <= 100 and aspAmount >= 0 then
  112.             mon.setTextColor(colors.red)
  113.             mon.setCursorPos(x,y)
  114.             mon.write(tostring(k)..": "..aspAmount.." ")
  115.         elseif aspAmount <= 200 and aspAmount >= 101 then
  116.             mon.setTextColor(colors.orange)
  117.             mon.setCursorPos(x,y)
  118.             mon.write(tostring(k)..": "..aspAmount.." ")
  119.         elseif aspAmount <= 300 and aspAmount >= 201 then
  120.             mon.setTextColor(colors.yellow)
  121.             mon.setCursorPos(x,y)
  122.             mon.write(tostring(k)..": "..aspAmount.." ")
  123.         elseif aspAmount <= 400 and aspAmount >= 301 then
  124.             mon.setTextColor(colors.green)
  125.             mon.setCursorPos(x,y)
  126.             mon.write(tostring(k)..": "..aspAmount.." ")
  127.         elseif aspAmount <= 500 and aspAmount >= 401 then
  128.             mon.setTextColor(colors.lime)
  129.             mon.setCursorPos(x,y)
  130.             mon.write(tostring(k)..": "..aspAmount.." ")
  131.         elseif aspAmount >= 501 then
  132.             mon.setTextColor(colors.blue)
  133.             mon.setCursorPos(x,y)
  134.             mon.write(tostring(k)..": "..aspAmount.." ")
  135.         end
  136.        
  137.         y = y+1
  138.     end)
  139. end
  140.  
  141. function extractValues()
  142.    
  143. end
  144.  
  145. while true do
  146.     local x,y = mon.getSize()
  147.     term.setCursorPos(1, 1)
  148.     term.clear()
  149.     print(x..","..y)
  150.     tableBuilder()
  151.     printToMonitor()
  152.     sleep(0.5)
  153. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement