Shallow depth warning and avoidance using lua

Ok that didn’t work. What should I use instead altitude.