Advertisement
Guest User

Reaktor

a guest
Sep 21st, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.36 KB | None | 0 0
  1. os.loadAPI("DrawVal")
  2. os.loadAPI("PWrap")
  3. os.loadAPI("RWert")
  4. --os.loadAPI("MEnerg")
  5.  
  6. P = PWrap.PWrap()
  7. W = RWert.RWert(P.R)
  8.  
  9. shell.run("Intro")
  10.  
  11. while true do
  12.   P.mH.clear()
  13.   P.mH.setTextScale(1,4)
  14.   P.mH.setCursorPos(1,2)
  15.   P.mH.setTextColor(colors.cyan)
  16.   P.mH.write("ReaktorOS ProtoTyp")
  17.   P.mH.setTextColor(colors.white)
  18.   P.mH.setCursorPos(26,2)
  19.   P.mH.write("O Shutdown Programm O")
  20.   P.mH.setCursorPos(1,4)
  21.   P.mH.write("1: Reaktor An")
  22.   P.mH.setCursorPos(1,6)
  23.   P.mH.write("2: Reaktor Aus")
  24.   P.mH.setCursorPos(1,8)
  25.   P.mH.write("3: aktuelle Kerntemperatur")
  26.   P.mH.setCursorPos(1,10)
  27.   P.mH.write("4: aktuelle Aussenwandtemperatur")
  28.   P.mH.setCursorPos(1,12)
  29.   P.mH.write("5: Brennzellenstatus")
  30.   P.mH.setCursorPos(1,14)
  31.   P.mH.write("6: Abfallmenge")
  32.   P.mH.setCursorPos(1,16)
  33.   P.mH.write("7: Kernzerfallsrate")
  34.   P.mH.setCursorPos(1,18)
  35.   P.mH.write("8: Brennzellenverbrauch")
  36.   P.mT.clear()
  37.   P.mT.setTextColor(colors.white)
  38.   P.mT.setCursorPos(1,1)
  39.   P.mT.setTextScale(1,0)
  40.  
  41.   MTimer = os.startTimer(1)
  42.  
  43.   event, side, x, y, MTimer = os.pullEvent()
  44.  
  45.   if event ~= "monitor_touch" then
  46.  
  47.     W = RWert.RWert()
  48.    -- MTempR.MTempR(P.mT, W.tempF) --Temperatur Fuel
  49.     MTempR.MTempR(P.mC, W.tempC) --Temperatur Case
  50.     MReak.MReak(P.mR, W.radi, "Kernstrahlung", " %       ", 2, 6, 12) --Radiation
  51.     MReak.MReak(P.mF, W.waste, "Abfall", "milliBuckets", 2, 6, 12) --Waste
  52.     MReak.MReak(P.mF, W.fuel, "Brennstoff", "milliBuckets", 2, 6, 12) --Fuel
  53.     MReak.MReak(P.mFN, W.fuelN, "Verbrauch", "milliBuckets/T", 2, 6, 12) --FuelNeed
  54.     --MEnerg.MEnerg()
  55.     MTimer = os.startTimer(1)
  56.  
  57.   elseif event == "monitor_touch" then
  58.       if x > 25 and x < 35 and y == 2 then
  59.    
  60.       shell.run("Shutdown")
  61.       return
  62.    
  63.     elseif x > 0 and x < 24 and y == 4 then
  64.  
  65.       sleep(2)
  66.       P.mH.clear()
  67.       P.R.setActive(true)
  68.       P.mH.setTextScale(1)
  69.       P.mH.setCursorPos(1,1)
  70.       P.mH.setTextColor(colors.green)
  71.       P.mH.write("Reaktor wird Hochgefahren")
  72.       sleep(2)
  73.    
  74.     else if x > 0 and x < 24 and y == 6 then
  75.       P.mH.clear()
  76.       P.R.setActive(false)
  77.       P.mH.setTextScale(1)
  78.       P.mH.setCursorPos(1,1)
  79.       P.mH.setTextColor(colors.red)
  80.       P.mH.write("Reaktor wird Heruntergefahren")
  81.       sleep(2)
  82.  
  83.     else if x > 0 and x < 24 and y == 8 then
  84.    
  85.       DrawVal.DrawVal(P.mH, "Temperatur", W.tempF, "Grad C", colors.red, nil, colors.red)
  86.       sleep(2)
  87.  
  88.     else if x > 0 and x < 24 and y == 10 then
  89.    
  90.       DrawVal.DrawVal(P.mH, "Temperatur", W.tempC, "Grad C", colors.red, nil, colors.red)
  91.       sleep(2)
  92.    
  93.     else if x > 0 and x < 24 and y == 12 then
  94.    
  95.       DrawVal.DrawVal(P.mH, "Brennstoff", W.fuel, "mBuckets", colors.red, nil, colors.red)
  96.       sleep(2)
  97.    
  98.     else if x > 0 and x < 24 and y == 14 then
  99.    
  100.       DrawVal.DrawVal(P.mH, "Abfallmenge", W.waste, "mBuckets", colors.yellow, nil, colors.yellow)
  101.       sleep(2)
  102.  
  103.     else if x > 0 and x < 24 and y == 16 then
  104.    
  105.       DrawVal.DrawVal(P.mH, "Kernzerfallsrate", W.radi, "%", colors.purple, nil, colors.purple)
  106.       sleep(2)
  107.  
  108.     else if x > 0 and x < 24 and y== 18 then
  109.    
  110.       DrawVal.DrawVal(P.mH, "Brennstoffverbrauch", W.fuelN, "mBuckets/T", colors.brown, nil, colors.brown)
  111.       sleep(2)
  112.     end
  113.     end
  114.     end
  115.     end
  116.     end
  117.     end
  118.     end
  119.     end
  120.     end
  121.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement