Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back") --Open rednet, make clearing the screen a single function
- function clear() term.clear() term.setCursorPos(1, 1) end
- while true do
- clear()
- print("Polaczono, ID: ", os.computerID(), ". Szukam turtle...")
- print("Upewnij sie ze turtle ma wlaczony serwer.")
- id, msg = rednet.receive() --Wait for a turtle to say it is "Listening"
- if msg == "Listening" then
- rednet.send(id, "goto") --When a waiting turtle is found send the command (goto) to its ID so it can ready for the transmision of coordinates
- clear()
- print("Turtle znaleziony, wprowadz koordynaty...")
- print("Upewnij sie, ze posiadasz satelite GPS.")
- print("Podaj pozycje X")
- local gox = tonumber(io.read()) --Get the coordinates from the player, they could be aquired by another means if needed
- clear()
- print("Podaj pozycje Y")
- local goy = tonumber(io.read())
- clear()
- print("Podaj pozycje Z")
- local goz = tonumber(io.read())
- clear()
- print("Koordynaty to: ")
- print("X: ",x)
- print("Y: ",y)
- print("Z: ",z)
- print("Koordynaty wyslane do turtla.")
- rednet.send(id, tostring(gox)) --Convert the coordinates to strings (as rednet only sends strings) and send them to the waiting turtle
- sleep(0.5)
- rednet.send(id, tostring(goy))
- sleep(0.5)
- rednet.send(id, tostring(goz))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement