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 --
- if PartnerID ~= "0" then-- opens if loop checking if partner ID is not 0
- rednet.send(PartnerID, "ID") -- Sends ID to partners I
- else -- runs if partners ID is 0 so unreceived
- while PartnerID == "0" do -- while loop works intil partners ID is received
- print("I have not got a message")
- PartnerID = rednet.receive(59) -- Sets PartnerID to the message it receives (stupid I know but its just testing) or times out after 59 secs
- end -- ends while loop
- end -- ends if loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement