Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rs_output = {}
- rs_output.__index = rs_output
- local other_id = 5
- rednet.open("back")
- function rs_output:new(side)
- local object_table = {side = side}
- setmetatable(object_table, self)
- return object_table
- end
- function rs_output:enable()
- print(self.side, "enable")
- rs.setOutput(self.side ,true)
- end
- function rs_output:disable()
- print(self.side, "disable")
- rs.setOutput(self.side ,false)
- end
- function rs_output:get_input()
- return rs.getInput(self.side)
- end
- local gearshift = rs_output:new("right")
- local sticker = rs_output:new("top")
- rednet.send(other_id)
- repeat
- until rednet.receive() == other_id
- sticker:enable()
- sleep(0.2)
- sticker:disable()
- gearshift:enable()
- sleep(3)
- gearshift:disable()
- repeat
- until rednet.receive() == other_id
- rednet.send(other_id)
Advertisement
Add Comment
Please, Sign In to add comment