Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rs = component.proxy(component.list('redstone')())
- modem = component.proxy(component.list('modem')())
- distanation = 'blue'
- invert = false
- if modem.isWireless() then
- error('The modem must bo wired')
- end
- modem.open(1)
- --[[sign, name = component.list("sign")()
- if name == "sign" then
- comSign = component.proxy(sign)
- _text, reson = comSign.getValue(1)
- if reson ~= "no sign" then
- messageText = "Distanation = \n" .. distanation .. '\nInv = ' .. tostring(invert)
- comSign.setValue(1, messageText)
- end
- end
- ]]--
- computer.beep()
- function waitMessage()
- while true do
- ev, _, _, _, _, dist = computer.pullSignal(10)
- if ev == 'modem_message' then
- return dist
- end
- end
- end
- function open(i)
- if not i then
- rs.setOutput(5, 16)
- rs.setOutput(4, 16)
- else
- rs.setOutput(5, 0)
- rs.setOutput(4, 0)
- end
- end
- function close(i)
- if not i then
- rs.setOutput(5, 0)
- rs.setOutput(4, 0)
- else
- rs.setOutput(5, 16)
- rs.setOutput(4, 16)
- end
- end
- while true do
- d = waitMessage()
- if d == distanation then
- open(invert)
- computer.beep(1500, 1)
- else
- close(invert)
- computer.beep(1500, 1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement