Plazter

NOde status

Sep 7th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. mon = peripheral.wrap("monitor_38")
  2. node = peripheral.wrap("tt_aspectContainer_132")
  3. rednet.open("back")
  4. max = "init"
  5. function checknode()
  6.  if not peripheral.isPresent("tt_aspectContainer_132") then
  7.    mon.clear()
  8.    mon.setTextScale(.5)
  9.    mon.setCursorPos(5,25)
  10.    mon.write("Reboot the Node's peripheral")
  11.    sleep(5)
  12.    node = peripheral.wrap("tt_aspectContainer_132")
  13.    checknode()
  14.  end
  15.  mon.clear()
  16.  mon.setTextScale(.5)
  17.  mon.setCursorPos(10,1)
  18.  mon.write("Current Node Contain :")
  19.  line = 2
  20.  maxaspect = 1
  21.  aspectslist = node.getAspects()
  22.  for k,v in pairs(aspectslist) do
  23.   line = line + 1
  24.   aspectcount = node.getAspectCount(v)
  25.   mon.setCursorPos(10,line)
  26.   if max == v then
  27.     mon.setTextColor(colors.green)
  28.   end
  29.   mon.write(v .."")
  30.   mon.setCursorPos(23,line)
  31.   mon.write(": ".. aspectcount)
  32.   mon.setTextColor(colors.white)
  33.   if maxaspect < aspectcount then
  34.    maxaspect = aspectcount
  35.    max = v
  36.   end
  37.  end
  38.  --if minaspect < 10 then
  39.   --valmsg = "no"
  40.  --end
  41.  --if minaspect > 10 then
  42.  -- valmsg = "yes"
  43. -- end
  44. --print(valmsg)
  45. end
  46.  
  47.  
  48. while true do
  49.  checknode()
  50.  sleep(1)
  51. end
Add Comment
Please, Sign In to add comment