Advertisement
loepie

ReactorReadOut

Mar 8th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.25 KB | None | 0 0
  1. --Loads the API, straightforward
  2. os.loadAPI("touchpoint")
  3. os.loadAPI("/rom/apis/rednet")
  4. rednet.open("bottom")
  5.  
  6. --Get monitor
  7. m = peripheral.wrap("monitor_0")
  8.  
  9. --computers that can send wireless signals
  10. local rc1 = rednet.lookup("rctrl","rc1")
  11. local rc2 = rednet.lookup("rctrl","rc2")
  12. local rc3 = rednet.lookup("rctrl","rc3")
  13. local rc4 = rednet.lookup("rctrl","rc4")
  14. local rc5 = rednet.lookup("rctrl","rc5")
  15. local rc6 = rednet.lookup("rctrl","rc6")
  16.  
  17. --computers that are under the reactors
  18. local rs1 = rednet.lookup("rctrl","rs1")
  19. local rs2 = rednet.lookup("rctrl","rs2")
  20. local rs3 = rednet.lookup("rctrl","rs3")
  21. local rs4 = rednet.lookup("rctrl","rs4")
  22. local rs5 = rednet.lookup("rctrl","rs5")
  23. local rs6 = rednet.lookup("rctrl","rs6")
  24.  
  25. --stuff connected to the reactors
  26. local r1fp = "reactor_fluid_port_1"
  27. local r2fp = "reactor_fluid_port_2"
  28. local r3fp = "reactor_fluid_port_4"
  29. local r4fp = "reactor_fluid_port_5"
  30. local r6fp = "reactor_fluid_port_6"
  31. local r1h = "nuclear_reactor_1"
  32. local r2h = "nuclear_reactor_2"
  33. local r3h = "nuclear_reactor_4"
  34. local r4h = "nuclear_reactor_5"
  35. local r6h = "nuclear_reactor_6"
  36.  
  37. function warmup()
  38.   m.clear()
  39.   m.setCursorPos(1,1)
  40.   m.setTextScale(1)
  41.   m.write("warming up")
  42.   m.setCursorPos(1,2)
  43.   m.write("waiting 10 seconds for all computers and peripherals to wake up")
  44.  
  45.   y=3
  46.   for i=1,10 do
  47.    m.setCursorPos(1,y)
  48.    m.write("Sleeping 10 seconds: "..i)
  49.    sleep(1)
  50.    y=y+1
  51.   end
  52.   m.setCursorPos(1,y)
  53.   m.write("All Done")
  54.   m.clear()
  55.   m.setCursorPos(1,1)
  56.   m.write("Checking all devices")
  57.   m.setCursorPos(1,2)
  58.   m.write("Reactor 1 Fluidport :")
  59.   m.write(peripheral.isPresent("reactor_fluid_port_1"))
  60.   m.setCursorPos(1,3)
  61.   m.write("Reactor 2 Fluidport :")
  62.   m.write(peripheral.isPresent("reactor_fluid_port_2"))
  63.   m.setCursorPos(1,4)
  64.   m.write("Reactor 3 Fluidport :")
  65.   m.write(peripheral.isPresent("reactor_fluid_port_3"))
  66.   m.setCursorPos(1,5)
  67.   m.write("Reactor 4 Fluidport :")
  68.   m.write(peripheral.isPresent("reactor_fluid_port_4"))
  69.   m.setCursorPos(1,6)
  70.   m.write("Reactor 5 Fluidport :")
  71.   m.write(peripheral.isPresent("reactor_fluid_port_5"))
  72.   m.setCursorPos(1,7)
  73.   m.write("Reactor 6 Fluidport :")
  74.   m.write(peripheral.isPresent("reactor_fluid_port_6"))
  75. end
  76.  
  77. warmup()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement