Advertisement
squelch

Untitled

Mar 29th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. local monitor = peripheral.wrap("left")
  2. local xmit = peripheral.wrap("top")
  3. local numberMinutes = 0
  4. local counterMinutes = 0
  5. local counterSeconds = 0
  6.  
  7. function newLine()
  8. local _,cY= monitor.getCursorPos()
  9. if cY > 4 then
  10. monitor.setCursorPos(1,1)
  11. else
  12. monitor.setCursorPos(1,cY+1)
  13. end
  14.  
  15. function clearMonitor()
  16. monitor.clear()
  17. monitor.setCursorPos(1,1)
  18. end
  19.  
  20. function testSolar()
  21. local time = os.time()
  22. if ( time < 5 ) or ( time > 18 ) then
  23. clearMonitor()
  24. monitor.write( "Warning! No solar " )
  25. newLine()
  26. monitor.write( "power. Pausing " )
  27. monitor.write( "operations. " )
  28. redstone.setOutput("bottom", false)
  29. sleep(50)
  30. redstone.setOutput("bottom", true)
  31. end
  32. end
  33.  
  34.  
  35. while true do
  36. monitor.write( "Automated Ore " )
  37. newLine()
  38. monitor.write( "Processing System " )
  39. newLine()
  40. monitor.write( "Awaiting input. " )
  41. newLine()
  42. print("Automated Ore Processing System.")
  43. print("Please enter the number of")
  44. write("minutes of operation: ")
  45. numberMinutes = tonumber(read())
  46. clearMonitor()
  47. monitor.write( "Warming up system. " )
  48. newLine()
  49.  
  50. redstone.setOutput("bottom", true)
  51.  
  52. os.sleep(60)
  53.  
  54.  
  55. monitor.write( " Warmup complete. " )
  56. newLine()
  57.  
  58. while counterMinutes < numberMinutes do
  59.  
  60. monitor.write( " Running ... " )
  61. newLine()
  62. monitor.write(""..numberMinutes.." mins remaining.")
  63. print("Running ... "..numberMinutes.." minutes remaining.")
  64. while counterSeconds < 60 do
  65. redstone.setOutput("top", true)
  66. os.sleep(0.5)
  67. redstone.setOutput("top", false)
  68. os.sleep(0.5)
  69. counterSeconds = counterSeconds + 1
  70. print(counterSeconds)
  71. end
  72. counterSeconds = 0
  73. counterMinutes = counterMinutes + 1
  74. clearMonitor()
  75. end
  76. monitor.write( "Completed. " )
  77. newLine()
  78. monitor.write( os.time() )
  79. newLine()
  80. print("Processing complete.")
  81. redstone.setOutput("bottom", false)
  82. sleep(5)
  83. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement