Advertisement
Guest User

startup

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