Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local id = 25000 + os.getComputerId()
- local modem = peripheral.find("modem") or error("No modem attached", 0)
- modem.open(id)
- modem.transmit(24999,nil,"Turtle "..os.getComputerId().." has started scanning")
- repeat
- local x,y,z = gps.locate()
- if not x or not y or not z then error("Cannot connect to GPS",0) end
- local down,down_data = turtle.inspectDown()
- local up,up_data = turtle.inspectUp()
- local front,front_data = turtle.inspect()
- if down then modem.transmit(id,nil,"X"..x.."Y"..(y-1).."Z"..z.."B"..down_data.name) end
- if up then modem.transmit(id,nil,"X"..x.."Y"..(y+1).."Z"..z.."B"..up_data.name) end
- --modem.transmit(id,nil,"X"..x.."Y"..y.."Z"..z.."B"..turtle.)
- event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
- until channel == id and message == "stop scan"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement