SHOW:
|
|
- or go back to the newest paste.
| 1 | modem = peripheral.find("modem")
| |
| 2 | ID = os.getComputerID() | |
| 3 | print("ID = "..ID)
| |
| 4 | ||
| 5 | rednet.open("back")
| |
| 6 | ||
| 7 | - | function gppp() |
| 7 | + | function getPos() |
| 8 | while true do | |
| 9 | x, y, z = gps.locate(10) | |
| 10 | loc = {x,y,z}
| |
| 11 | term.setCursorPos(1, 3) | |
| 12 | rednet.send(sender, loc, sendLoc) | |
| 13 | for i, v in ipairs(loc) do | |
| 14 | print(v) | |
| 15 | end | |
| 16 | end | |
| 17 | end | |
| 18 | ||
| 19 | while true do | |
| 20 | event, sender, message, protocol = os.pullEvent("rednet_message")
| |
| 21 | if message == "con1" then | |
| 22 | print("connected")
| |
| 23 | - | gppp() |
| 23 | + | getPos() |
| 24 | end | |
| 25 | end |