Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("left")
- function centerPrint(txt)
- w, h = term.getSize()
- term.setCursorPos(w / 2 - math.floor(string.len(txt) / 2), h / 2)
- print(txt)
- end
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- term.clear()
- term.setCursorPos(1,1)
- centerPrint("Waiting for server...")
- rednet.broadcast("hello?")
- id, msg = rednet.receive("im here!", 5)
- if msg == "im here!" then
- term.clear()
- centerPrint("Server found!")
- else
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.red)
- term.clear()
- print("Server not found or invalid server contacted.")
- sleep(4)
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement