Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Setting Variables--
- local Screen = peripheral.wrap("right") -- connects to the monitor on the right and gives it the local variable Screen
- local ID = os.getComputerID() -- gets the computers ID
- local PartnerID = "0"
- --Opens modem--
- rednet.open("top") -- Tells CC to use the modem on the top
- -- Displays ID --
- Screen.clear() -- Clears the Screen
- Screen.setCursorPos(1,1) -- Resets the pos to start righting from
- Screen.write("My ID is "..ID) -- Writes "My ID is ID"
- -- Finds Partner --
- while true do -- Opens while loop
- rednet.broadcast(ID) -- sends out its ID
- print("I have not got a message")
- Screen.clear() -- Clears the Screen
- Screen.setCursorPos(1,1) -- Resets the pos to start righting from
- Screen.write("My partner's ID is "..PartnerID) -- Writes "My partner's ID is ID"
- PartnerID = rednet.receive(59) -- Sets PartnerID to the message it receives (stupid I know but its just testing) or times out after 59 secs
- sleep(1) -- Sleeps for a second
- end -- ends loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement