Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local turtle_id = 4
- os.loadAPI("Orion_API.lua")
- rednet.open("right")
- term.redirect(peripheral.find("monitor"))
- Orion_API.reset()
- while true do
- local id, message = rednet.receive() -- {{x,y,z}, fuel, oil}
- if id == turtle_id then
- if message[3] then
- Orion_API.reset()
- local x,y,z = table.unpack(message[1])
- local str = "OIL HAS BEEN FOUND AT:\nX: "..x.."\nY: "..y.."\nZ: "..z.."\nTURTLE SHUTTING DOWN."
- write(str)
- local f = fs.open("location.txt", "w")
- f.write(str)
- f.close()
- else
- Orion_API.reset()
- local x,y,z = table.unpack(message[1])
- write("CURRENT POSITION:\nX: "..x.."\nY: "..y.."\nZ: "..z.."\nFUEL: "..message[2])
- end
- end
- end
Add Comment
Please, Sign In to add comment