Vex Line Follower Robot not detecting dark line on light surface

Are you using VEX Light Sensor or the Line Tracker Sensor?

Unlike Light sensor, Line Tracker has its own built-in infrared light source and doesn’t need any additional lighting.

Here is a great resource on how to use Line Trackers:

https://renegaderobotics.org/vex-sensors-line-tracker/

The main problem that I see with your code is that motor values for turnleft() and straight() are incorrect. Also you don’t have to start new task every time you need to adjust your heading.

And this is the sample code for the Line Follower robot with Triple Line Tracker: