Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local deplSide = "right" -- Transposer leading to the deployer
- local chstSide = "left" -- Transposer leading to catch chest
- local holdSide = "top" -- Input to shut off the deployer and send all output to catch chest
- local offSide = "back" -- Input to halt activity entirely
- local deployN = 4 -- Send N eggs to the deployer for every one that gets saved
- local countN = 1 -- Start the counter at 1
- local version = "1.2"
- local function redPulse( side )
- redstone.setOutput( side, true )
- sleep(0.1)
- redstone.setOutput( side, false )
- end
- local function main()
- print("SkunkWorks Logistics")
- print("Egg processing routine v"..version)
- print("If routine has been aborted, run 'eggtimer' to restart it")
- while true do
- if rs.getInput( offSide ) then
- os.pullEvent("redstone") -- Wait for a redstone input to change, otherwise stop looping
- else
- if rs.getInput( holdSide ) then
- redPulse( chstSide )
- else
- countN = countN + 1
- if countN >= deployN then
- redPulse( chstSide)
- countN = 1 -- Reset the counter
- else
- redPulse(deplSide)
- end
- end
- sleep(1)
- end
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement