Guest User

trc

a guest
Dec 25th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. monitor = peripheral.wrap("top")
  2. monitor.setTextScale(1)
  3. monitor.setTextColor(32768)
  4.  
  5. rednet.open("right")
  6. local pc = 0
  7. local name = ""
  8. local menge = 0
  9. local kapazitaet = 0
  10.  
  11. while true do
  12.   pc,name = rednet.receive()
  13.   pc,menge = rednet.receive()
  14.   pc,kapazitaet = rednet.receive()
  15.  
  16.   term.clear()
  17.   term.setCursorPos(1,1)
  18.   if menge >= kapazitaet/2 then
  19.     monitor.setBackgroundColor(8192)
  20.   end
  21.   if menge < kapazitaet/2 and menge >= kapazitaet/5 then
  22.     monitor.setBackgroundColor(2)
  23.   end
  24.   if menge < kapazitaet/5 then
  25.     monitor.setBackgroundColor(16384)
  26.   end
  27.    
  28.   term.write("Inhalt: "..name.." ")
  29.   term.setCursorPos(1,2)
  30.   term.write("Fuellstand: "..menge.." / "..kapazitaet)
  31.   sleep(1)
  32. end
Advertisement
Add Comment
Please, Sign In to add comment