Advertisement
Guest User

buttons

a guest
Nov 22nd, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. local aMon = peripheral.wrap("top")
  2. local reac = peripheral.wrap("BigReactors-Reactor_0")
  3.  
  4. aMon.clear()
  5. aMon.setCursorPos(1, 1)
  6.  
  7. function round(num)
  8.   return math.floor(num + 0.5)
  9. end
  10.  
  11. function printActive()
  12.   -- Check if the reactor is active
  13.   aMon.write("Active............ ")
  14.   if reac.getActive() then
  15.     aMon.setTextColor(colors.lime)
  16.     aMon.write("Yes")
  17.   else
  18.     aMon.setTextColor(colors.red)
  19.     aMon.write("No")
  20.   end
  21.   aMon.setTextColor(colors.white)  
  22. end
  23.  
  24. function printFuelTemp()
  25.   aMon.write("Fuel Temperature.. ")
  26.   temp = reac.getFuelTemperature()
  27.   if temp > 250 and temp < 500 then
  28.     aMon.setTextColor(colors.cyan)
  29.   elseif temp < 1000 then
  30.     aMon.setTextColor(colors.lime)
  31.   elseif temp < 1500 then
  32.     aMon.setTextColor(colors.yellow)
  33.   elseif temp < 1900 then
  34.     aMon.setTextColor(colors.orange)
  35.   else
  36.     aMon.setTextColor(colors.red)
  37.   end
  38.   aMon.write(tostring(round(temp)))
  39.   aMon.setTextColor(colors.white)
  40.   aMon.write(" / 2000C)")
  41. end
  42.  
  43. printActive()
  44. aMon.setCursorPos(1, 2)
  45. printFuelTemp()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement