Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- output = "top" -- Redstone output
- input = "right" -- Redstone input
- monitorpos = "left" -- Monitor position
- cooldown = 30 -- Cooldown in sec
- intervall = 1 -- Intervall to check rs signal
- -- Set output default to off and do other default sets
- status = 0
- local monitor = peripheral.wrap( monitorpos )
- rs.setOutput( output, false )
- print( "Bereit" )
- monitor.clear( )
- monitor.setCursorPos( 1, 1 )
- monitor.write( "Bereit!" )
- while true
- do
- if ( rs.getInput( input ) == true ) and ( status == 0 )
- then
- status = 1
- write( "Feuert..." )
- monitor.clear( )
- monitor.setCursorPos( 1, 1 )
- monitor.write( "Feuer!" )
- rs.setOutput( output, true )
- sleep( 1 )
- rs.setOutput( output, false )
- write( "Fertig.\n" )
- print( cooldown.."sec Cooldown..." )
- i = cooldown
- while i > 0
- do
- monitor.clear( )
- monitor.setCursorPos( 2, 1 )
- monitor.write( "Wait:" )
- if i > 9
- then
- monitor.setCursorPos( 3, 3 )
- else
- monitor.setCursorPos( 4, 3 )
- end
- monitor.write( i.."s" )
- i = i - 1
- sleep( 1 )
- end
- --rs.setOutput( output, false )
- print( "Bereit" )
- monitor.clear( )
- monitor.setCursorPos( 1, 1 )
- monitor.write( "Bereit!" )
- status = 0
- end
- sleep( intervall )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement