DIY spraying drone

Greetings to all. I’m new here. I’m assembling my mini agricultural drone. The fact is that I want my drone to:

  1. was autonomous
  2. he himself would start spraying fertilizers, and if they ran out, then he himself would return home.
  3. also if you refill the fertilizer again, then the mission would continue from the very place where it stopped
  4. and if the battery runs out, then replacing it would continue the mission.
    I am not strong in this, and I do not understand English well, since I come from Lithuania. But if someone understands this and collected similar devices, I will be very grateful for useful information.

I use:
pixhawk 4 radiolink controller
flysky i6s control equipment
water sensor, this is YF-401 water flow sensor.
Water pump 12v.
pwm relay will also come to me soon