Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Establish RedNet Connection --
- first = true
- while (rednet.isOpen("left") == false) do
- print("Attempting to start RedNet...")
- rednet.open("left")
- if (first) then
- os.sleep(1)
- else
- os.sleep(3)
- end
- end
- print("RedNet running.")
- print("Establishing connection to host...")
- foundHost = false; fAttempt = 0;
- while (foundHost == false) do
- senderID, netResp = rednet.receive(3)
- if netResp == "Host Cast" then
- foundHost = true
- else
- if (fAttempt < 50) then
- print("Failed to connect to host, retrying...")
- fAttempt = fAttempt + 1
- print(netResp.." from "..senderID)
- os.sleep(1)
- else
- print("Could not find host.")
- return
- end
- end
- end
- if (foundHost == true) then
- print("Host found, pinging...")
- else
- print("Error! Skipped host find!")
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement