Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wifi = peripheral.wrap("back")
- modem = peripheral.wrap("top")
- cr1 = peripheral.wrap("CentralControl_0")
- cr2 = peripheral.wrap("CentralControl_5")
- cr3 = peripheral.wrap("CentralControl_4")
- cr4 = peripheral.wrap("CentralControl_2")
- wifi.closeAll()
- wifi.open(2)
- while true do
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- if senderChannel == 2 then
- i = tonumber(message)
- term.clear()
- term.setCursorPos(1,1)
- print(tostring(i))
- if bit.band(i,1) > 0 then
- cr1.raiseRods()
- else
- cr1.lowerRods()
- end
- if bit.band(i,2) > 0 then
- cr2.raiseRods()
- else
- cr2.lowerRods()
- end
- if bit.band(i,4) > 0 then
- cr3.raiseRods()
- else
- cr3.lowerRods()
- end
- if bit.band(i,8) > 0 then
- cr4.raiseRods()
- else
- cr4.lowerRods()
- end
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement