Calling a Function in IF loop

First step in using sensors is knowing how they operate. For that you would want to know what values they return when they encounter real world object. Do you know what that line looks like to your robot in it’s line-sensor ‘eyes’? Max values? Minimum values? Are high values black/no reflection, or are they inverted? How does it respond to different line thicknesses? Can a line be registered when it is between the sensors elements, or does it vanish in a blindspot. How long does a sample take? Does fast movement of the robot make the sensor skip over the line? Learn the characteristics of the robot with sensor and lines/whatever in the world first. Make a simple program that reads these values continuously and reports then on a display or your pc. Then, when you know how they respond, you start to write more complex programs that does something with the numbers to act on them.

Your code:

if((sensors[0] >1000) ||  (sensors[4] >1000))
  {
    motor1.run(FORWARD);
    motor2.run(FORWARD);
    delay(2000);
    seeek();
    
  }

seems to look ok code-wise. I don’t know if the values make sense, as I don’t have such a device. If sensor 0 returns a value larger than 1000 AND sensor 4 (probably the 5th element on the sensor array) returns a value larger than 1000 also, then it runs both motors forward, waits 2 seconds, and does the seeek thing.

As running the motors would upset how the robot behaves when the condition is met I would take those statements out (also the seeek command, as it too controls the motors) and replace it with statements that light up a led or something, to indicate that the condition is met. Then moving the robot by hand you have more control over it to find out exactly how it registers the line.