Guest User

test

a guest
May 10th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.54 KB | None | 0 0
  1. local Monitor = peripheral.wrap("monitor_0")
  2. local Monitor2 = peripheral.wrap("monitor_1")
  3. MonitorColorRed = loadstring("Monitor.setTextColor(colors.red)")
  4. MonitorColorWhite = loadstring("Monitor.setTextColor(colors.white)")
  5. MonitorColorGreen = loadstring("Monitor.setTextColor(colors.green)")
  6. rednet.open("back")
  7. term.setTextColor(colors.white)
  8. MonitorColorWhite()
  9. while true do
  10.  Monitor.clear()
  11.  MonitorColorWhite()
  12.  Monitor.setCursorPos(1,1)
  13.  Monitor.write("Oxygen")
  14.  id,message = rednet.receive()
  15.  Monitor.write(message)
  16.  if message == "Oxygen 100" then
  17.   term.clear()
  18.   Monitor.clear()
  19.   MonitorColorWhite()
  20.   Monitor.clear()
  21.   Monitor.setCursorPos(1,1)
  22.   Monitor.write("Oxygen")
  23.   Monitor.setCursorPos(1,2)
  24.   MonitorColorRed()
  25.   Monitor.write("100")
  26.   MonitorColorWhite()
  27.  end
  28.  if message == "Oxygen 90" then
  29.   term.clear()
  30.   Monitor.clear()
  31.   Monitor.setCursorPos(1,1)
  32.   Monitor.write("Oxygen")
  33.   Monitor.setCursorPos(1,2)
  34.   MonitorColorGreen()
  35.   Monitor.write("90")
  36.   MonitorColorWhite()
  37.  end
  38.  if message == "Oxygen 80" then
  39.   term.clear()
  40.   Monitor.clear()
  41.   MonitorColorWhite()
  42.   Monitor.setCursorPos(1,1)
  43.   Monitor.write("Oxygen:")
  44.   Monitor.setCursorPos(1,2)
  45.   MonitorColorGreen()
  46.   Monitor.write("80")
  47.   MonitorColorWhite()
  48.  end
  49.  if message == "Oxygen 70" then
  50.   term.clear()
  51.   Monitor.clear()
  52.   MonitorColorWhite()
  53.   Monitor.clear()
  54.   Monitor.setCursorPos(1,1)
  55.   Monitor.write("Oxygen:")
  56.   Monitor.setCursorPos(1,2)
  57.   MonitorColorGreen()
  58.   Monitor.write("70")
  59.   MonitorColorWhite()
  60.  end
  61.  if message == "Oxygen 60" then
  62.   term.clear()
  63.   Monitor.clear()
  64.   MonitorColorWhite()
  65.   Monitor.clear()
  66.   Monitor.setCursorPos(1,1)
  67.   Monitor.write("Oxygen:")
  68.   Monitor.setCursorPos(1,2)
  69.   MonitorColorGreen()
  70.   Monitor.write("60")
  71.   MonitorColorWhite()
  72.  end
  73.  if message == "Oxygen 50" then
  74.   term.clear()
  75.   Monitor.clear()
  76.   MonitorColorWhite()
  77.   Monitor.clear()
  78.   Monitor.setCursorPos(1,1)
  79.   Monitor.write("Oxygen:")
  80.   Monitor.setCursorPos(1,2)
  81.   Monitor.setTextColor(colors.yellow)
  82.   Monitor.write("50")
  83.   MonitorColorWhite()
  84.  end
  85.  if message == "Oxygen 40" then
  86.   term.clear()
  87.   Monitor.clear()
  88.   MonitorColorWhite()
  89.   Monitor.clear()
  90.   Monitor.setCursorPos(1,1)
  91.   Monitor.write("Oxygen:")
  92.   Monitor.setCursorPos(1,2)
  93.   Monitor.setTextColor(colors.yellow)
  94.   Monitor.write("40")
  95.   MonitorColorWhite()
  96.  end
  97.  if message == "Oxygen 30" then
  98.   term.clear()
  99.   Monitor.clear()
  100.   MonitorColorWhite()
  101.   Monitor.clear()
  102.   Monitor.setCursorPos(1,1)
  103.   Monitor.write("Oxygen:")
  104.   Monitor.setCursorPos(1,2)
  105.   Monitor.setTextColor(colors.yellow)
  106.   Monitor.write("30")
  107.   MonitorColorWhite()
  108.  end
  109.  if message == "Oxygen 20" then
  110.   term.clear()
  111.   Monitor.clear()
  112.   MonitorColorWhite()
  113.   Monitor.clear()
  114.   Monitor.setCursorPos(1,1)
  115.   Monitor.write("Oxygen:")
  116.   Monitor.setCursorPos(1,2)
  117.   MonitorColorRed()
  118.   Monitor.write("20")
  119.   MonitorColorWhite()
  120.  end
  121.  if message == "Oxygen 10" then
  122.   term.clear()
  123.   Monitor.clear()
  124.   MonitorColorWhite()
  125.   Monitor.clear()
  126.   Monitor.setCursorPos(1,1)
  127.   Monitor.write("Oxygen:")
  128.   Monitor.setCursorPos(1,2)
  129.   MonitorColorRed()
  130.   Monitor.write("10")
  131.   MonitorColorWhite()
  132.  end
  133.  if message == "Game Over" then
  134.   term.clear()
  135.   Monitor.clear()
  136.   Monitor2.setTextColor(colors.white)
  137.   Monitor2.clear()
  138.   Monitor2.setCursorPos(5,5)
  139.   Monitor2.setTextColor(colors.red)
  140.   Monitor2.write("GAME OVER")
  141.   Monitor2.setTextColor(colors.white)
  142.   sleep(5)
  143.   Monitor2.clear()
  144.   Monitor.clear()
  145.   os.shutdown()
  146.  end
  147.  id,message = rednet.receive(1)
  148.  print(message)
  149. end
Advertisement
Add Comment
Please, Sign In to add comment