Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p1 = 'left'
- local p2 = 'top'
- local p3 = 'bottom'
- local p4 = 'back'
- local p5 = 'right'
- local p1State = false
- local p2State = false
- local p3State = false
- local p4State = false
- local p5State = false
- function togglePiston(index)
- if index == 1 then
- p1State = not p1State
- rs.setOutput(p1, p1State)
- elseif index == 2 then
- p2State = not p2State
- rs.setOutput(p2, p2State)
- elseif index == 3 then
- p3State = not p3State
- rs.setOutput(p3, p3State)
- elseif index == 4 then
- p4State = not p4State
- rs.setOutput(p4, p4State)
- elseif index == 5 then
- p5State = not p5State
- rs.setOutput(p5, p5State)
- end
- end
- function extendPistons()
- togglePistion(1)
- sleep(0.25)
- togglePistion(3)
- sleep(0.25)
- togglePistion(5)
- end
- function retractPistons()
- togglePistion(5)
- sleep(0.25)
- togglePistion(3)
- sleep(0.25)
- togglePistion(4)
- sleep(0.25)
- togglePistion(4)
- sleep(0.25)
- togglePistion(1)
- sleep(0.25)
- togglePistion(2)
- sleep(0.25)
- togglePistion(2)
- sleep(0.25)
- togglePistion(3)
- sleep(0.25)
- togglePistion(3)
- end
- print('Press and hold CTRL+T to stop')
- while true do
- extendPistons()
- sleep(1)
- retractPistons()
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement