Advertisement
Guest User

agadgasfasgf

a guest
Sep 2nd, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.00 KB | None | 0 0
  1. monitor = peripheral.wrap("back")
  2. modem = peripheral.wrap("left")
  3. term.redirect(monitor) --output zum bildschirm
  4. term.clear() --bildschirm leeren
  5. monitor.setTextScale(1.25)
  6. currcharge = 0
  7. charges = {}        
  8.  
  9.           --variable grenzen--
  10.          local maxcharge = 300000000
  11.          local stopcharge = 45000000
  12.          local startcharge = 400000
  13.           --------------------
  14.      
  15. while true do
  16.   term.setCursorPos(1,1)
  17.         for i = 111, 116, 1 do
  18.                 modem.open(i)
  19.       local a, b, kanal, d, charge, f = os.pullEvent("modem_message")
  20.       charges[kanal] = tonumber(charge)
  21.       currcharge = currcharge + charge
  22.                 modem.close(i)
  23.         end
  24.   term.setCursorPos(4, 1)
  25.   term.setTextColor(colors.green)
  26.   print("-==POWERNET OVERVIEW=-")
  27.   term.setTextColor(colors.white)
  28.   if rs.getInput("front") then
  29.     term.setCursorPos(2,8)
  30.     term.setBackgroundColor(colors.green)
  31.     print(" Reaktor1 ")
  32.     term.setCursorPos(2,9)
  33.     print("          ")
  34.     term.setCursorPos(2,10)
  35.     print("    AN    ")
  36.     term.setBackgroundColor(colors.black)
  37.   else
  38.     term.setCursorPos(2, 8)
  39.     term.setBackgroundColor(colors.red)
  40.     print(" Reaktor1 ")
  41.     term.setCursorPos(2, 9)
  42.     print("          ")
  43.     term.setCursorPos(2, 10)
  44.     print("   AUS    ")
  45.     term.setBackgroundColor(colors.black)
  46.   end
  47.   if rs.getInput("bright") then
  48.     term.setCursorPos(8,8)
  49.     term.setBackgroundColor(colors.green)
  50.     print(" Reaktor2 ")
  51.     term.setCursorPos(8,9)
  52.     print("          ")
  53.     term.setCursorPos(8,10)
  54.     print("    AN    ")
  55.     term.setBackgroundColor(colors.black)
  56.   else
  57.     term.setCursorPos(8, 8)
  58.     term.setBackgroundColor(colors.red)
  59.     print(" Reaktor2 ")
  60.     term.setCursorPos(8, 9)
  61.     print("          ")
  62.     term.setCursorPos(8, 10)
  63.     print("   AUS    ")
  64.     term.setBackgroundColor(colors.black)
  65.   end
  66.   term.setCursorPos(3,3)
  67.   print("Stored: "..currcharge.."RF, "..math.floor(currcharge/3000000).."%    ")  
  68.   currcharge = 0
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement