Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("left")
- local xmit = peripheral.wrap("top")
- local numberMinutes = 0
- local counterMinutes = 0
- local counterSeconds = 0
- function newLine()
- local _,cY= monitor.getCursorPos()
- if cY > 4 then
- monitor.setCursorPos(1,1)
- else
- monitor.setCursorPos(1,cY+1)
- end
- function clearMonitor()
- monitor.clear()
- monitor.setCursorPos(1,1)
- end
- function testSolar()
- local time = os.time()
- if ( time < 5 ) or ( time > 18 ) then
- clearMonitor()
- monitor.write( "Warning! No solar " )
- newLine()
- monitor.write( "power. Pausing " )
- monitor.write( "operations. " )
- redstone.setOutput("bottom", false)
- sleep(50)
- redstone.setOutput("bottom", true)
- end
- end
- while true do
- monitor.write( "Automated Ore " )
- newLine()
- monitor.write( "Processing System " )
- newLine()
- monitor.write( "Awaiting input. " )
- newLine()
- print("Automated Ore Processing System.")
- print("Please enter the number of")
- write("minutes of operation: ")
- numberMinutes = tonumber(read())
- clearMonitor()
- monitor.write( "Warming up system. " )
- newLine()
- redstone.setOutput("bottom", true)
- os.sleep(60)
- monitor.write( " Warmup complete. " )
- newLine()
- while counterMinutes < numberMinutes do
- monitor.write( " Running ... " )
- newLine()
- monitor.write(""..numberMinutes.." mins remaining.")
- print("Running ... "..numberMinutes.." minutes remaining.")
- while counterSeconds < 60 do
- redstone.setOutput("top", true)
- os.sleep(0.5)
- redstone.setOutput("top", false)
- os.sleep(0.5)
- counterSeconds = counterSeconds + 1
- print(counterSeconds)
- end
- counterSeconds = 0
- counterMinutes = counterMinutes + 1
- clearMonitor()
- end
- monitor.write( "Completed. " )
- newLine()
- monitor.write( os.time() )
- newLine()
- print("Processing complete.")
- redstone.setOutput("bottom", false)
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement