How to control the line detector line position and drop the line

can you help me fix my code, please !!!